I've recently blogged about it(now i am sure that it works :), with the help
of compiler and unit tests)

http://tunatoksoz.com/post/Castle-ServiceIdResolver.aspx

Comments are all welcome!

On Mon, Nov 10, 2008 at 11:57 PM, Tuna Toksöz <[EMAIL PROTECTED]> wrote:

>
>     public bool CanResolve(CreationContext context, ISubDependencyResolver
> parentResolver, ComponentModel model, DependencyModel dependency)
>     {
>         if (model.Parameters[dependency.DependencyKey].Name == "serviceId")
>             return true;
>     }
>
> No test is done, though.
>
>
> On Mon, Nov 10, 2008 at 11:54 PM, Tuna Toksöz <[EMAIL PROTECTED]> wrote:
>
>> Define a convention, serviceID for example,
>>
>>             String key = dependency.DependencyKey;
>>
>>             if (key == null) return null;
>>
>>             ParameterModel pmodel=model.Parameters[key];
>>
>> ParameterModel has a number of properties including name. I hope this
>> works(not tested, though)
>>
>>
>> On Mon, Nov 10, 2008 at 11:35 PM, Jan Limpens <[EMAIL PROTECTED]>wrote:
>>
>>>
>>> Hm, this is one of theses places where it is quite difficult to come
>>> around, without having good knowledge of windsor's internal
>>> workings...
>>> Anyone can give me a a bit more concrete hint, of how I can achieve
>>> the above api?
>>>
>>> I think I have two options:
>>> one would be to inject the name of the registration into the service
>>> and return this by a regular ResolveAll() or
>>> I could somehow tell Windsor to pass me the registered services
>>> together with their keys as a dictionary.
>>>
>>> but, for now, I have no idea how to implement this...
>>>
>>> On Mon, Oct 27, 2008 at 7:45 PM, Jan Limpens <[EMAIL PROTECTED]>
>>> wrote:
>>> > I have this situation:
>>> >
>>> >
>>> >         public IList<IOrderRule> ResolveAll()
>>> >         {
>>> >             return kernel.ResolveAll<IOrderRule>();
>>> >         }
>>> >
>>> >         public IDictionary<string, IOrderRule> ResolveAllWithKey()
>>> >         {
>>> >          ...?
>>> >         }
>>> >
>>> > ISubResolver only has a Resolve() for a single item. How can I come
>>> around
>>> > this?
>>> >
>>> >
>>> > On Fri, Oct 24, 2008 at 10:19 PM, Ayende Rahien <[EMAIL PROTECTED]>
>>> wrote:
>>> >>
>>> >> You can use a ISubDependencyResolver
>>> >>
>>> >> On 10/25/08, Jan Limpens <[EMAIL PROTECTED]> wrote:
>>> >> > If I register a component like so
>>> >> >
>>> >> > <component id="xxx" type="sometype" service="someservice">
>>> >> >             <parameters>
>>> >> >                 <description>bla</description>
>>> >> >             </parameters>
>>> >> >         </component>
>>> >> >
>>> >> > and I also want to use the component's id as a parameter without
>>> having
>>> >> > to
>>> >> > repeat myself, how could I do that?
>>> >> >
>>> >> > public class sometype : someservice {
>>> >> >   public sometype(string id, string description){
>>> >> >     ...
>>> >> >   }
>>> >> > }
>>> >> >
>>> >> > --
>>> >> > Jan
>>> >> > ___________________
>>> >> > [EMAIL PROTECTED]
>>> >> > www.limpens.com
>>> >> > +55 (11) 3082-1087
>>> >> > +55 (11) 3097-8339
>>> >> >
>>> >> > >
>>> >> >
>>> >>
>>> >> >>
>>> >
>>> >
>>> >
>>> > --
>>> > Jan
>>> > ___________________
>>> > [EMAIL PROTECTED]
>>> > www.limpens.com
>>> > +55 (11) 3082-1087
>>> > +55 (11) 3097-8339
>>> >
>>>
>>>
>>>
>>> --
>>> Jan
>>> ___________________
>>> [EMAIL PROTECTED]
>>> www.limpens.com
>>> +55 (11) 3082-1087
>>> +55 (11) 3097-8339
>>>
>>> >>>
>>>
>>
>>
>> --
>> Tuna Toksöz
>>
>> Typos included to enhance the readers attention!
>>
>
>
>
> --
> Tuna Toksöz
>
> Typos included to enhance the readers attention!
>



-- 
Tuna Toksöz

Typos included to enhance the readers attention!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to