C# Class Prism.Injector.Patcher.WrapperHelperExtensions

Afficher le fichier Open project: TerrariaPrismTeam/Prism

Méthodes publiques

Méthode Description
ReplaceAllMethodRefs ( this targetRef, IMethod newRef, DNContext context, bool exitRecursion = true ) : void

Replaces all method references with the specified reference within the specified context.

ReplaceAndHook ( this toHook, MethodDef invokeHook, MethodDef realMethod, string fieldName ) : MethodDef
Wrap ( this method, DNContext context ) : void

Wraps a method using a fancy delegate. Replaces all references of the method with the wrapped one and creates an "On[MethodName]" hook which passes the method's parent type followed by the type parameters of the original method.

Wrap ( this origMethod, DNContext context, string delegateNS, string delegateTypeName, string fieldName ) : void

Wraps a method using a fancy delegate. Replaces all references of the method with the wrapped one and creates an "On[MethodName]" hook which passes the method's parent type followed by the type parameters of the original method.

Private Methods

Méthode Description
BuildArgTypesString ( MethodDef method ) : string
DefDelTypeName ( MethodDef method ) : string[]
GetOverloadedName ( MethodDef method ) : string
GetSafeMethodName ( string methodName ) : string

Method Details

ReplaceAllMethodRefs() public static méthode

Replaces all method references with the specified reference within the specified context.
public static ReplaceAllMethodRefs ( this targetRef, IMethod newRef, DNContext context, bool exitRecursion = true ) : void
targetRef this The to replace.
newRef IMethod The to replace targetRef with.
context DNContext The current .
exitRecursion bool Excludes recursive method calls from the replacement operation (may have undesired consequences with recursive methods).
Résultat void

ReplaceAndHook() public static méthode

public static ReplaceAndHook ( this toHook, MethodDef invokeHook, MethodDef realMethod, string fieldName ) : MethodDef
toHook this
invokeHook MethodDef
realMethod MethodDef
fieldName string
Résultat MethodDef

Wrap() public static méthode

Wraps a method using a fancy delegate. Replaces all references of the method with the wrapped one and creates an "On[MethodName]" hook which passes the method's parent type followed by the type parameters of the original method.
public static Wrap ( this method, DNContext context ) : void
method this
context DNContext The current Cecil context.
Résultat void

Wrap() public static méthode

Wraps a method using a fancy delegate. Replaces all references of the method with the wrapped one and creates an "On[MethodName]" hook which passes the method's parent type followed by the type parameters of the original method.
public static Wrap ( this origMethod, DNContext context, string delegateNS, string delegateTypeName, string fieldName ) : void
origMethod this The method to wrap.
context DNContext The current Cecil context.
delegateNS string The namespace of the delegate type to create.
delegateTypeName string The name of the delegate type to create.
fieldName string
Résultat void