Пример #1
0
        internal Dispatcher(DispatchProvider dispatchProvider, Thread parentThread)
        {
            Assert(dispatchProvider != null, Resources.ArgumentNullExceptionMessage, nameof(dispatchProvider));
            Assert(parentThread != null, Resources.ArgumentNullExceptionMessage, nameof(parentThread));

            _dispatchProvider = dispatchProvider !;
            _parentThread     = parentThread !;
        }
Пример #2
0
        private static Window RemoveWindow(Dictionary <UIntPtr, Window> windows, UIntPtr display, UIntPtr windowHandle, DispatchProvider dispatchProvider)
        {
            _ = windows.Remove(windowHandle, out var window);
            Assert(window != null, Resources.ArgumentNullExceptionMessage, nameof(window));

            if (windows.Count == 0)
            {
                SendClientMessage(
                    display,
                    windowHandle,
                    messageType: dispatchProvider.WmProtocolsAtom,
                    message: dispatchProvider.DispatcherExitRequestedAtom
                    );
            }

            return(window);
        }