fix CMD issues and add history support.

This commit is contained in:
qianlifeng 2014-01-26 11:01:13 +08:00
parent 671db12336
commit 78f26a3689
4 changed files with 445 additions and 375 deletions

View file

@ -1,7 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
@ -9,6 +11,9 @@ namespace WinAlfred.Plugin.System
{ {
public class CMD : BaseSystemPlugin public class CMD : BaseSystemPlugin
{ {
private Dictionary<string, int> cmdHistory = new Dictionary<string, int>();
private string filePath = Directory.GetCurrentDirectory() + "\\CMDHistory.dat";
protected override List<Result> QueryInternal(Query query) protected override List<Result> QueryInternal(Query query)
{ {
List<Result> results = new List<Result>(); List<Result> results = new List<Result>();
@ -18,29 +23,96 @@ namespace WinAlfred.Plugin.System
Result result = new Result Result result = new Result
{ {
Title = cmd, Title = cmd,
SubTitle = "execute command through command shell" , Score = 5000,
SubTitle = "execute command through command shell",
IcoPath = "Images/cmd.png", IcoPath = "Images/cmd.png",
Action = () => Action = () =>
{ {
Process process = new Process(); ExecuteCmd(cmd);
ProcessStartInfo startInfo = new ProcessStartInfo AddCmdHistory(cmd);
{
WindowStyle = ProcessWindowStyle.Normal,
FileName = "cmd.exe",
Arguments = "/C " + cmd
};
process.StartInfo = startInfo;
process.Start();
} }
}; };
results.Add(result); results.Add(result);
IEnumerable<Result> history = cmdHistory.Where(o => o.Key.Contains(cmd))
.OrderByDescending(o => o.Value)
.Select(m => new Result
{
Title = m.Key,
SubTitle = "this command has been executed " + m.Value + " times",
IcoPath = "Images/cmd.png",
Action = () =>
{
ExecuteCmd(m.Key);
AddCmdHistory(m.Key);
}
}).Take(4);
results.AddRange(history);
} }
return results; return results;
} }
protected override void InitInternal(PluginInitContext context) private static void ExecuteCmd(string cmd)
{ {
try
{
Process process = new Process();
process.StartInfo.UseShellExecute = true;
process.StartInfo.FileName = cmd;
process.Start();
}
catch (Exception e)
{
MessageBox.Show("WinAlfred cound't execute this command.");
}
} }
protected override void InitInternal(PluginInitContext context)
{
LoadCmdHistory();
}
//todo:we need provide a common data persist interface for user?
private void AddCmdHistory(string cmdName)
{
if (cmdHistory.ContainsKey(cmdName))
{
cmdHistory[cmdName] += 1;
}
else
{
cmdHistory.Add(cmdName, 1);
}
PersistCmdHistory();
}
public void LoadCmdHistory()
{
if (File.Exists(filePath))
{
FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read);
BinaryFormatter b = new BinaryFormatter();
cmdHistory = (Dictionary<string, int>)b.Deserialize(fileStream);
fileStream.Close();
}
if (cmdHistory.Count > 1000)
{
List<string> onlyOnceKeys = (from c in cmdHistory where c.Value == 1 select c.Key).ToList();
foreach (string onlyOnceKey in onlyOnceKeys)
{
cmdHistory.Remove(onlyOnceKey);
}
}
}
private void PersistCmdHistory()
{
FileStream fileStream = new FileStream(filePath, FileMode.Create);
BinaryFormatter b = new BinaryFormatter();
b.Serialize(fileStream, cmdHistory);
fileStream.Close();
}
} }
} }

View file

