public CallbackHolder(DotNetCallback toWrap, NativeNodeHost parent) { Wrapped = toWrap; _wrapper = OnCalled; CallbackPtr = Marshal.GetFunctionPointerForDelegate(_wrapper); _parent = parent; }
public IntPtr MarshallCallback(DotNetCallback callback, out ReleaseDotNetValue releaseCallback) { var holder = new CallbackHolder(callback, this); _registry.Add(holder.CallbackPtr, holder); releaseCallback = ReleaseCallback; return(holder.CallbackPtr); }