/// <summary> /// Sets the given window handle as being active on the taskbar tabbed thumbnails list. /// Call this method to keep the application and the taskbar in sync as to which window/control /// is currently active (or selected, in the case of tabbed application). /// </summary> /// <param name="windowHandle">Window handle for the control/window that is currently active in the application</param> /// <exception cref="System.ArgumentException">If the control/window is not yet added to the tabbed thumbnails list</exception> public void SetActiveTab(IntPtr windowHandle) { if (!_tabbedThumbnailCache.ContainsKey(windowHandle)) { throw new ArgumentException(LocalizedMessages.ThumbnailManagerPreviewNotAdded, "windowHandle"); } TaskbarWindowManager.SetActiveTab(_tabbedThumbnailCache[windowHandle].TaskbarWindow); }
/// <summary> /// Sets the given WPF window as being active on the taskbar tabbed thumbnails list. /// Call this method to keep the application and the taskbar in sync as to which window/control /// is currently active (or selected, in the case of tabbed application). /// </summary> /// <param name="windowsControl">WPF control that is currently active in the application</param> /// <exception cref="System.ArgumentException">If the control/window is not yet added to the tabbed thumbnails list</exception> public void SetActiveTab(UIElement windowsControl) { if (windowsControl == null) { throw new ArgumentNullException("windowsControl"); } if (!_tabbedThumbnailCacheWPF.ContainsKey(windowsControl)) { throw new ArgumentException(LocalizedMessages.ThumbnailManagerPreviewNotAdded, "windowsControl"); } TaskbarWindowManager.SetActiveTab(_tabbedThumbnailCacheWPF[windowsControl].TaskbarWindow); }
/// <summary> /// Sets the given tabbed thumbnail preview object as being active on the taskbar tabbed thumbnails list. /// Call this method to keep the application and the taskbar in sync as to which window/control /// is currently active (or selected, in the case of tabbed application). /// </summary> /// <param name="preview">TabbedThumbnail for the specific control/indow that is currently active in the application</param> /// <exception cref="System.ArgumentException">If the control/window is not yet added to the tabbed thumbnails list</exception> public void SetActiveTab(TabbedThumbnail preview) { if (preview == null) { throw new ArgumentNullException("preview"); } if (preview.WindowHandle != IntPtr.Zero) { if (!_tabbedThumbnailCache.ContainsKey(preview.WindowHandle)) { throw new ArgumentException(LocalizedMessages.ThumbnailManagerPreviewNotAdded, "preview"); } TaskbarWindowManager.SetActiveTab(_tabbedThumbnailCache[preview.WindowHandle].TaskbarWindow); } else if (preview.WindowsControl != null) { if (!_tabbedThumbnailCacheWPF.ContainsKey(preview.WindowsControl)) { throw new ArgumentException(LocalizedMessages.ThumbnailManagerPreviewNotAdded, "preview"); } TaskbarWindowManager.SetActiveTab(_tabbedThumbnailCacheWPF[preview.WindowsControl].TaskbarWindow); } }