Skip to content

IPropertyInterceptor combine with IMethodInterceptorOnExit #82

@SimonPesant

Description

@SimonPesant

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions