2014-03-11 21:40:25 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2014-07-04 15:12:22 +08:00
|
|
|
|
using System.Diagnostics;
|
2014-01-25 18:00:13 +08:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
2014-07-18 20:00:55 +08:00
|
|
|
|
using System.Net;
|
2014-01-25 18:00:13 +08:00
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
2014-07-04 12:08:37 +08:00
|
|
|
|
using System.Windows.Input;
|
2014-03-19 22:17:01 +08:00
|
|
|
|
using System.Windows.Media;
|
2014-03-26 15:30:59 +08:00
|
|
|
|
using System.Windows.Media.Imaging;
|
2016-05-09 09:32:47 +08:00
|
|
|
|
using System.Windows.Navigation;
|
2015-01-14 22:19:44 +08:00
|
|
|
|
using Microsoft.Win32;
|
2016-02-23 05:43:37 +08:00
|
|
|
|
using NHotkey;
|
|
|
|
|
using NHotkey.Wpf;
|
2016-05-10 03:40:59 +08:00
|
|
|
|
using Wox.Core;
|
2015-10-31 07:17:34 +08:00
|
|
|
|
using Wox.Core.Plugin;
|
2016-01-08 04:04:37 +08:00
|
|
|
|
using Wox.Core.Resource;
|
2015-01-05 22:41:17 +08:00
|
|
|
|
using Wox.Core.UserSettings;
|
2015-10-31 07:17:34 +08:00
|
|
|
|
using Wox.Helper;
|
2016-02-23 05:43:37 +08:00
|
|
|
|
using Wox.Infrastructure.Hotkey;
|
2015-10-31 07:17:34 +08:00
|
|
|
|
using Wox.Plugin;
|
2016-02-23 05:43:37 +08:00
|
|
|
|
using Wox.ViewModel;
|
2015-11-05 05:49:36 +08:00
|
|
|
|
using Stopwatch = Wox.Infrastructure.Stopwatch;
|
2014-01-25 18:00:13 +08:00
|
|
|
|
|
2014-01-29 18:33:24 +08:00
|
|
|
|
namespace Wox
|
2014-01-25 18:00:13 +08:00
|
|
|
|
{
|
2016-05-10 05:45:20 +08:00
|
|
|
|
public partial class SettingWindow
|
2014-01-25 18:00:13 +08:00
|
|
|
|
{
|
2016-05-19 02:35:34 +08:00
|
|
|
|
private const string StartupPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
|
2016-05-22 12:30:38 +08:00
|
|
|
|
|
2016-02-12 15:22:01 +08:00
|
|
|
|
public readonly IPublicAPI _api;
|
2016-01-07 05:34:42 +08:00
|
|
|
|
bool settingsLoaded;
|
|
|
|
|
private bool themeTabLoaded;
|
2016-04-21 08:53:21 +08:00
|
|
|
|
private Settings _settings;
|
2016-05-22 12:30:38 +08:00
|
|
|
|
private SettingWindowViewModel _viewModel;
|
2014-01-25 18:00:13 +08:00
|
|
|
|
|
2016-05-22 05:44:27 +08:00
|
|
|
|
public SettingWindow(IPublicAPI api, SettingWindowViewModel viewModel)
|
2014-01-25 18:00:13 +08:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2016-05-22 05:44:27 +08:00
|
|
|
|
_settings = viewModel.Settings;
|
|
|
|
|
DataContext = viewModel;
|
2016-05-22 12:30:38 +08:00
|
|
|
|
_viewModel = viewModel;
|
2016-03-28 10:09:57 +08:00
|
|
|
|
_api = api;
|
2016-05-06 04:15:13 +08:00
|
|
|
|
ResultListBoxPreview.DataContext = new ResultsViewModel(_settings);
|
2014-01-25 18:00:13 +08:00
|
|
|
|
Loaded += Setting_Loaded;
|
2014-02-22 15:52:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-03-11 09:31:21 +08:00
|
|
|
|
private void ProxyToggled(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
_settings.ProxyEnabled = ToggleProxy.IsChecked ?? false;
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-22 06:16:32 +08:00
|
|
|
|
private void Setting_Loaded(object sender, RoutedEventArgs ev)
|
2014-02-22 15:52:20 +08:00
|
|
|
|
{
|
2014-07-18 20:00:55 +08:00
|
|
|
|
#region Proxy
|
|
|
|
|
|
2016-03-11 09:31:21 +08:00
|
|
|
|
ToggleProxy.IsChecked = _settings.ProxyEnabled;
|
2016-05-22 02:04:52 +08:00
|
|
|
|
ProxyServer.Text = _settings.ProxyServer;
|
2016-03-28 10:09:57 +08:00
|
|
|
|
if (_settings.ProxyPort != 0)
|
2015-11-06 10:29:32 +08:00
|
|
|
|
{
|
2016-05-22 02:04:52 +08:00
|
|
|
|
ProxyPort.Text = _settings.ProxyPort.ToString();
|
2015-08-27 19:38:07 +08:00
|
|
|
|
}
|
2016-05-22 02:04:52 +08:00
|
|
|
|
ProxyUserName.Text = _settings.ProxyUserName;
|
|
|
|
|
ProxyPassword.Password = _settings.ProxyPassword;
|
2014-07-18 20:00:55 +08:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2014-12-16 22:25:22 +08:00
|
|
|
|
#region About
|
2016-05-09 09:41:46 +08:00
|
|
|
|
|
2016-05-09 09:32:47 +08:00
|
|
|
|
string activateTimes = string.Format(
|
|
|
|
|
InternationalizationManager.Instance.GetTranslation("about_activate_times"), _settings.ActivateTimes);
|
|
|
|
|
ActivatedTimes.Text = activateTimes;
|
2016-05-22 02:04:52 +08:00
|
|
|
|
Version.Text = Infrastructure.Constant.Version;
|
2014-12-16 22:25:22 +08:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2014-03-25 13:25:43 +08:00
|
|
|
|
settingsLoaded = true;
|
2014-01-25 18:00:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
2015-02-07 21:27:48 +08:00
|
|
|
|
#region General
|
|
|
|
|
|
2016-05-22 06:16:32 +08:00
|
|
|
|
void OnLanguageChanged(object sender, SelectionChangedEventArgs e)
|
2015-01-02 16:16:09 +08:00
|
|
|
|
{
|
2016-05-22 06:16:32 +08:00
|
|
|
|
var language = (Language)e.AddedItems[0];
|
|
|
|
|
InternationalizationManager.Instance.ChangeLanguage(language);
|
2015-01-02 16:16:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-05-22 06:16:32 +08:00
|
|
|
|
private void OnAutoStartupChecked(object sender, RoutedEventArgs e)
|
2014-02-06 22:22:02 +08:00
|
|
|
|
{
|
2016-05-19 02:35:34 +08:00
|
|
|
|
SetStartup();
|
2014-02-06 22:22:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-05-22 06:16:32 +08:00
|
|
|
|
private void OnAutoStartupUncheck(object sender, RoutedEventArgs e)
|
2014-02-06 22:22:02 +08:00
|
|
|
|
{
|
2016-05-19 02:35:34 +08:00
|
|
|
|
RemoveStartup();
|
2015-01-14 22:19:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-05-19 02:35:34 +08:00
|
|
|
|
public static void SetStartup()
|
2015-01-14 22:19:44 +08:00
|
|
|
|
{
|
2016-05-19 02:35:34 +08:00
|
|
|
|
using (var key = Registry.CurrentUser.OpenSubKey(StartupPath, true))
|
2014-03-11 21:40:25 +08:00
|
|
|
|
{
|
2016-05-19 02:38:43 +08:00
|
|
|
|
key?.SetValue(Infrastructure.Constant.Wox, Infrastructure.Constant.ExecutablePath);
|
2014-03-11 21:40:25 +08:00
|
|
|
|
}
|
2015-01-14 22:19:44 +08:00
|
|
|
|
}
|
2014-03-19 01:20:51 +08:00
|
|
|
|
|
2016-05-19 02:35:34 +08:00
|
|
|
|
private void RemoveStartup()
|
2015-01-14 22:19:44 +08:00
|
|
|
|
{
|
2016-05-19 02:35:34 +08:00
|
|
|
|
using (var key = Registry.CurrentUser.OpenSubKey(StartupPath, true))
|
2015-01-14 22:19:44 +08:00
|
|
|
|
{
|
2016-05-19 02:38:43 +08:00
|
|
|
|
key?.DeleteValue(Infrastructure.Constant.Wox, false);
|
2015-01-14 22:19:44 +08:00
|
|
|
|
}
|
2014-02-06 22:22:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-05-19 02:35:34 +08:00
|
|
|
|
public static bool StartupSet()
|
2014-02-06 22:22:02 +08:00
|
|
|
|
{
|
2016-05-19 02:35:34 +08:00
|
|
|
|
using (var key = Registry.CurrentUser.OpenSubKey(StartupPath, true))
|
2015-01-14 22:19:44 +08:00
|
|
|
|
{
|
2016-05-22 06:16:32 +08:00
|
|
|
|
var path = key?.GetValue(Infrastructure.Constant.Wox) as string;
|
2016-05-19 02:35:34 +08:00
|
|
|
|
if (path != null)
|
|
|
|
|
{
|
2016-05-19 02:38:43 +08:00
|
|
|
|
return path == Infrastructure.Constant.ExecutablePath;
|
2016-05-19 02:35:34 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2015-01-14 22:19:44 +08:00
|
|
|
|
}
|
2014-02-06 22:22:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-05-22 06:16:32 +08:00
|
|
|
|
private void OnSelectPythonDirectoryClick(object sender, RoutedEventArgs e)
|
2016-05-05 08:57:03 +08:00
|
|
|
|
{
|
2016-05-10 05:45:20 +08:00
|
|
|
|
var dlg = new System.Windows.Forms.FolderBrowserDialog
|
2016-05-07 04:25:53 +08:00
|
|
|
|
{
|
|
|
|
|
SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)
|
|
|
|
|
};
|
2016-05-05 08:57:03 +08:00
|
|
|
|
|
|
|
|
|
var result = dlg.ShowDialog();
|
|
|
|
|
if (result == System.Windows.Forms.DialogResult.OK)
|
|
|
|
|
{
|
|
|
|
|
string pythonDirectory = dlg.SelectedPath;
|
|
|
|
|
if (!string.IsNullOrEmpty(pythonDirectory))
|
|
|
|
|
{
|
|
|
|
|
var pythonPath = Path.Combine(pythonDirectory, PluginsLoader.PythonExecutable);
|
|
|
|
|
if (File.Exists(pythonPath))
|
|
|
|
|
{
|
|
|
|
|
_settings.PluginSettings.PythonDirectory = pythonDirectory;
|
|
|
|
|
MessageBox.Show("Remember to restart Wox use new Python path");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("Can't find python in given directory");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-05-09 09:41:46 +08:00
|
|
|
|
|
2015-02-07 21:27:48 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Hotkey
|
|
|
|
|
|
2016-01-07 05:34:42 +08:00
|
|
|
|
void ctlHotkey_OnHotkeyChanged(object sender, EventArgs e)
|
2014-02-22 15:52:20 +08:00
|
|
|
|
{
|
2016-05-22 02:04:52 +08:00
|
|
|
|
if (HotkeyControl.CurrentHotkeyAvailable)
|
2014-02-22 15:52:20 +08:00
|
|
|
|
{
|
2016-05-22 02:04:52 +08:00
|
|
|
|
SetHotkey(HotkeyControl.CurrentHotkey, delegate
|
2016-02-12 15:22:01 +08:00
|
|
|
|
{
|
2016-05-10 05:45:20 +08:00
|
|
|
|
if (!System.Windows.Application.Current.MainWindow.IsVisible)
|
2016-02-12 15:22:01 +08:00
|
|
|
|
{
|
2016-02-21 23:42:37 +08:00
|
|
|
|
_api.ShowApp();
|
2016-02-12 15:22:01 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-02-21 23:42:37 +08:00
|
|
|
|
_api.HideApp();
|
2016-02-12 15:22:01 +08:00
|
|
|
|
}
|
|
|
|
|
});
|
2016-03-28 10:09:57 +08:00
|
|
|
|
RemoveHotkey(_settings.Hotkey);
|
2016-05-22 02:04:52 +08:00
|
|
|
|
_settings.Hotkey = HotkeyControl.CurrentHotkey.ToString();
|
2014-02-22 15:52:20 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-12 15:22:01 +08:00
|
|
|
|
void SetHotkey(HotkeyModel hotkey, EventHandler<HotkeyEventArgs> action)
|
|
|
|
|
{
|
|
|
|
|
string hotkeyStr = hotkey.ToString();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
HotkeyManager.Current.AddOrReplace(hotkeyStr, hotkey.CharKey, hotkey.ModifierKeys, action);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
2016-05-09 09:41:46 +08:00
|
|
|
|
string errorMsg =
|
|
|
|
|
string.Format(InternationalizationManager.Instance.GetTranslation("registerHotkeyFailed"), hotkeyStr);
|
2016-02-12 15:22:01 +08:00
|
|
|
|
MessageBox.Show(errorMsg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RemoveHotkey(string hotkeyStr)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(hotkeyStr))
|
|
|
|
|
{
|
|
|
|
|
HotkeyManager.Current.Remove(hotkeyStr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-22 06:42:23 +08:00
|
|
|
|
public void OnHotkeyTabSelected(object sender, RoutedEventArgs e)
|
2015-02-07 21:27:48 +08:00
|
|
|
|
{
|
2016-05-22 02:04:52 +08:00
|
|
|
|
HotkeyControl.HotkeyChanged += ctlHotkey_OnHotkeyChanged;
|
|
|
|
|
HotkeyControl.SetHotkey(_settings.Hotkey, false);
|
|
|
|
|
CustomHotkies.ItemsSource = _settings.CustomPluginHotkeys;
|
2015-02-07 21:27:48 +08:00
|
|
|
|
}
|
2014-02-22 15:52:20 +08:00
|
|
|
|
|
|
|
|
|
private void BtnDeleteCustomHotkey_OnClick(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2016-05-22 02:04:52 +08:00
|
|
|
|
CustomPluginHotkey item = CustomHotkies.SelectedItem as CustomPluginHotkey;
|
2015-01-02 16:16:09 +08:00
|
|
|
|
if (item == null)
|
|
|
|
|
{
|
2015-01-21 23:00:56 +08:00
|
|
|
|
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem"));
|
2015-01-02 16:16:09 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-09 09:41:46 +08:00
|
|
|
|
string deleteWarning =
|
|
|
|
|
string.Format(InternationalizationManager.Instance.GetTranslation("deleteCustomHotkeyWarning"),
|
|
|
|
|
item.Hotkey);
|
|
|
|
|
if (
|
|
|
|
|
MessageBox.Show(deleteWarning, InternationalizationManager.Instance.GetTranslation("delete"),
|
|
|
|
|
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
2014-02-22 15:52:20 +08:00
|
|
|
|
{
|
2016-03-28 10:09:57 +08:00
|
|
|
|
_settings.CustomPluginHotkeys.Remove(item);
|
2016-05-22 02:04:52 +08:00
|
|
|
|
CustomHotkies.Items.Refresh();
|
2016-02-12 15:22:01 +08:00
|
|
|
|
RemoveHotkey(item.Hotkey);
|
2014-02-22 15:52:20 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void BtnEditCustomHotkey_OnClick(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2016-05-22 02:04:52 +08:00
|
|
|
|
CustomPluginHotkey item = CustomHotkies.SelectedItem as CustomPluginHotkey;
|
2014-02-22 15:52:20 +08:00
|
|
|
|
if (item != null)
|
|
|
|
|
{
|
2016-03-28 10:09:57 +08:00
|
|
|
|
CustomQueryHotkeySetting window = new CustomQueryHotkeySetting(this, _settings);
|
2014-02-22 15:52:20 +08:00
|
|
|
|
window.UpdateItem(item);
|
|
|
|
|
window.ShowDialog();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-01-21 23:00:56 +08:00
|
|
|
|
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem"));
|
2014-02-22 15:52:20 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void BtnAddCustomeHotkey_OnClick(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2016-03-28 10:09:57 +08:00
|
|
|
|
new CustomQueryHotkeySetting(this, _settings).ShowDialog();
|
2014-02-22 15:52:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ReloadCustomPluginHotkeyView()
|
|
|
|
|
{
|
2016-05-22 02:04:52 +08:00
|
|
|
|
CustomHotkies.Items.Refresh();
|
2014-02-22 15:52:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2014-03-19 22:17:01 +08:00
|
|
|
|
#region Theme
|
2015-02-07 21:27:48 +08:00
|
|
|
|
|
|
|
|
|
private void tbMoreThemes_MouseUp(object sender, MouseButtonEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Process.Start("http://www.getwox.com/theme");
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-22 06:42:23 +08:00
|
|
|
|
public void OnThemeTabSelected(object sender, RoutedEventArgs e)
|
2015-02-07 21:27:48 +08:00
|
|
|
|
{
|
2015-11-05 05:49:36 +08:00
|
|
|
|
Stopwatch.Debug("theme load", () =>
|
2015-02-08 10:38:32 +08:00
|
|
|
|
{
|
|
|
|
|
var s = Fonts.SystemFontFamilies;
|
2015-11-05 05:35:04 +08:00
|
|
|
|
});
|
2015-02-08 10:38:32 +08:00
|
|
|
|
|
2015-02-07 21:27:48 +08:00
|
|
|
|
if (themeTabLoaded) return;
|
|
|
|
|
|
|
|
|
|
themeTabLoaded = true;
|
2016-03-28 10:09:57 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(_settings.QueryBoxFont) &&
|
|
|
|
|
Fonts.SystemFontFamilies.Count(o => o.FamilyNames.Values.Contains(_settings.QueryBoxFont)) > 0)
|
2015-02-07 21:27:48 +08:00
|
|
|
|
{
|
2016-05-22 02:04:52 +08:00
|
|
|
|
QueryBoxFont.Text = _settings.QueryBoxFont;
|
2015-02-07 21:27:48 +08:00
|
|
|
|
|
2016-05-22 02:04:52 +08:00
|
|
|
|
QueryBoxFontFaces.SelectedItem =
|
2016-05-09 09:41:46 +08:00
|
|
|
|
SyntaxSugars.CallOrRescueDefault(
|
2016-05-22 02:04:52 +08:00
|
|
|
|
() => ((FontFamily)QueryBoxFont.SelectedItem).ConvertFromInvariantStringsOrNormal(
|
2016-05-09 09:41:46 +08:00
|
|
|
|
_settings.QueryBoxFontStyle,
|
|
|
|
|
_settings.QueryBoxFontWeight,
|
|
|
|
|
_settings.QueryBoxFontStretch
|
|
|
|
|
));
|
2015-02-07 21:27:48 +08:00
|
|
|
|
}
|
2016-03-28 10:09:57 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(_settings.ResultFont) &&
|
|
|
|
|
Fonts.SystemFontFamilies.Count(o => o.FamilyNames.Values.Contains(_settings.ResultFont)) > 0)
|
2015-02-07 21:27:48 +08:00
|
|
|
|
{
|
2016-03-28 10:09:57 +08:00
|
|
|
|
ResultFontComboBox.Text = _settings.ResultFont;
|
2015-02-07 21:27:48 +08:00
|
|
|
|
|
2016-05-09 09:41:46 +08:00
|
|
|
|
ResultFontFacesComboBox.SelectedItem =
|
|
|
|
|
SyntaxSugars.CallOrRescueDefault(
|
|
|
|
|
() => ((FontFamily)ResultFontComboBox.SelectedItem).ConvertFromInvariantStringsOrNormal(
|
|
|
|
|
_settings.ResultFontStyle,
|
|
|
|
|
_settings.ResultFontWeight,
|
|
|
|
|
_settings.ResultFontStretch
|
|
|
|
|
));
|
2015-02-07 21:27:48 +08:00
|
|
|
|
}
|
2015-02-08 10:38:32 +08:00
|
|
|
|
|
2016-02-21 22:22:34 +08:00
|
|
|
|
ResultListBoxPreview.AddResults(new List<Result>
|
2015-02-07 21:27:48 +08:00
|
|
|
|
{
|
2016-01-07 05:34:42 +08:00
|
|
|
|
new Result
|
2015-02-07 21:27:48 +08:00
|
|
|
|
{
|
|
|
|
|
Title = "Wox is an effective launcher for windows",
|
|
|
|
|
SubTitle = "Wox provide bundles of features let you access infomations quickly.",
|
|
|
|
|
IcoPath = "Images/app.png",
|
2016-05-19 02:38:43 +08:00
|
|
|
|
PluginDirectory = Path.GetDirectoryName(Infrastructure.Constant.ProgramDirectory)
|
2015-02-07 21:27:48 +08:00
|
|
|
|
},
|
2016-01-07 05:34:42 +08:00
|
|
|
|
new Result
|
2015-02-07 21:27:48 +08:00
|
|
|
|
{
|
|
|
|
|
Title = "Search applications",
|
|
|
|
|
SubTitle = "Search applications, files (via everything plugin) and browser bookmarks",
|
|
|
|
|
IcoPath = "Images/app.png",
|
2016-05-19 02:38:43 +08:00
|
|
|
|
PluginDirectory = Path.GetDirectoryName(Infrastructure.Constant.ProgramDirectory)
|
2015-02-07 21:27:48 +08:00
|
|
|
|
},
|
2016-01-07 05:34:42 +08:00
|
|
|
|
new Result
|
2015-02-07 21:27:48 +08:00
|
|
|
|
{
|
|
|
|
|
Title = "Search web contents with shortcuts",
|
|
|
|
|
SubTitle = "e.g. search google with g keyword or youtube keyword)",
|
|
|
|
|
IcoPath = "Images/app.png",
|
2016-05-19 02:38:43 +08:00
|
|
|
|
PluginDirectory = Path.GetDirectoryName(Infrastructure.Constant.ProgramDirectory)
|
2015-02-07 21:27:48 +08:00
|
|
|
|
},
|
2016-01-07 05:34:42 +08:00
|
|
|
|
new Result
|
2015-02-07 21:27:48 +08:00
|
|
|
|
{
|
|
|
|
|
Title = "clipboard history ",
|
|
|
|
|
IcoPath = "Images/app.png",
|
2016-05-19 02:38:43 +08:00
|
|
|
|
PluginDirectory = Path.GetDirectoryName(Infrastructure.Constant.ProgramDirectory)
|
2015-02-07 21:27:48 +08:00
|
|
|
|
},
|
2016-01-07 05:34:42 +08:00
|
|
|
|
new Result
|
2015-02-07 21:27:48 +08:00
|
|
|
|
{
|
|
|
|
|
Title = "Themes support",
|
|
|
|
|
SubTitle = "get more themes from http://www.getwox.com/theme",
|
|
|
|
|
IcoPath = "Images/app.png",
|
2016-05-19 02:38:43 +08:00
|
|
|
|
PluginDirectory = Path.GetDirectoryName(Infrastructure.Constant.ProgramDirectory)
|
2015-02-07 21:27:48 +08:00
|
|
|
|
},
|
2016-01-07 05:34:42 +08:00
|
|
|
|
new Result
|
2015-02-07 21:27:48 +08:00
|
|
|
|
{
|
|
|
|
|
Title = "Plugins support",
|
|
|
|
|
SubTitle = "get more plugins from http://www.getwox.com/plugin",
|
|
|
|
|
IcoPath = "Images/app.png",
|
2016-05-19 02:38:43 +08:00
|
|
|
|
PluginDirectory = Path.GetDirectoryName(Infrastructure.Constant.ProgramDirectory)
|
2015-02-07 21:27:48 +08:00
|
|
|
|
},
|
2016-01-07 05:34:42 +08:00
|
|
|
|
new Result
|
2015-02-07 21:27:48 +08:00
|
|
|
|
{
|
|
|
|
|
Title = "Wox is an open-source software",
|
|
|
|
|
SubTitle = "Wox benefits from the open-source community a lot",
|
|
|
|
|
IcoPath = "Images/app.png",
|
2016-05-19 02:38:43 +08:00
|
|
|
|
PluginDirectory = Path.GetDirectoryName(Infrastructure.Constant.ProgramDirectory)
|
2015-02-07 21:27:48 +08:00
|
|
|
|
}
|
2016-03-28 10:09:57 +08:00
|
|
|
|
});
|
2015-02-07 21:27:48 +08:00
|
|
|
|
|
2016-03-28 10:09:57 +08:00
|
|
|
|
foreach (string theme in ThemeManager.Instance.LoadAvailableThemes())
|
2015-02-07 21:27:48 +08:00
|
|
|
|
{
|
2016-01-07 05:34:42 +08:00
|
|
|
|
string themeName = Path.GetFileNameWithoutExtension(theme);
|
2016-05-22 02:04:52 +08:00
|
|
|
|
Theme.Items.Add(themeName);
|
2015-02-07 21:27:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-05-22 02:04:52 +08:00
|
|
|
|
Theme.SelectedItem = _settings.Theme;
|
2015-02-07 21:27:48 +08:00
|
|
|
|
|
|
|
|
|
var wallpaper = WallpaperPathRetrieval.GetWallpaperPath();
|
|
|
|
|
if (wallpaper != null && File.Exists(wallpaper))
|
|
|
|
|
{
|
2015-12-14 04:43:58 +08:00
|
|
|
|
var memStream = new MemoryStream(File.ReadAllBytes(wallpaper));
|
|
|
|
|
var bitmap = new BitmapImage();
|
|
|
|
|
bitmap.BeginInit();
|
|
|
|
|
bitmap.StreamSource = memStream;
|
|
|
|
|
bitmap.EndInit();
|
|
|
|
|
var brush = new ImageBrush(bitmap);
|
2015-02-07 21:27:48 +08:00
|
|
|
|
brush.Stretch = Stretch.UniformToFill;
|
|
|
|
|
PreviewPanel.Background = brush;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var wallpaperColor = WallpaperPathRetrieval.GetWallpaperColor();
|
|
|
|
|
PreviewPanel.Background = new SolidColorBrush(wallpaperColor);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-19 22:17:01 +08:00
|
|
|
|
private void ThemeComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
|
|
{
|
2016-05-22 02:04:52 +08:00
|
|
|
|
string themeName = Theme.SelectedItem.ToString();
|
2016-03-28 10:09:57 +08:00
|
|
|
|
ThemeManager.Instance.ChangeTheme(themeName);
|
2014-03-19 22:17:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void CbQueryBoxFont_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
|
|
{
|
2014-03-25 13:25:43 +08:00
|
|
|
|
if (!settingsLoaded) return;
|
2016-05-22 02:04:52 +08:00
|
|
|
|
string queryBoxFontName = QueryBoxFont.SelectedItem.ToString();
|
2016-03-28 10:09:57 +08:00
|
|
|
|
_settings.QueryBoxFont = queryBoxFontName;
|
2016-05-22 02:04:52 +08:00
|
|
|
|
QueryBoxFontFaces.SelectedItem = ((FontFamily)QueryBoxFont.SelectedItem).ChooseRegularFamilyTypeface();
|
2016-03-28 10:09:57 +08:00
|
|
|
|
ThemeManager.Instance.ChangeTheme(_settings.Theme);
|
2015-02-08 10:38:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
2014-03-25 13:25:43 +08:00
|
|
|
|
private void CbQueryBoxFontFaces_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!settingsLoaded) return;
|
2016-05-22 02:04:52 +08:00
|
|
|
|
FamilyTypeface typeface = (FamilyTypeface)QueryBoxFontFaces.SelectedItem;
|
2014-03-26 15:30:59 +08:00
|
|
|
|
if (typeface == null)
|
|
|
|
|
{
|
2016-05-22 02:04:52 +08:00
|
|
|
|
if (QueryBoxFontFaces.Items.Count > 0)
|
|
|
|
|
QueryBoxFontFaces.SelectedIndex = 0;
|
2014-03-26 15:30:59 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-03-28 10:09:57 +08:00
|
|
|
|
_settings.QueryBoxFontStretch = typeface.Stretch.ToString();
|
|
|
|
|
_settings.QueryBoxFontWeight = typeface.Weight.ToString();
|
|
|
|
|
_settings.QueryBoxFontStyle = typeface.Style.ToString();
|
|
|
|
|
ThemeManager.Instance.ChangeTheme(_settings.Theme);
|
2014-03-26 15:30:59 +08:00
|
|
|
|
}
|
2014-03-19 22:17:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-02-21 23:19:42 +08:00
|
|
|
|
private void OnResultFontSelectionChanged(object sender, SelectionChangedEventArgs e)
|
2014-03-19 22:17:01 +08:00
|
|
|
|
{
|
2014-03-25 13:25:43 +08:00
|
|
|
|
if (!settingsLoaded) return;
|
2016-02-21 23:19:42 +08:00
|
|
|
|
string resultItemFont = ResultFontComboBox.SelectedItem.ToString();
|
2016-03-28 10:09:57 +08:00
|
|
|
|
_settings.ResultFont = resultItemFont;
|
2016-05-09 09:41:46 +08:00
|
|
|
|
ResultFontFacesComboBox.SelectedItem =
|
|
|
|
|
((FontFamily)ResultFontComboBox.SelectedItem).ChooseRegularFamilyTypeface();
|
2016-03-28 10:09:57 +08:00
|
|
|
|
ThemeManager.Instance.ChangeTheme(_settings.Theme);
|
2014-03-19 22:17:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-02-21 23:19:42 +08:00
|
|
|
|
private void OnResultFontFacesSelectionChanged(object sender, SelectionChangedEventArgs e)
|
2014-03-25 13:25:43 +08:00
|
|
|
|
{
|
|
|
|
|
if (!settingsLoaded) return;
|
2016-02-21 23:19:42 +08:00
|
|
|
|
FamilyTypeface typeface = (FamilyTypeface)ResultFontFacesComboBox.SelectedItem;
|
2014-03-26 15:30:59 +08:00
|
|
|
|
if (typeface == null)
|
|
|
|
|
{
|
2016-02-21 23:19:42 +08:00
|
|
|
|
if (ResultFontFacesComboBox.Items.Count > 0)
|
|
|
|
|
ResultFontFacesComboBox.SelectedIndex = 0;
|
2014-03-26 15:30:59 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-03-28 10:09:57 +08:00
|
|
|
|
_settings.ResultFontStretch = typeface.Stretch.ToString();
|
|
|
|
|
_settings.ResultFontWeight = typeface.Weight.ToString();
|
|
|
|
|
_settings.ResultFontStyle = typeface.Style.ToString();
|
|
|
|
|
ThemeManager.Instance.ChangeTheme(_settings.Theme);
|
2014-03-26 15:30:59 +08:00
|
|
|
|
}
|
2014-03-25 13:25:43 +08:00
|
|
|
|
}
|
2014-03-26 17:34:19 +08:00
|
|
|
|
|
2014-03-19 22:17:01 +08:00
|
|
|
|
#endregion
|
2014-03-26 17:34:19 +08:00
|
|
|
|
|
2015-02-07 21:27:48 +08:00
|
|
|
|
#region Plugin
|
2014-03-26 17:34:19 +08:00
|
|
|
|
|
2016-05-22 12:30:38 +08:00
|
|
|
|
private void OnPluginToggled(object sender, RoutedEventArgs e)
|
2014-03-28 22:42:28 +08:00
|
|
|
|
{
|
2016-05-22 12:30:38 +08:00
|
|
|
|
var id = _viewModel.SelectedPlugin.Metadata.ID;
|
|
|
|
|
_settings.PluginSettings.Plugins[id].Disabled = _viewModel.SelectedPlugin.Metadata.Disabled;
|
2014-07-01 22:19:46 +08:00
|
|
|
|
}
|
2014-07-04 12:08:37 +08:00
|
|
|
|
|
2016-05-22 12:30:38 +08:00
|
|
|
|
private void OnPluginActionKeywordsClick(object sender, MouseButtonEventArgs e)
|
2014-07-04 12:08:37 +08:00
|
|
|
|
{
|
|
|
|
|
if (e.ChangedButton == MouseButton.Left)
|
|
|
|
|
{
|
2016-05-22 12:30:38 +08:00
|
|
|
|
var id = _viewModel.SelectedPlugin.Metadata.ID;
|
|
|
|
|
ActionKeywords changeKeywordsWindow = new ActionKeywords(id, _settings);
|
|
|
|
|
changeKeywordsWindow.ShowDialog();
|
2014-07-04 12:08:37 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-07-04 15:12:22 +08:00
|
|
|
|
|
2016-05-22 12:30:38 +08:00
|
|
|
|
private void OnPluginNameClick(object sender, MouseButtonEventArgs e)
|
2014-07-04 15:12:22 +08:00
|
|
|
|
{
|
2014-07-14 23:18:57 +08:00
|
|
|
|
if (e.ChangedButton == MouseButton.Left)
|
2014-07-04 15:12:22 +08:00
|
|
|
|
{
|
2016-05-22 12:30:38 +08:00
|
|
|
|
if (e.ChangedButton == MouseButton.Left)
|
2014-07-04 15:12:22 +08:00
|
|
|
|
{
|
2016-05-22 12:30:38 +08:00
|
|
|
|
var website = _viewModel.SelectedPlugin.Metadata.Website;
|
|
|
|
|
if (!string.IsNullOrEmpty(website))
|
2014-07-04 15:12:22 +08:00
|
|
|
|
{
|
2016-05-22 12:30:38 +08:00
|
|
|
|
var uri = new Uri(website);
|
|
|
|
|
if (Uri.CheckSchemeName(uri.Scheme))
|
2016-05-09 09:41:46 +08:00
|
|
|
|
{
|
2016-05-22 12:30:38 +08:00
|
|
|
|
Process.Start(website);
|
2016-05-09 09:41:46 +08:00
|
|
|
|
}
|
2014-07-04 15:12:22 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-07-14 23:18:57 +08:00
|
|
|
|
|
2016-05-22 12:30:38 +08:00
|
|
|
|
private void OnPluginDirecotyClick(object sender, MouseButtonEventArgs e)
|
2014-07-14 23:18:57 +08:00
|
|
|
|
{
|
|
|
|
|
if (e.ChangedButton == MouseButton.Left)
|
|
|
|
|
{
|
2016-05-22 12:30:38 +08:00
|
|
|
|
var directory = _viewModel.SelectedPlugin.Metadata.PluginDirectory;
|
|
|
|
|
if (!string.IsNullOrEmpty(directory) && Directory.Exists(directory))
|
2014-07-14 23:18:57 +08:00
|
|
|
|
{
|
2016-05-22 12:30:38 +08:00
|
|
|
|
Process.Start(directory);
|
2014-07-14 23:18:57 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-07-16 20:17:51 +08:00
|
|
|
|
|
2016-05-22 12:30:38 +08:00
|
|
|
|
private void OnMorePluginsClicked(object sender, MouseButtonEventArgs e)
|
2014-07-16 20:17:51 +08:00
|
|
|
|
{
|
|
|
|
|
Process.Start("http://www.getwox.com/plugin");
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-07 21:27:48 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Proxy
|
2016-05-09 09:41:46 +08:00
|
|
|
|
|
2014-07-18 20:00:55 +08:00
|
|
|
|
private void btnSaveProxy_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2016-03-11 09:31:21 +08:00
|
|
|
|
_settings.ProxyEnabled = ToggleProxy.IsChecked ?? false;
|
2014-07-18 20:00:55 +08:00
|
|
|
|
|
|
|
|
|
int port = 80;
|
2016-03-28 10:09:57 +08:00
|
|
|
|
if (_settings.ProxyEnabled)
|
2014-07-18 20:00:55 +08:00
|
|
|
|
{
|
2016-05-22 02:04:52 +08:00
|
|
|
|
if (string.IsNullOrEmpty(ProxyServer.Text))
|
2014-07-18 20:00:55 +08:00
|
|
|
|
{
|
2015-01-21 23:00:56 +08:00
|
|
|
|
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("serverCantBeEmpty"));
|
2014-07-18 20:00:55 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
2016-05-22 02:04:52 +08:00
|
|
|
|
if (string.IsNullOrEmpty(ProxyPort.Text))
|
2014-07-18 20:00:55 +08:00
|
|
|
|
{
|
2015-01-21 23:00:56 +08:00
|
|
|
|
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("portCantBeEmpty"));
|
2014-07-18 20:00:55 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
2016-05-22 02:04:52 +08:00
|
|
|
|
if (!int.TryParse(ProxyPort.Text, out port))
|
2014-07-18 20:00:55 +08:00
|
|
|
|
{
|
2015-01-21 23:00:56 +08:00
|
|
|
|
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidPortFormat"));
|
2014-07-18 20:00:55 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-22 02:04:52 +08:00
|
|
|
|
_settings.ProxyServer = ProxyServer.Text;
|
2016-03-28 10:09:57 +08:00
|
|
|
|
_settings.ProxyPort = port;
|
2016-05-22 02:04:52 +08:00
|
|
|
|
_settings.ProxyUserName = ProxyUserName.Text;
|
|
|
|
|
_settings.ProxyPassword = ProxyPassword.Password;
|
2014-07-18 20:00:55 +08:00
|
|
|
|
|
2015-01-21 23:00:56 +08:00
|
|
|
|
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("saveProxySuccessfully"));
|
2014-07-18 20:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnTestProxy_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2016-05-22 02:04:52 +08:00
|
|
|
|
if (string.IsNullOrEmpty(ProxyServer.Text))
|
2014-07-18 20:00:55 +08:00
|
|
|
|
{
|
2015-01-21 23:00:56 +08:00
|
|
|
|
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("serverCantBeEmpty"));
|
2014-07-18 20:00:55 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
2016-05-22 02:04:52 +08:00
|
|
|
|
if (string.IsNullOrEmpty(ProxyPort.Text))
|
2014-07-18 20:00:55 +08:00
|
|
|
|
{
|
2015-01-21 23:00:56 +08:00
|
|
|
|
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("portCantBeEmpty"));
|
2014-07-18 20:00:55 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
int port;
|
2016-05-22 02:04:52 +08:00
|
|
|
|
if (!int.TryParse(ProxyPort.Text, out port))
|
2014-07-18 20:00:55 +08:00
|
|
|
|
{
|
2015-01-21 23:00:56 +08:00
|
|
|
|
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidPortFormat"));
|
2014-07-18 20:00:55 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.baidu.com");
|
|
|
|
|
request.Timeout = 1000 * 5;
|
|
|
|
|
request.ReadWriteTimeout = 1000 * 5;
|
2016-05-22 02:04:52 +08:00
|
|
|
|
if (string.IsNullOrEmpty(ProxyUserName.Text))
|
2014-07-18 20:00:55 +08:00
|
|
|
|
{
|
2016-05-22 02:04:52 +08:00
|
|
|
|
request.Proxy = new WebProxy(ProxyServer.Text, port);
|
2014-07-18 20:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-05-22 02:04:52 +08:00
|
|
|
|
request.Proxy = new WebProxy(ProxyServer.Text, port);
|
|
|
|
|
request.Proxy.Credentials = new NetworkCredential(ProxyUserName.Text, ProxyPassword.Password);
|
2014-07-18 20:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
|
{
|
2015-01-02 16:16:09 +08:00
|
|
|
|
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
2014-07-18 20:00:55 +08:00
|
|
|
|
if (response.StatusCode == HttpStatusCode.OK)
|
|
|
|
|
{
|
2015-01-21 23:00:56 +08:00
|
|
|
|
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("proxyIsCorrect"));
|
2014-07-18 20:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-01-21 23:00:56 +08:00
|
|
|
|
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("proxyConnectFailed"));
|
2014-07-18 20:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
2015-01-21 23:00:56 +08:00
|
|
|
|
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("proxyConnectFailed"));
|
2014-07-18 20:00:55 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-12-16 22:25:22 +08:00
|
|
|
|
|
2015-02-07 21:27:48 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
2016-01-07 05:34:42 +08:00
|
|
|
|
private void Window_PreviewKeyDown(object sender, KeyEventArgs e)
|
2015-09-26 05:50:22 +08:00
|
|
|
|
{
|
|
|
|
|
// Hide window with ESC, but make sure it is not pressed as a hotkey
|
2016-05-22 02:04:52 +08:00
|
|
|
|
if (e.Key == Key.Escape && !HotkeyControl.IsFocused)
|
2015-09-26 05:50:22 +08:00
|
|
|
|
{
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-05-05 08:57:03 +08:00
|
|
|
|
|
2016-05-09 09:32:47 +08:00
|
|
|
|
private async void OnCheckUpdates(object sender, RoutedEventArgs e)
|
2016-05-09 09:41:46 +08:00
|
|
|
|
{
|
2016-05-10 03:40:59 +08:00
|
|
|
|
var version = await Updater.NewVersion();
|
2016-05-09 09:41:46 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(version))
|
|
|
|
|
{
|
2016-05-10 03:40:59 +08:00
|
|
|
|
var newVersion = Updater.NumericVersion(version);
|
2016-05-19 02:38:43 +08:00
|
|
|
|
var oldVersion = Updater.NumericVersion(Infrastructure.Constant.Version);
|
2016-05-09 09:41:46 +08:00
|
|
|
|
if (newVersion > oldVersion)
|
|
|
|
|
{
|
|
|
|
|
NewVersionTips.Text = string.Format(NewVersionTips.Text, version);
|
|
|
|
|
NewVersionTips.Visibility = Visibility.Visible;
|
2016-05-10 03:40:59 +08:00
|
|
|
|
Updater.UpdateApp();
|
2016-05-09 09:41:46 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-09 09:32:47 +08:00
|
|
|
|
private void OnRequestNavigate(object sender, RequestNavigateEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
|
|
|
|
|
e.Handled = true;
|
|
|
|
|
}
|
2016-05-22 12:30:38 +08:00
|
|
|
|
|
2014-01-25 18:00:13 +08:00
|
|
|
|
}
|
|
|
|
|
}
|