Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPropertyInterceptor combine with IMethodInterceptorOnExit #82

Open
SimonPesant opened this issue May 21, 2019 · 0 comments
Open

IPropertyInterceptor combine with IMethodInterceptorOnExit #82

SimonPesant opened this issue May 21, 2019 · 0 comments

Comments

@SimonPesant
Copy link

Hi all,

I could not find the information in the wiki so I'm asking here.

I created a small Property Attribute to intercept Properties :

[AttributeUsage(AttributeTargets.Property)]
public sealed class ViewContextAttribute : Attribute, IPropertyInterceptor, IPropertyInterceptorInitialize, IMethodInterceptor, IMethodInterceptorOnExit
{
    [AssignMethod("Get{Name}", true)]
    public Func<bool> _onGetProperty;
    ...
}

When it complies, everything works fine, but I was wondering if when the AssignMethod is found, it could wrap it with the MethodInterceptor functionalities?

[ViewContext()]
public bool IsDraggingEnabled => GetIsDraggingEnabled();

In other words, I want to override the return value of IsDraggingEnabled but never loose the actual value of GetIsDraggingEnabled();
Is it something possible?
Thanks for your help.
Simon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant