summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/App.xaml.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-09-29 21:40:46 +0000
committersr55 <[email protected]>2012-09-29 21:40:46 +0000
commit4d6d7ec179aa8c4459515539599c700bdcc54420 (patch)
tree93a2f9a730bc4f78416545620c801e5d9369880a /win/CS/HandBrakeWPF/App.xaml.cs
parentf933f7f15f06a64cd8dba8fa3da9c4db37547140 (diff)
WinGui: Readded missing functionality that scans files dropped on the app icon when starting the app.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4995 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/App.xaml.cs')
-rw-r--r--win/CS/HandBrakeWPF/App.xaml.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/App.xaml.cs b/win/CS/HandBrakeWPF/App.xaml.cs
index 3d6e00748..ec7bda6b0 100644
--- a/win/CS/HandBrakeWPF/App.xaml.cs
+++ b/win/CS/HandBrakeWPF/App.xaml.cs
@@ -10,6 +10,8 @@
namespace HandBrakeWPF
{
using System;
+ using System.IO;
+ using System.Linq;
using System.Windows;
using Caliburn.Micro;
@@ -17,6 +19,7 @@ namespace HandBrakeWPF
using HandBrake.ApplicationServices.Exceptions;
using HandBrakeWPF.ViewModels;
+ using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
/// Interaction logic for App.xaml
@@ -34,6 +37,25 @@ namespace HandBrakeWPF
}
/// <summary>
+ /// Override the startup behavior to handle files dropped on the app icon.
+ /// </summary>
+ /// <param name="e">
+ /// The StartupEventArgs.
+ /// </param>
+ protected override void OnStartup(StartupEventArgs e)
+ {
+ base.OnStartup(e);
+
+ // If we have a file dropped on the icon, try scanning it.
+ string[] fileNames = e.Args;
+ if (fileNames.Any() && (File.Exists(fileNames[0]) || Directory.Exists(fileNames[0])))
+ {
+ IMainViewModel mvm = IoC.Get<IMainViewModel>();
+ mvm.StartScan(fileNames[0], 0);
+ }
+ }
+
+ /// <summary>
/// Non-UI Thread expection handler.
/// </summary>
/// <param name="sender">