public StrongHWNDSubclass(StrongHWND strongHwnd) : base(new HWND(strongHwnd.DangerousGetHandle())) { // Note that we passed a new "weak" HWND handle to the base class. // This is because we don't want the StrongHWNDSubclass processing // a partially disposed handle in its own Dispose methods. _strongHwnd = strongHwnd; }
internal void TransferHandleOwnership(StrongHWND hwnd) { Debug.Assert(hwnd == _hwnd); // equivalency, not reference equals _hwnd = hwnd; }