https://nuget.org/packages/MethodDecorator.Fody.PP/
PM> Install-Package MethodDecorator.Fody.PP
This is an add-in for Fody
Fork of MethodDecorator
Compile time decorator pattern via IL rewriting
* A few bugs fixed
* Support for an attribute parameters and fields (attribute instantiation procedure now use GetCustomAtributes)
* OnExit now receiving return value of a method (optional)
* AspectPriority to alter decoration order for different attribute types
* Partial decoration to improve performance - any single method of an interceptor can be defined (requires IAspectMatchingRule implementation)
* Ability to skip actual execution of an intercepted method and substitute the return value (NeedBypass/AlterRetval)
namespace MethodDecorator.Fody.Interfaces
{
public interface IPartialDecoratorInit1
{
void Init(MethodBase iMethod);
}
public interface IPartialDecoratorInit2
{
void Init(object iInstance,MethodBase iMethod);
}
public interface IPartialDecoratorInit3
{
void Init(object iInstance, MethodBase iMethod, object[] iParameters);
}
public interface IPartialDecoratorEntry
{
void OnEntry();
}
public interface IPartialDecoratorExit
{
void OnExit();
}
public interface IPartialDecoratorExit1
{
void OnExit(object iRetval);
}
public interface IPartialDecoratorException
{
void OnException(Exception iException);
}
interface IPartialDecoratorContinuation
{
void OnTaskContinuation(Task task);
}
interface IPartialDecoratorNeedBypass
{
bool NeedBypass();
}
interface IPartialAlterRetval
{
object AlterRetval(object iRetval);
}
}
### Recent changes
[0.9.1.6] Fixed some PEVerify unjust complains
[0.9.1.5] Copied MethodDecoratorInterfaces.dll into Lib folder - to be added into project references when installing the package