public IntPtr GetAsyncDisconnectNotificationDelegate() { if (IntPtr.Zero == _asyncDisconnectNotificationDelegatePointer) { lock (_delegatelock) { if (IntPtr.Zero == _asyncDisconnectNotificationDelegatePointer) { AsyncDisconnectNotificationDelegate d = new AsyncDisconnectNotificationDelegate(AsyncDisconnectNotificationHandler); if (null != d) { IntPtr p = Marshal.GetFunctionPointerForDelegate(d); if (IntPtr.Zero != p) { _asyncDisconnectNotificationDelegate = d; _asyncDisconnectNotificationDelegatePointer = p; } } } } } return(_asyncDisconnectNotificationDelegatePointer); }
public IntPtr GetAsyncDisconnectNotificationDelegate() { if (IntPtr.Zero == _asyncDisconnectNotificationDelegatePointer) { lock (_delegatelock) { if (IntPtr.Zero == _asyncDisconnectNotificationDelegatePointer) { AsyncDisconnectNotificationDelegate d = new AsyncDisconnectNotificationDelegate(AsyncDisconnectNotificationHandler); if (null != d) { IntPtr p = Marshal.GetFunctionPointerForDelegate(d); if (IntPtr.Zero != p) { _asyncDisconnectNotificationDelegate = d; _asyncDisconnectNotificationDelegatePointer = p; } } } } } return _asyncDisconnectNotificationDelegatePointer; }