// --------------------------------------------------------------------------------------------------------------------
//
// 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 Microsoft.WindowsAPICodePack.Taskbar;
///
/// A class implimenting Windows 7 Specific features
///
public class Win7
{
///
/// The Windows Taskbar
///
private TaskbarManager windowsTaskbar;
///
/// Initializes a new instance of the class.
///
public Win7()
{
if (this.IsWindowsSeven)
{
this.windowsTaskbar = TaskbarManager.Instance;
this.windowsTaskbar.ApplicationId = "HandBrake";
}
}
///
/// Gets a value indicating whether this is Windows Seven.
///
public bool IsWindowsSeven
{
get
{
return TaskbarManager.IsPlatformSupported;
}
}
///
/// Set the Task Bar Percentage.
///
///
/// The percentage.
///
public void SetTaskBarProgress(int percentage)
{
if (!this.IsWindowsSeven)
{
return;
}
this.windowsTaskbar.SetProgressState(TaskbarProgressBarState.Normal);
this.windowsTaskbar.SetProgressValue(percentage, 100);
}
///
/// Disable Task Bar Progress
///
public void SetTaskBarProgressToNoProgress()
{
if (!this.IsWindowsSeven)
{
return;
}
this.windowsTaskbar.SetProgressState(TaskbarProgressBarState.NoProgress);
}
}
}