public void OpenPatchEditor(Node node, IHDEHost hdeHost, PatchHandle patchHandle = null) { PatchEditor.OpenCanvasOfNode(node, patchHandle); //setting the control also brings the window to front hdeHost.FiftyEditor = this; hdeHost.ShowVLEditor(); }
public void Restore() { if (IsPatched) { Restore(_original, _patchHandle); } Debug.Assert(!IsPatched); _patchHandle = null; _original = null; _postfix = null; }
private static void Restore(MethodBase original, PatchHandle patchHandle) { if (patchHandle == null) { throw new ArgumentNullException(nameof(patchHandle)); } if (patchHandle.IsDisposed) { throw new InvalidOperationException($"{nameof(patchHandle)} is disposed!"); } var originalCodeStart = Memory.GetMethodStart(original); Memory.WriteBytes(originalCodeStart, patchHandle.OverwrittenCode); patchHandle.Dispose(); }
private Patch(MethodBase original, MethodInfo postfix, PatchHandle patchHandle) { _original = original; _postfix = postfix; _patchHandle = patchHandle; }