C# Class ExtraLanscapingToolsCommon.Redirection.RedirectionHelper

Helper class to deal with detours. This version is for Unity 5 x64 on Windows. We provide three different methods of detouring.
Datei anzeigen Open project: earalov/Skylines-NaturalResourcesBrush Class Usage Examples

Public Methods

Method Description
RedirectCalls ( MethodInfo from, MethodInfo to ) : RedirectCallsState

Redirects all calls from method 'from' to method 'to'.

RevertRedirect ( MethodInfo from, RedirectCallsState state ) : void

Private Methods

Method Description
PatchJumpTo ( IntPtr site, IntPtr target ) : RedirectCallsState

Primitive patching. Inserts a jump to 'target' at 'site'. Works even if both methods' callers have already been compiled.

RevertJumpTo ( IntPtr site, RedirectCallsState state ) : void

Method Details

RedirectCalls() public static method

Redirects all calls from method 'from' to method 'to'.
public static RedirectCalls ( MethodInfo from, MethodInfo to ) : RedirectCallsState
from System.Reflection.MethodInfo
to System.Reflection.MethodInfo
return RedirectCallsState

RevertRedirect() public static method

public static RevertRedirect ( MethodInfo from, RedirectCallsState state ) : void
from System.Reflection.MethodInfo
state RedirectCallsState
return void