// -------------------------------------------------------------------------------------------------------------------- // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // // A class implimenting Windows 7 Specific features // // -------------------------------------------------------------------------------------------------------------------- namespace HandBrake.ApplicationServices.Utilities { using System.Windows.Shell; /// /// A class implementing Windows 7 Specific features /// public class Win7 { /// /// The Windows Taskbar /// public static TaskbarItemInfo WindowsTaskbar; /// /// Initializes a new instance of the class. /// public Win7() { if (WindowsTaskbar == null) WindowsTaskbar = new TaskbarItemInfo(); } /// /// Gets a value indicating whether is windows seven. /// public bool IsWindowsSeven { get { return true; } } /// /// The get task bar. /// /// /// The . /// public TaskbarItemInfo GetTaskBar() { return WindowsTaskbar; } /// /// Set the Task Bar Percentage. /// /// /// The percentage. /// public void SetTaskBarProgress(int percentage) { // Update the taskbar progress indicator. The normal state shows a green progress bar. Caliburn.Micro.Execute.OnUIThread( () => { WindowsTaskbar.ProgressState = TaskbarItemProgressState.Normal; WindowsTaskbar.ProgressValue = (double)percentage / 100; }); } /// /// Disable Task Bar Progress /// public void SetTaskBarProgressToNoProgress() { Caliburn.Micro.Execute.OnUIThread(() => WindowsTaskbar.ProgressState = TaskbarItemProgressState.None); } } }