2012-08-05 00:10:44 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
using System.Windows.Documents;
|
|
|
|
|
using System.Windows.Input;
|
2012-08-19 18:45:08 +00:00
|
|
|
|
using System.Runtime.InteropServices;
|
2012-08-05 00:10:44 +00:00
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
using System.Windows.Media.Imaging;
|
2012-08-19 18:45:08 +00:00
|
|
|
|
using System.Windows.Interop;
|
2012-08-05 00:10:44 +00:00
|
|
|
|
using System.Windows.Shapes;
|
|
|
|
|
|
|
|
|
|
using MediaBrowser.Model.Progress;
|
|
|
|
|
|
2012-08-05 02:21:38 +00:00
|
|
|
|
namespace MediaBrowser.Common.UI
|
2012-08-05 00:10:44 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2012-08-05 02:21:38 +00:00
|
|
|
|
/// Interaction logic for Splash.xaml
|
2012-08-05 00:10:44 +00:00
|
|
|
|
/// </summary>
|
2012-08-05 02:21:38 +00:00
|
|
|
|
public partial class Splash : Window
|
2012-08-05 00:10:44 +00:00
|
|
|
|
{
|
2012-08-19 18:45:08 +00:00
|
|
|
|
private const int GWL_STYLE = -16;
|
|
|
|
|
private const int WS_SYSMENU = 0x80000;
|
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
|
|
|
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
|
|
|
|
|
[DllImport("user32.dll")]
|
|
|
|
|
private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
|
|
|
|
|
|
2012-08-19 18:01:43 +00:00
|
|
|
|
|
|
|
|
|
public Splash(Progress<TaskProgress> progress)
|
2012-08-05 00:10:44 +00:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2012-08-19 18:01:43 +00:00
|
|
|
|
|
|
|
|
|
progress.ProgressChanged += progress_ProgressChanged;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void progress_ProgressChanged(object sender, TaskProgress e)
|
|
|
|
|
{
|
|
|
|
|
this.lblProgress.Content = e.Description;
|
|
|
|
|
this.pbProgress.Value = (double)e.PercentComplete;
|
2012-08-05 00:10:44 +00:00
|
|
|
|
}
|
2012-08-19 18:45:08 +00:00
|
|
|
|
|
|
|
|
|
private void Splash_Loaded(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
var hwnd = new WindowInteropHelper(this).Handle;
|
|
|
|
|
SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_SYSMENU);
|
|
|
|
|
}
|
2012-08-05 00:10:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|