Hi,

Sorry about ugly formatting in the previous post. Here's improved version:

I redid the implementation to use proxyGenerationOptions's Selector

the patch with new version is in donjon: 
http://support.castleproject.org/projects/DYNPROXY/issues/view/DYNPROXY-ISSUE-37

Here's Reflector's C# view of sample method from one of tests.

public override int Do()
{
    if (this.tokenCache1_interceptors == null)
    {
        this.tokenCache1_interceptors = 
proxyGenerationOptions.Selector.SelectInterceptors(typeTokenCache, 
tokenCache1, this.__interceptors);
    }
    if (this.tokenCache1_interceptors == null)
    {
        this.tokenCache1_interceptors = new IInterceptor[0];
    }
    if (this.tokenCache1_interceptors.Length == 0)
    {
        return base.Do();
    }
    object[] objArray = new object[0];
    InvocationDo_1 o_ = new InvocationDo_1(this, 
this.tokenCache1_interceptors, typeTokenCache, tokenCache1, objArray, this);
    o_.Proceed();
    return (int) o_.ReturnValue;
}

Cheers,
Krzysztof

Fabian Schmied pisze:
>> You can't do that.
>> Simple reason is, that you don't get access to interceptors while generating 
>> proxy type, ergo you can't call selector on them, ergo it has to be done at 
>> runtime.
>>     
>
> Hm, that's true. Let's see what Hammett says.
>
> Fabian
>
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
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