But .Keys is not ordered. That's where you should use a list.

On Sun, Mar 8, 2009 at 8:27 AM, Martin Nilsson <[email protected]> wrote:
> http://support.castleproject.org/projects/MR/issues/view/MR-ISSUE-515
>
> I agree with Ken Egozi regarding his comment to use a List instead. Should I
> create a new patch for this?
>
> Currently, it's only the keys in the hashtable that are used anyway. Like
> this
>
> DefaultViewEngineManager:
> public void RegisterEngineForExtesionLookup(IViewEngine engine)
> {
>   viewEnginesFastLookup.Add(engine, null);
> }
>
> public virtual IViewEngine ResolveEngine()
> {
>   ...
>   foreach(IViewEngine engine in viewEnginesFastLookup.Keys)
>   ...
> }
>
> On Sat, Feb 21, 2009 at 7:44 PM, Martin Nilsson <[email protected]> wrote:
>>
>> Any news regarding this patch?
>> http://support.castleproject.org/projects/MR/issues/view/MR-ISSUE-515
>>
>> On Sat, Jan 24, 2009 at 12:15 AM, hammett <[email protected]> wrote:
>>>
>>> Yes, I will take a look soon :-)
>>>
>>> On Fri, Jan 23, 2009 at 5:32 AM, Martin Nilsson <[email protected]>
>>> wrote:
>>> >
>>> > Anyone had a chance to look at this or all full booked? Don't want to
>>> > push, just want to get some feedback, even if it will be "yes, I will
>>> > have a look next month" :)
>>> >
>>> > On Jan 21, 12:01 pm, Martin Nilsson <[email protected]> wrote:
>>> >> Issue and patch attached. Please have a
>>> >> look.http://support.castleproject.org/projects/MR/issues/view/MR-ISSUE-515
>>> >>
>>> >> On Jan 20, 10:18 pm, "Martin Nilsson" <[email protected]> wrote:
>>> >>
>>> >> > I need a feature to be able to prioritize registered view engines of
>>> >> > the
>>> >> > same type. More concrete.
>>> >>
>>> >> > In DefaultViewEngineManager.ResolveEngine(String templateName, bool
>>> >> > throwIfNotFound) it should pick the view engine with highest
>>> >> > priority. So
>>> >> > more than one can have this template registered. Below code in
>>> >> > ResolveEngine
>>> >> > does not guarantee a specific order:
>>> >>
>>> >> > foreach(IViewEngine engine in viewEnginesFastLookup.Keys)
>>> >> > {
>>> >> >     if (engine.HasTemplate(templateName)) return engine;
>>> >>
>>> >> > }
>>> >>
>>> >> > Note: all of the engines is of the same type (Brail in my case) but
>>> >> > one
>>> >> > store the templates in files system (default), one is storing in
>>> >> > database,
>>> >> > one in memory (for preview).
>>> >> > The story behind this is that it should be possible to design the
>>> >> > site in
>>> >> > VS, then add those to the database so the user can change the site
>>> >> > from
>>> >> > admin application.
>>> >>
>>> >> > So what I want is to add a property on the IViewEngine called
>>> >> > something like
>>> >> > Priority and then use that when resolving.
>>> >>
>>> >> > * But this will break the interface thou and is that ok? *
>>> >>
>>> >> > The logic for old systems will not be changed thou because they will
>>> >> > get
>>> >> > priority 0 default and then that engine is used. But I can change
>>> >> > the
>>> >> > priority in my config.
>>> >>
>>> >> > Can I submit a patch for this?
>>> > >
>>> >
>>>
>>>
>>>
>>> --
>>> Cheers,
>>> hammett
>>> http://hammett.castleproject.org/
>>>
>>>
>>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to