private void Initialise(InitParams aParams) { iLogOutput = aParams.LogOutput; iFatalErrorHandler = aParams.FatalErrorHandler; iAsyncBeginHandler = aParams.AsyncBeginHandler; iAsyncEndHandler = aParams.AsyncEndHandler; iAsyncErrorHandler = aParams.AsyncErrorHandler; iSubnetListChangedListener = aParams.SubnetListChangedListener; iSubnetAddedListener = aParams.SubnetAddedListener; iSubnetRemovedListener = aParams.SubnetRemovedListener; iNetworkAdapterChangedListener = aParams.NetworkAdapterChangedListener; IntPtr nativeInitParams = aParams.AllocNativeInitParams(IntPtr.Zero); OhNetInitParamsSetFreeExternalCallback(nativeInitParams, FreeMemory); if (0 != OhNetLibraryInitialise(nativeInitParams)) { InitParams.FreeNativeInitParams(nativeInitParams); throw new LibraryException(); } }
private void Initialise(InitParams aParams) { IntPtr nativeInitParams = aParams.AllocNativeInitParams(IntPtr.Zero); iCallbackFreeMemory = new CallbackFreeMemory(FreeMemory); OhNetInitParamsSetFreeExternalCallback(nativeInitParams, iCallbackFreeMemory); if (0 != OhNetLibraryInitialise(nativeInitParams)) { InitParams.FreeNativeInitParams(nativeInitParams); throw new LibraryException(); } }