private bool OnRuntimeMemoryAllocationChanging(IntPtr callbackState, JavaScriptMemoryEventType allocationEvent, UIntPtr allocationSize) { if (!IsDisposed && null != MemoryAllocationChanging) { lock (MemoryAllocationChanging) { if (null != MemoryAllocationChanging) { var args = new JavaScriptMemoryEventArgs(allocationSize, allocationEvent); MemoryAllocationChanging(this, args); if (args.IsCancelable && args.Cancel) { return(false); } } } } return(true); }
public JavaScriptMemoryEventArgs(UIntPtr amount, JavaScriptMemoryEventType type) { Amount = amount; Type = type; }