GetTaskbarWindow() static private method

static private GetTaskbarWindow ( IntPtr userWindowHandle, TaskbarProxyWindowType taskbarProxyWindowType ) : TaskbarWindow
userWindowHandle IntPtr
taskbarProxyWindowType TaskbarProxyWindowType
return TaskbarWindow
        /// <summary>
        /// Remove the tabbed thumbnail from the taskbar.
        /// </summary>
        /// <param name="windowsControl">TabbedThumbnail associated with the WPF Control (UIElement) that
        /// is to be removed from the taskbar</param>
        public void RemoveThumbnailPreview(UIElement windowsControl)
        {
            if (windowsControl == null)
            {
                throw new ArgumentNullException("windowsControl");
            }

            if (!_tabbedThumbnailCacheWPF.ContainsKey(windowsControl))
            {
                throw new ArgumentException(LocalizedMessages.ThumbnailManagerControlNotAdded, "windowsControl");
            }

            TaskbarWindowManager.UnregisterTab(_tabbedThumbnailCacheWPF[windowsControl].TaskbarWindow);

            _tabbedThumbnailCacheWPF.Remove(windowsControl);

            TaskbarWindow taskbarWindow = TaskbarWindowManager.GetTaskbarWindow(windowsControl, TaskbarProxyWindowType.TabbedThumbnail);

            if (taskbarWindow != null)
            {
                if (TaskbarWindowManager._taskbarWindowList.Contains(taskbarWindow))
                {
                    TaskbarWindowManager._taskbarWindowList.Remove(taskbarWindow);
                }
                taskbarWindow.Dispose();
                taskbarWindow = null;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Remove the tabbed thumbnail from the taskbar.
        /// </summary>
        /// <param name="windowHandle">TabbedThumbnail associated with the window handle that
        /// is to be removed from the taskbar</param>
        public void RemoveThumbnailPreview(IntPtr windowHandle)
        {
            if (!_tabbedThumbnailCache.ContainsKey(windowHandle))
            {
                throw new ArgumentException(LocalizedMessages.ThumbnailManagerControlNotAdded, "windowHandle");
            }

            TaskbarWindowManager.UnregisterTab(_tabbedThumbnailCache[windowHandle].TaskbarWindow);

            _tabbedThumbnailCache.Remove(windowHandle);

            TaskbarWindow taskbarWindow = TaskbarWindowManager.GetTaskbarWindow(windowHandle, TaskbarProxyWindowType.TabbedThumbnail);

            if (taskbarWindow != null)
            {
                if (TaskbarWindowManager._taskbarWindowList.Contains(taskbarWindow))
                {
                    TaskbarWindowManager._taskbarWindowList.Remove(taskbarWindow);
                }
                taskbarWindow.Dispose();
                taskbarWindow = null;
            }
        }