@ -2,10 +2,8 @@
using System.Diagnostics; using System.Diagnostics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows.Input;
using System.Windows.Threading;
namespace WinAlfred namespace WinAlfred.Helper
{ {
public enum KeyEvent : int public enum KeyEvent : int
{ {

View file

@ -1,362 +1,362 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media.Animation; using System.Windows.Media.Animation;
using WinAlfred.Commands; using WinAlfred.Commands;
using WinAlfred.Helper; using WinAlfred.Helper;
using WinAlfred.Plugin; using WinAlfred.Plugin;
using WinAlfred.PluginLoader; using WinAlfred.PluginLoader;
using Application = System.Windows.Application; using Application = System.Windows.Application;
using KeyEventArgs = System.Windows.Input.KeyEventArgs; using KeyEventArgs = System.Windows.Input.KeyEventArgs;
using MessageBox = System.Windows.MessageBox; using MessageBox = System.Windows.MessageBox;
namespace WinAlfred namespace WinAlfred
{ {
public partial class MainWindow public partial class MainWindow
{ {
private KeyboardHook hook = new KeyboardHook(); private KeyboardHook hook = new KeyboardHook();
private NotifyIcon notifyIcon; private NotifyIcon notifyIcon;
private Command cmdDispatcher; private Command cmdDispatcher;
Storyboard progressBarStoryboard = new Storyboard(); Storyboard progressBarStoryboard = new Storyboard();
private bool queryHasReturn = false; private bool queryHasReturn = false;
SelectedRecords selectedRecords = new SelectedRecords(); SelectedRecords selectedRecords = new SelectedRecords();
private KeyboardListener keyboardListener = new KeyboardListener(); private KeyboardListener keyboardListener = new KeyboardListener();
private bool WinRStroked = false; private bool WinRStroked = false;
private WindowsInput.KeyboardSimulator keyboardSimulator = new WindowsInput.KeyboardSimulator(new WindowsInput.InputSimulator()); private WindowsInput.KeyboardSimulator keyboardSimulator = new WindowsInput.KeyboardSimulator(new WindowsInput.InputSimulator());
public MainWindow() public MainWindow()
{ {
InitializeComponent(); InitializeComponent();
hook.KeyPressed += OnHotKey; hook.KeyPressed += OnHotKey;
hook.RegisterHotKey(XModifierKeys.Alt, Keys.Space); hook.RegisterHotKey(XModifierKeys.Alt, Keys.Space);
resultCtrl.resultItemChangedEvent += resultCtrl_resultItemChangedEvent; resultCtrl.resultItemChangedEvent += resultCtrl_resultItemChangedEvent;
ThreadPool.SetMaxThreads(30, 10); ThreadPool.SetMaxThreads(30, 10);
InitProgressbarAnimation(); InitProgressbarAnimation();
try try
{ {
ChangeStyles(Settings.Instance.Theme); ChangeStyles(Settings.Instance.Theme);
} }
catch (System.IO.IOException) catch (System.IO.IOException)
{ {
ChangeStyles(Settings.Instance.Theme = "Default"); ChangeStyles(Settings.Instance.Theme = "Default");
} }
} }
private void WakeupApp() private void WakeupApp()
{ {
//After hide winalfred in the background for a long time. It will become very slow in the next show. //After hide winalfred in the background for a long time. It will become very slow in the next show.
//This is caused by the Virtual Mermory Page Mechanisam. So, our solution is execute some codes in every min //This is caused by the Virtual Mermory Page Mechanisam. So, our solution is execute some codes in every min
//which may prevent sysetem uninstall memory from RAM to disk. //which may prevent sysetem uninstall memory from RAM to disk.
System.Timers.Timer t = new System.Timers.Timer(1000 * 60 * 5) { AutoReset = true, Enabled = true }; System.Timers.Timer t = new System.Timers.Timer(1000 * 60 * 5) { AutoReset = true, Enabled = true };
t.Elapsed += (o, e) => Dispatcher.Invoke(new Action(() => t.Elapsed += (o, e) => Dispatcher.Invoke(new Action(() =>
{ {
if (Visibility != Visibility.Visible) if (Visibility != Visibility.Visible)
{ {
double oldLeft = Left; double oldLeft = Left;
Left = 20000; Left = 20000;
ShowWinAlfred(); ShowWinAlfred();
cmdDispatcher.DispatchCommand(new Query("qq"), false); cmdDispatcher.DispatchCommand(new Query("qq"), false);
HideWinAlfred(); HideWinAlfred();
Left = oldLeft; Left = oldLeft;
} }
})); }));
} }
private void InitProgressbarAnimation() private void InitProgressbarAnimation()
{ {
DoubleAnimation da = new DoubleAnimation(progressBar.X2, Width + 100, new Duration(new TimeSpan(0, 0, 0, 0, 1600))); DoubleAnimation da = new DoubleAnimation(progressBar.X2, Width + 100, new Duration(new TimeSpan(0, 0, 0, 0, 1600)));
DoubleAnimation da1 = new DoubleAnimation(progressBar.X1, Width, new Duration(new TimeSpan(0, 0, 0, 0, 1600))); DoubleAnimation da1 = new DoubleAnimation(progressBar.X1, Width, new Duration(new TimeSpan(0, 0, 0, 0, 1600)));
Storyboard.SetTargetProperty(da, new PropertyPath("(Line.X2)")); Storyboard.SetTargetProperty(da, new PropertyPath("(Line.X2)"));
Storyboard.SetTargetProperty(da1, new PropertyPath("(Line.X1)")); Storyboard.SetTargetProperty(da1, new PropertyPath("(Line.X1)"));
progressBarStoryboard.Children.Add(da); progressBarStoryboard.Children.Add(da);
progressBarStoryboard.Children.Add(da1); progressBarStoryboard.Children.Add(da1);
progressBarStoryboard.RepeatBehavior = RepeatBehavior.Forever; progressBarStoryboard.RepeatBehavior = RepeatBehavior.Forever;
progressBar.Visibility = Visibility.Hidden; progressBar.Visibility = Visibility.Hidden;
progressBar.BeginStoryboard(progressBarStoryboard); progressBar.BeginStoryboard(progressBarStoryboard);
} }
private void InitialTray() private void InitialTray()
{ {
notifyIcon = new NotifyIcon { Text = "WinAlfred", Icon = Properties.Resources.app, Visible = true }; notifyIcon = new NotifyIcon { Text = "WinAlfred", Icon = Properties.Resources.app, Visible = true };
notifyIcon.Click += (o, e) => ShowWinAlfred(); notifyIcon.Click += (o, e) => ShowWinAlfred();
System.Windows.Forms.MenuItem open = new System.Windows.Forms.MenuItem("Open"); System.Windows.Forms.MenuItem open = new System.Windows.Forms.MenuItem("Open");
open.Click += (o, e) => ShowWinAlfred(); open.Click += (o, e) => ShowWinAlfred();
System.Windows.Forms.MenuItem exit = new System.Windows.Forms.MenuItem("Exit"); System.Windows.Forms.MenuItem exit = new System.Windows.Forms.MenuItem("Exit");
exit.Click += (o, e) => CloseApp(); exit.Click += (o, e) => CloseApp();
System.Windows.Forms.MenuItem[] childen = { open, exit }; System.Windows.Forms.MenuItem[] childen = { open, exit };
notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(childen); notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(childen);
} }
private void resultCtrl_resultItemChangedEvent() private void resultCtrl_resultItemChangedEvent()
{ {
resultCtrl.Margin = resultCtrl.GetCurrentResultCount() > 0 ? new Thickness { Top = grid.Margin.Top } : new Thickness { Top = 0 }; resultCtrl.Margin = resultCtrl.GetCurrentResultCount() > 0 ? new Thickness { Top = grid.Margin.Top } : new Thickness { Top = 0 };
} }
private void OnHotKey(object sender, KeyPressedEventArgs e) private void OnHotKey(object sender, KeyPressedEventArgs e)
{ {
if (!IsVisible) if (!IsVisible)
{ {
ShowWinAlfred(); ShowWinAlfred();
} }
else else
{ {
HideWinAlfred(); HideWinAlfred();
} }
} }
private void TextBoxBase_OnTextChanged(object sender, TextChangedEventArgs e) private void TextBoxBase_OnTextChanged(object sender, TextChangedEventArgs e)
{ {
resultCtrl.Dirty = true; resultCtrl.Dirty = true;
Dispatcher.DelayInvoke("UpdateSearch", Dispatcher.DelayInvoke("UpdateSearch",
o => o =>
{ {
Dispatcher.DelayInvoke("ClearResults", i => Dispatcher.DelayInvoke("ClearResults", i =>
{ {
// first try to use clear method inside resultCtrl, which is more closer to the add new results // first try to use clear method inside resultCtrl, which is more closer to the add new results
// and this will not bring splash issues.After waiting 30ms, if there still no results added, we // and this will not bring splash issues.After waiting 30ms, if there still no results added, we
// must clear the result. otherwise, it will be confused why the query changed, but the results // must clear the result. otherwise, it will be confused why the query changed, but the results
// didn't. // didn't.
if (resultCtrl.Dirty) resultCtrl.Clear(); if (resultCtrl.Dirty) resultCtrl.Clear();
}, TimeSpan.FromMilliseconds(30), null); }, TimeSpan.FromMilliseconds(30), null);
var q = new Query(tbQuery.Text); var q = new Query(tbQuery.Text);
cmdDispatcher.DispatchCommand(q); cmdDispatcher.DispatchCommand(q);
queryHasReturn = false; queryHasReturn = false;
if (Plugins.HitThirdpartyKeyword(q)) if (Plugins.HitThirdpartyKeyword(q))
{ {
Dispatcher.DelayInvoke("ShowProgressbar", originQuery => Dispatcher.DelayInvoke("ShowProgressbar", originQuery =>
{ {
if (!queryHasReturn && originQuery == tbQuery.Text) if (!queryHasReturn && originQuery == tbQuery.Text)
{ {
StartProgress(); StartProgress();
} }
}, TimeSpan.FromSeconds(1), tbQuery.Text); }, TimeSpan.FromSeconds(1), tbQuery.Text);
} }
}, TimeSpan.FromMilliseconds(300)); }, TimeSpan.FromMilliseconds(300));
} }
private void StartProgress() private void StartProgress()
{ {
progressBar.Visibility = Visibility.Visible; progressBar.Visibility = Visibility.Visible;
} }
private void StopProgress() private void StopProgress()
{ {
progressBar.Visibility = Visibility.Hidden; progressBar.Visibility = Visibility.Hidden;
} }
private void HideWinAlfred() private void HideWinAlfred()
{ {
Hide(); Hide();
} }
private void ShowWinAlfred() private void ShowWinAlfred()
{ {
Show(); Show();
Activate(); Activate();
tbQuery.SelectAll(); tbQuery.SelectAll();
Focus(); Focus();
tbQuery.Focus(); tbQuery.Focus();
} }
public void ParseArgs(string[] args) public void ParseArgs(string[] args)
{ {
if (args != null && args.Length > 0) if (args != null && args.Length > 0)
{ {
switch (args[0]) switch (args[0])
{ {
case "reloadWorkflows": case "reloadWorkflows":
Plugins.Init(this); Plugins.Init(this);
break; break;
case "query": case "query":
if (args.Length > 1) if (args.Length > 1)
{ {
string query = args[1]; string query = args[1];
tbQuery.Text = query; tbQuery.Text = query;
tbQuery.SelectAll(); tbQuery.SelectAll();
} }
break; break;
} }
} }
} }
private void SetAutoStart(bool IsAtuoRun) private void SetAutoStart(bool IsAtuoRun)
{ {
//string LnkPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "//WinAlfred.lnk"; //string LnkPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "//WinAlfred.lnk";
//if (IsAtuoRun) //if (IsAtuoRun)
//{ //{
// WshShell shell = new WshShell(); // WshShell shell = new WshShell();
// IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(LnkPath); // IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(LnkPath);
// shortcut.TargetPath = System.Reflection.Assembly.GetExecutingAssembly().Location; // shortcut.TargetPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
// shortcut.WorkingDirectory = Environment.CurrentDirectory; // shortcut.WorkingDirectory = Environment.CurrentDirectory;
// shortcut.WindowStyle = 1; //normal window // shortcut.WindowStyle = 1; //normal window
// shortcut.Description = "WinAlfred"; // shortcut.Description = "WinAlfred";
// shortcut.Save(); // shortcut.Save();
//} //}
//else //else
//{ //{
// System.IO.File.Delete(LnkPath); // System.IO.File.Delete(LnkPath);
//} //}
} }
private void MainWindow_OnLoaded(object sender, RoutedEventArgs e) private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
{ {
Left = (SystemParameters.PrimaryScreenWidth - ActualWidth) / 2; Left = (SystemParameters.PrimaryScreenWidth - ActualWidth) / 2;
Top = (SystemParameters.PrimaryScreenHeight - ActualHeight) / 3; Top = (SystemParameters.PrimaryScreenHeight - ActualHeight) / 3;
Plugins.Init(this); Plugins.Init(this);
cmdDispatcher = new Command(this); cmdDispatcher = new Command(this);
InitialTray(); InitialTray();
selectedRecords.LoadSelectedRecords(); selectedRecords.LoadSelectedRecords();
SetAutoStart(true); SetAutoStart(true);
WakeupApp(); WakeupApp();
//var engine = new Jurassic.ScriptEngine(); //var engine = new Jurassic.ScriptEngine();
//MessageBox.Show(engine.Evaluate("5 * 10 + 2").ToString()); //MessageBox.Show(engine.Evaluate("5 * 10 + 2").ToString());
keyboardListener.hookedKeyboardCallback += KListener_hookedKeyboardCallback; keyboardListener.hookedKeyboardCallback += KListener_hookedKeyboardCallback;
} }
private bool KListener_hookedKeyboardCallback(KeyEvent keyevent, int vkcode, SpecialKeyState state) private bool KListener_hookedKeyboardCallback(KeyEvent keyevent, int vkcode, SpecialKeyState state)
{ {
if (Settings.Instance.ReplaceWinR) if (Settings.Instance.ReplaceWinR)
{ {
if (keyevent == KeyEvent.WM_KEYDOWN && vkcode == (int)Keys.R && state.WinPressed) if (keyevent == KeyEvent.WM_KEYDOWN && vkcode == (int)Keys.R && state.WinPressed)
{ {
Dispatcher.BeginInvoke(new Action(() => Dispatcher.BeginInvoke(new Action(() =>
{ {
resultCtrl.Clear(); resultCtrl.Clear();
ShowWinAlfred(); ShowWinAlfred();
ChangeQuery(">"); ChangeQuery(">");
WinRStroked = true; WinRStroked = true;
})); }));
return false; return false;
} }
if (keyevent == KeyEvent.WM_KEYUP && WinRStroked && vkcode == (int)Keys.LWin) if (keyevent == KeyEvent.WM_KEYUP && WinRStroked && vkcode == (int)Keys.LWin)
{ {
WinRStroked = false; WinRStroked = false;
keyboardSimulator.ModifiedKeyStroke(WindowsInput.Native.VirtualKeyCode.LWIN, WindowsInput.Native.VirtualKeyCode.CONTROL); keyboardSimulator.ModifiedKeyStroke(WindowsInput.Native.VirtualKeyCode.LWIN, WindowsInput.Native.VirtualKeyCode.CONTROL);
return false; return false;
} }
} }
return true; return true;
} }
private void TbQuery_OnPreviewKeyDown(object sender, KeyEventArgs e) private void TbQuery_OnPreviewKeyDown(object sender, KeyEventArgs e)
{ {
switch (e.Key) switch (e.Key)
{ {
case Key.Escape: case Key.Escape:
HideWinAlfred(); HideWinAlfred();
e.Handled = true; e.Handled = true;
break; break;
case Key.Down: case Key.Down:
resultCtrl.SelectNext(); resultCtrl.SelectNext();
e.Handled = true; e.Handled = true;
break; break;
case Key.Up: case Key.Up:
resultCtrl.SelectPrev(); resultCtrl.SelectPrev();
e.Handled = true; e.Handled = true;
break; break;
case Key.Enter: case Key.Enter:
Result result = resultCtrl.AcceptSelect(); Result result = resultCtrl.AcceptSelect();
if (result != null) if (result != null)
{ {
selectedRecords.AddSelect(result); selectedRecords.AddSelect(result);
if (!result.DontHideWinAlfredAfterSelect) if (!result.DontHideWinAlfredAfterSelect)
{ {
HideWinAlfred(); HideWinAlfred();
} }
} }
e.Handled = true; e.Handled = true;
break; break;
} }
} }
public void OnUpdateResultView(List<Result> list) public void OnUpdateResultView(List<Result> list)
{ {
queryHasReturn = true; queryHasReturn = true;
progressBar.Dispatcher.Invoke(new Action(StopProgress)); progressBar.Dispatcher.Invoke(new Action(StopProgress));
if (list.Count > 0) if (list.Count > 0)
{ {
//todo:this should be opened to users, it's their choise to use it or not in thier workflows //todo:this should be opened to users, it's their choise to use it or not in thier workflows
list.ForEach(o => list.ForEach(o =>
{ {
if (o.AutoAjustScore) o.Score += selectedRecords.GetSelectedCount(o); if (o.AutoAjustScore) o.Score += selectedRecords.GetSelectedCount(o);
}); });
resultCtrl.Dispatcher.Invoke(new Action(() => resultCtrl.Dispatcher.Invoke(new Action(() =>
{ {
List<Result> l = list.Where(o => o.OriginQuery != null && o.OriginQuery.RawQuery == tbQuery.Text).ToList(); List<Result> l = list.Where(o => o.OriginQuery != null && o.OriginQuery.RawQuery == tbQuery.Text).ToList();
resultCtrl.AddResults(l); resultCtrl.AddResults(l);
})); }));
} }
} }
public void ChangeStyles(string themeName) public void ChangeStyles(string themeName)
{ {
ResourceDictionary dict = new ResourceDictionary ResourceDictionary dict = new ResourceDictionary
{ {
Source = new Uri("pack://application:,,,/Themes/" + themeName + ".xaml") Source = new Uri("pack://application:,,,/Themes/" + themeName + ".xaml")
}; };
Application.Current.Resources.MergedDictionaries.Clear(); Application.Current.Resources.MergedDictionaries.Clear();
Application.Current.Resources.MergedDictionaries.Add(dict); Application.Current.Resources.MergedDictionaries.Add(dict);
} }
#region Public API #region Public API
//Those method can be invoked by plugins //Those method can be invoked by plugins
public void ChangeQuery(string query) public void ChangeQuery(string query)
{ {
tbQuery.Text = query; tbQuery.Text = query;
tbQuery.CaretIndex = tbQuery.Text.Length; tbQuery.CaretIndex = tbQuery.Text.Length;
} }
public void CloseApp() public void CloseApp()
{ {
notifyIcon.Visible = false; notifyIcon.Visible = false;
Environment.Exit(0); Environment.Exit(0);
} }
public void HideApp() public void HideApp()
{ {
HideWinAlfred(); HideWinAlfred();
} }
public void ShowApp() public void ShowApp()
{ {
ShowWinAlfred(); ShowWinAlfred();
} }
public void ShowMsg(string title, string subTitle, string iconPath) public void ShowMsg(string title, string subTitle, string iconPath)
{ {
Msg m = new Msg { Owner = GetWindow(this) }; Msg m = new Msg { Owner = GetWindow(this) };
m.Show(title, subTitle, iconPath); m.Show(title, subTitle, iconPath);
} }
public void OpenSettingDialog() public void OpenSettingDialog()
{ {
SettingWidow s = new SettingWidow(this); SettingWidow s = new SettingWidow(this);
s.Show(); s.Show();
} }
#endregion #endregion
} }
} }

View file

@ -121,7 +121,7 @@
<Compile Include="Helper\Log.cs" /> <Compile Include="Helper\Log.cs" />
<Compile Include="Helper\Settings.cs" /> <Compile Include="Helper\Settings.cs" />
<Compile Include="Helper\WinAlfredException.cs" /> <Compile Include="Helper\WinAlfredException.cs" />
<Compile Include="KeyboardListener.cs" /> <Compile Include="Helper\KeyboardListener.cs" />
<Compile Include="Msg.xaml.cs"> <Compile Include="Msg.xaml.cs">
<DependentUpon>Msg.xaml</DependentUpon> <DependentUpon>Msg.xaml</DependentUpon>
</Compile> </Compile>
@ -268,15 +268,15 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>xcopy /Y $(ProjectDir)Images\*.* $(TargetDir)Images\ <PostBuildEvent>xcopy /Y $(ProjectDir)Images\*.* $(TargetDir)Images\
xcopy /Y $(ProjectDir)app.ico $(TargetDir) xcopy /Y $(ProjectDir)app.ico $(TargetDir)
xcopy /Y $(ProjectDir)Themes\*.* $(TargetDir)Themes\</PostBuildEvent> xcopy /Y $(ProjectDir)Themes\*.* $(TargetDir)Themes\</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>