mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
ReSharper: remove redundant code
This commit is contained in:
@@ -19,7 +19,6 @@ namespace Wox
|
||||
{
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("cannotFindSpecifiedPlugin"));
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ namespace Wox.Converters
|
||||
{
|
||||
public class StringNullOrEmptyToVisibilityConverter : ConvertorBase<StringNullOrEmptyToVisibilityConverter>
|
||||
{
|
||||
public StringNullOrEmptyToVisibilityConverter() { }
|
||||
|
||||
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return string.IsNullOrEmpty(value as string) ? Visibility.Collapsed : Visibility.Visible;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Wox
|
||||
UserSettingStorage.Instance.CustomPluginHotkeys = new List<CustomPluginHotkey>();
|
||||
}
|
||||
|
||||
var pluginHotkey = new CustomPluginHotkey()
|
||||
var pluginHotkey = new CustomPluginHotkey
|
||||
{
|
||||
Hotkey = ctlHotkey.CurrentHotkey.ToString(),
|
||||
ActionKeyword = tbAction.Text
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Wox.Helper
|
||||
{
|
||||
if (!DropShadow(window))
|
||||
{
|
||||
window.SourceInitialized += new EventHandler(window_SourceInitialized);
|
||||
window.SourceInitialized += window_SourceInitialized;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Wox.Helper
|
||||
|
||||
DropShadow(window);
|
||||
|
||||
window.SourceInitialized -= new EventHandler(window_SourceInitialized);
|
||||
window.SourceInitialized -= window_SourceInitialized;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -16,14 +16,14 @@ namespace Wox.Helper
|
||||
public static void UnhandledExceptionHandle(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
//handle non-ui thread exceptions
|
||||
App.Window.Dispatcher.Invoke(new Action(() =>
|
||||
App.Window.Dispatcher.Invoke(() =>
|
||||
{
|
||||
Report((Exception)e.ExceptionObject);
|
||||
if (!(e.ExceptionObject is WoxException))
|
||||
{
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
public static void DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Runtime.Remoting.Channels;
|
||||
using System.Runtime.Remoting.Channels.Ipc;
|
||||
using System.Runtime.Serialization.Formatters;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
@@ -131,7 +132,7 @@ namespace Wox.Helper
|
||||
// This is the hard-coded message value used by WinForms for Shell_NotifyIcon.
|
||||
// It's relatively safe to reuse.
|
||||
TRAYMOUSEMESSAGE = 0x800, //WM_USER + 1024
|
||||
APP = 0x8000,
|
||||
APP = 0x8000
|
||||
}
|
||||
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
@@ -342,7 +343,7 @@ namespace Wox.Helper
|
||||
{
|
||||
try
|
||||
{
|
||||
using (TextReader reader = new StreamReader(cmdLinePath, System.Text.Encoding.Unicode))
|
||||
using (TextReader reader = new StreamReader(cmdLinePath, Encoding.Unicode))
|
||||
{
|
||||
args = NativeMethods.CommandLineToArgvW(reader.ReadToEnd());
|
||||
}
|
||||
@@ -465,7 +466,7 @@ namespace Wox.Helper
|
||||
{
|
||||
// Do an asynchronous call to ActivateFirstInstance function
|
||||
Application.Current.Dispatcher.BeginInvoke(
|
||||
DispatcherPriority.Normal, new DispatcherOperationCallback(SingleInstance<TApplication>.ActivateFirstInstanceCallback), args);
|
||||
DispatcherPriority.Normal, new DispatcherOperationCallback(ActivateFirstInstanceCallback), args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Wox.Helper
|
||||
{
|
||||
try
|
||||
{
|
||||
var parts = result.ToString().Trim().Split(new char[] {' '}, 3).Select(byte.Parse).ToList();
|
||||
var parts = result.ToString().Trim().Split(new[] {' '}, 3).Select(byte.Parse).ToList();
|
||||
return Color.FromRgb(parts[0], parts[1], parts[2]);
|
||||
}
|
||||
catch
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Wox.ImageLoader
|
||||
[Serializable]
|
||||
public class ImageCacheStroage : BinaryStorage<ImageCacheStroage>
|
||||
{
|
||||
private int counter = 0;
|
||||
private int counter;
|
||||
private const int maxCached = 200;
|
||||
public Dictionary<string, int> TopUsedImages = new Dictionary<string, int>();
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using Wox.Infrastructure;
|
||||
@@ -43,7 +44,7 @@ namespace Wox.ImageLoader
|
||||
Icon icon = GetFileIcon(fileName) ?? Icon.ExtractAssociatedIcon(fileName);
|
||||
if (icon != null)
|
||||
{
|
||||
return System.Windows.Interop.Imaging.CreateBitmapSourceFromHIcon(icon.Handle,
|
||||
return Imaging.CreateBitmapSourceFromHIcon(icon.Handle,
|
||||
new Int32Rect(0, 0, icon.Width, icon.Height), BitmapSizeOptions.FromEmptyOptions());
|
||||
}
|
||||
}
|
||||
@@ -206,7 +207,7 @@ namespace Wox.ImageLoader
|
||||
public string szDisplayName;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = NAMESIZE)]
|
||||
public string szTypeName;
|
||||
};
|
||||
}
|
||||
|
||||
private const uint SHGFI_ICON = 0x000000100; // get icon
|
||||
private const uint SHGFI_DISPLAYNAME = 0x000000200; // get display name
|
||||
|
||||
@@ -10,6 +10,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media.Animation;
|
||||
using NHotkey;
|
||||
@@ -24,11 +25,16 @@ using Wox.Infrastructure;
|
||||
using Wox.Infrastructure.Hotkey;
|
||||
using Wox.Plugin;
|
||||
using Wox.Storage;
|
||||
using Application = System.Windows.Application;
|
||||
using ContextMenu = System.Windows.Forms.ContextMenu;
|
||||
using NotifyIcon = System.Windows.Forms.NotifyIcon;
|
||||
using Screen = System.Windows.Forms.Screen;
|
||||
using DataFormats = System.Windows.DataFormats;
|
||||
using DragEventArgs = System.Windows.DragEventArgs;
|
||||
using IDataObject = System.Windows.IDataObject;
|
||||
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
|
||||
using MenuItem = System.Windows.Forms.MenuItem;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
using Stopwatch = Wox.Infrastructure.Stopwatch;
|
||||
using ToolTip = System.Windows.Controls.ToolTip;
|
||||
|
||||
namespace Wox
|
||||
{
|
||||
@@ -43,7 +49,7 @@ namespace Wox
|
||||
private Query _lastQuery = new Query();
|
||||
private ToolTip toolTip = new ToolTip();
|
||||
|
||||
private bool _ignoreTextChange = false;
|
||||
private bool _ignoreTextChange;
|
||||
private List<Result> CurrentContextMenus = new List<Result>();
|
||||
private string textBeforeEnterContextMenuMode;
|
||||
|
||||
@@ -53,7 +59,7 @@ namespace Wox
|
||||
|
||||
public void ChangeQuery(string query, bool requery = false)
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
tbQuery.Text = query;
|
||||
tbQuery.CaretIndex = tbQuery.Text.Length;
|
||||
@@ -61,12 +67,12 @@ namespace Wox
|
||||
{
|
||||
TbQuery_OnTextChanged(null, null);
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
public void ChangeQueryText(string query, bool selectAll = false)
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
_ignoreTextChange = true;
|
||||
tbQuery.Text = query;
|
||||
@@ -75,7 +81,7 @@ namespace Wox
|
||||
{
|
||||
tbQuery.SelectAll();
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
public void CloseApp()
|
||||
@@ -96,50 +102,50 @@ namespace Wox
|
||||
|
||||
public void HideApp()
|
||||
{
|
||||
Dispatcher.Invoke(new Action(HideWox));
|
||||
Dispatcher.Invoke(HideWox);
|
||||
}
|
||||
|
||||
public void ShowApp()
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() => ShowWox()));
|
||||
Dispatcher.Invoke(() => ShowWox());
|
||||
}
|
||||
|
||||
public void ShowMsg(string title, string subTitle, string iconPath)
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
var m = new Msg { Owner = GetWindow(this) };
|
||||
m.Show(title, subTitle, iconPath);
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
public void OpenSettingDialog(string tabName = "general")
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
SettingWindow sw = SingletonWindowOpener.Open<SettingWindow>(this);
|
||||
sw.SwitchTo(tabName);
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
public void StartLoadingBar()
|
||||
{
|
||||
Dispatcher.Invoke(new Action(StartProgress));
|
||||
Dispatcher.Invoke(StartProgress);
|
||||
}
|
||||
|
||||
public void StopLoadingBar()
|
||||
{
|
||||
Dispatcher.Invoke(new Action(StopProgress));
|
||||
Dispatcher.Invoke(StopProgress);
|
||||
}
|
||||
|
||||
public void InstallPlugin(string path)
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() => PluginManager.InstallPlugin(path)));
|
||||
Dispatcher.Invoke(() => PluginManager.InstallPlugin(path));
|
||||
}
|
||||
|
||||
public void ReloadPlugins()
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() => PluginManager.Init(this)));
|
||||
Dispatcher.Invoke(() => PluginManager.Init(this));
|
||||
}
|
||||
|
||||
public string GetTranslation(string key)
|
||||
@@ -241,7 +247,7 @@ namespace Wox
|
||||
UserSettingStorage.Instance.WindowLeft = Left;
|
||||
UserSettingStorage.Instance.WindowTop = Top;
|
||||
UserSettingStorage.Instance.Save();
|
||||
this.HideWox();
|
||||
HideWox();
|
||||
e.Cancel = true;
|
||||
}
|
||||
|
||||
@@ -293,10 +299,10 @@ namespace Wox
|
||||
|
||||
private void OnPrepareUpdateReady(object sender, EventArgs e)
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
new WoxUpdate().ShowDialog();
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
public void SetHotkey(string hotkeyStr, EventHandler<HotkeyEventArgs> action)
|
||||
@@ -664,7 +670,7 @@ namespace Wox
|
||||
case Key.Back:
|
||||
if (BackKeyDownEvent != null)
|
||||
{
|
||||
BackKeyDownEvent(new WoxKeyDownEventArgs()
|
||||
BackKeyDownEvent(new WoxKeyDownEventArgs
|
||||
{
|
||||
Query = tbQuery.Text,
|
||||
keyEventArgs = e
|
||||
@@ -736,9 +742,10 @@ namespace Wox
|
||||
var executeQueryHistoryTitle = GetTranslation("executeQuery");
|
||||
var lastExecuteTime = GetTranslation("lastExecuteTime");
|
||||
pnlResult.RemoveResultsExcept(historyMetadata);
|
||||
UpdateResultViewInternal(new List<Result>()
|
||||
UpdateResultViewInternal(new List<Result>
|
||||
{
|
||||
new Result(){
|
||||
new Result
|
||||
{
|
||||
Title = string.Format(executeQueryHistoryTitle,history.Query),
|
||||
SubTitle = string.Format(lastExecuteTime,history.ExecutedDateTime),
|
||||
IcoPath = "Images\\history.png",
|
||||
@@ -815,7 +822,7 @@ namespace Wox
|
||||
{
|
||||
if (result.Action != null)
|
||||
{
|
||||
bool hideWindow = result.Action(new ActionContext()
|
||||
bool hideWindow = result.Action(new ActionContext
|
||||
{
|
||||
SpecialKeyState = GlobalHotkey.Instance.CheckModifiers()
|
||||
});
|
||||
@@ -832,7 +839,7 @@ namespace Wox
|
||||
private void UpdateResultView(List<Result> list, PluginMetadata metadata, Query originQuery)
|
||||
{
|
||||
_queryHasReturn = true;
|
||||
progressBar.Dispatcher.Invoke(new Action(StopProgress));
|
||||
progressBar.Dispatcher.Invoke(StopProgress);
|
||||
|
||||
list.ForEach(o =>
|
||||
{
|
||||
@@ -846,11 +853,11 @@ namespace Wox
|
||||
|
||||
private void UpdateResultViewInternal(List<Result> list, PluginMetadata metadata)
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
Stopwatch.Normal($"UI update cost for {metadata.Name}",
|
||||
() => { pnlResult.AddResults(list, metadata.ID); });
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
private Result GetTopMostContextMenu(Result result)
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Wox
|
||||
public partial class Msg : Window
|
||||
{
|
||||
Storyboard fadeOutStoryboard = new Storyboard();
|
||||
private bool closing = false;
|
||||
private bool closing;
|
||||
|
||||
public Msg()
|
||||
{
|
||||
@@ -21,13 +21,13 @@ namespace Wox
|
||||
var dipWorkingArea = WindowIntelopHelper.TransformPixelsToDIP(this,
|
||||
screen.WorkingArea.Width,
|
||||
screen.WorkingArea.Height);
|
||||
Left = dipWorkingArea.X - this.Width;
|
||||
Left = dipWorkingArea.X - Width;
|
||||
Top = dipWorkingArea.Y;
|
||||
showAnimation.From = dipWorkingArea.Y;
|
||||
showAnimation.To = dipWorkingArea.Y - Height;
|
||||
|
||||
// Create the fade out storyboard
|
||||
fadeOutStoryboard.Completed += new EventHandler(fadeOutStoryboard_Completed);
|
||||
fadeOutStoryboard.Completed += fadeOutStoryboard_Completed;
|
||||
DoubleAnimation fadeOutAnimation = new DoubleAnimation(dipWorkingArea.Y - Height, dipWorkingArea.Y, new Duration(TimeSpan.FromSeconds(0.3)))
|
||||
{
|
||||
AccelerationRatio = 0.2
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using Exceptionless.Configuration;
|
||||
|
||||
[assembly: AssemblyTitle("Wox")]
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None,
|
||||
ResourceDictionaryLocation.SourceAssembly
|
||||
)]
|
||||
[assembly: Exceptionless.Configuration.Exceptionless("e0b256fbe9384498ba89aae2a6b7f8ab")]
|
||||
[assembly: Exceptionless("e0b256fbe9384498ba89aae2a6b7f8ab")]
|
||||
@@ -17,7 +17,6 @@ using Wox.Core.Theme;
|
||||
using Wox.Core.Updater;
|
||||
using Wox.Core.UserSettings;
|
||||
using Wox.Helper;
|
||||
using Wox.Infrastructure.Exception;
|
||||
using Wox.Plugin;
|
||||
using Application = System.Windows.Forms.Application;
|
||||
using Stopwatch = Wox.Infrastructure.Stopwatch;
|
||||
@@ -27,13 +26,13 @@ namespace Wox
|
||||
public partial class SettingWindow : Window
|
||||
{
|
||||
public readonly MainWindow MainWindow;
|
||||
bool settingsLoaded = false;
|
||||
bool settingsLoaded;
|
||||
private Dictionary<ISettingProvider, Control> featureControls = new Dictionary<ISettingProvider, Control>();
|
||||
private bool themeTabLoaded = false;
|
||||
private bool themeTabLoaded;
|
||||
|
||||
public SettingWindow(MainWindow mainWindow)
|
||||
{
|
||||
this.MainWindow = mainWindow;
|
||||
MainWindow = mainWindow;
|
||||
InitializeComponent();
|
||||
Loaded += Setting_Loaded;
|
||||
}
|
||||
@@ -248,7 +247,7 @@ namespace Wox
|
||||
|
||||
#region Hotkey
|
||||
|
||||
void ctlHotkey_OnHotkeyChanged(object sender, System.EventArgs e)
|
||||
void ctlHotkey_OnHotkeyChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (ctlHotkey.CurrentHotkeyAvailable)
|
||||
{
|
||||
@@ -362,50 +361,50 @@ namespace Wox
|
||||
));
|
||||
}
|
||||
|
||||
resultPanelPreview.AddResults(new List<Result>()
|
||||
resultPanelPreview.AddResults(new List<Result>
|
||||
{
|
||||
new Result()
|
||||
new Result
|
||||
{
|
||||
Title = "Wox is an effective launcher for windows",
|
||||
SubTitle = "Wox provide bundles of features let you access infomations quickly.",
|
||||
IcoPath = "Images/app.png",
|
||||
PluginDirectory = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath)
|
||||
PluginDirectory = Path.GetDirectoryName(Application.ExecutablePath)
|
||||
},
|
||||
new Result()
|
||||
new Result
|
||||
{
|
||||
Title = "Search applications",
|
||||
SubTitle = "Search applications, files (via everything plugin) and browser bookmarks",
|
||||
IcoPath = "Images/app.png",
|
||||
PluginDirectory = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath)
|
||||
PluginDirectory = Path.GetDirectoryName(Application.ExecutablePath)
|
||||
},
|
||||
new Result()
|
||||
new Result
|
||||
{
|
||||
Title = "Search web contents with shortcuts",
|
||||
SubTitle = "e.g. search google with g keyword or youtube keyword)",
|
||||
IcoPath = "Images/app.png",
|
||||
PluginDirectory = Path.GetDirectoryName(Application.ExecutablePath)
|
||||
},
|
||||
new Result()
|
||||
new Result
|
||||
{
|
||||
Title = "clipboard history ",
|
||||
IcoPath = "Images/app.png",
|
||||
PluginDirectory = Path.GetDirectoryName(Application.ExecutablePath)
|
||||
},
|
||||
new Result()
|
||||
new Result
|
||||
{
|
||||
Title = "Themes support",
|
||||
SubTitle = "get more themes from http://www.getwox.com/theme",
|
||||
IcoPath = "Images/app.png",
|
||||
PluginDirectory = Path.GetDirectoryName(Application.ExecutablePath)
|
||||
},
|
||||
new Result()
|
||||
new Result
|
||||
{
|
||||
Title = "Plugins support",
|
||||
SubTitle = "get more plugins from http://www.getwox.com/plugin",
|
||||
IcoPath = "Images/app.png",
|
||||
PluginDirectory = Path.GetDirectoryName(Application.ExecutablePath)
|
||||
},
|
||||
new Result()
|
||||
new Result
|
||||
{
|
||||
Title = "Wox is an open-source software",
|
||||
SubTitle = "Wox benefits from the open-source community a lot",
|
||||
@@ -416,7 +415,7 @@ namespace Wox
|
||||
|
||||
foreach (string theme in ThemeManager.Theme.LoadAvailableThemes())
|
||||
{
|
||||
string themeName = System.IO.Path.GetFileNameWithoutExtension(theme);
|
||||
string themeName = Path.GetFileNameWithoutExtension(theme);
|
||||
themeComboBox.Items.Add(themeName);
|
||||
}
|
||||
|
||||
@@ -453,7 +452,7 @@ namespace Wox
|
||||
if (!settingsLoaded) return;
|
||||
string queryBoxFontName = cbQueryBoxFont.SelectedItem.ToString();
|
||||
UserSettingStorage.Instance.QueryBoxFont = queryBoxFontName;
|
||||
this.cbQueryBoxFontFaces.SelectedItem = ((FontFamily)cbQueryBoxFont.SelectedItem).ChooseRegularFamilyTypeface();
|
||||
cbQueryBoxFontFaces.SelectedItem = ((FontFamily)cbQueryBoxFont.SelectedItem).ChooseRegularFamilyTypeface();
|
||||
UserSettingStorage.Instance.Save();
|
||||
ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
}
|
||||
@@ -466,8 +465,6 @@ namespace Wox
|
||||
{
|
||||
if (cbQueryBoxFontFaces.Items.Count > 0)
|
||||
cbQueryBoxFontFaces.SelectedIndex = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -484,7 +481,7 @@ namespace Wox
|
||||
if (!settingsLoaded) return;
|
||||
string resultItemFont = cbResultItemFont.SelectedItem.ToString();
|
||||
UserSettingStorage.Instance.ResultItemFont = resultItemFont;
|
||||
this.cbResultItemFontFaces.SelectedItem = ((FontFamily)cbResultItemFont.SelectedItem).ChooseRegularFamilyTypeface();
|
||||
cbResultItemFontFaces.SelectedItem = ((FontFamily)cbResultItemFont.SelectedItem).ChooseRegularFamilyTypeface();
|
||||
UserSettingStorage.Instance.Save();
|
||||
ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
}
|
||||
@@ -596,7 +593,7 @@ namespace Wox
|
||||
if (customizedPluginConfig == null)
|
||||
{
|
||||
// todo when this part will be invoked
|
||||
UserSettingStorage.Instance.CustomizedPluginConfigs.Add(new CustomizedPluginConfig()
|
||||
UserSettingStorage.Instance.CustomizedPluginConfigs.Add(new CustomizedPluginConfig
|
||||
{
|
||||
Disabled = cbDisabled.IsChecked ?? true,
|
||||
ID = id,
|
||||
@@ -800,7 +797,7 @@ namespace Wox
|
||||
|
||||
#endregion
|
||||
|
||||
private void Window_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
||||
private void Window_PreviewKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
// Hide window with ESC, but make sure it is not pressed as a hotkey
|
||||
if (e.Key == Key.Escape && !ctlHotkey.IsFocused)
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Wox.Storage
|
||||
private List<HistoryItem> History = new List<HistoryItem>();
|
||||
|
||||
private int MaxHistory = 300;
|
||||
private int cursor = 0;
|
||||
private int cursor;
|
||||
|
||||
public static PluginMetadata MetaData { get; } = new PluginMetadata
|
||||
{ ID = "Query history", Name = "Query history" };
|
||||
@@ -61,7 +61,7 @@ namespace Wox.Storage
|
||||
}
|
||||
else
|
||||
{
|
||||
History.Add(new HistoryItem()
|
||||
History.Add(new HistoryItem
|
||||
{
|
||||
Query = query,
|
||||
ExecutedDateTime = DateTime.Now
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Wox.Infrastructure.Storage;
|
||||
using Wox.Plugin;
|
||||
|
||||
namespace Wox.Storage
|
||||
{
|
||||
@@ -20,7 +21,7 @@ namespace Wox.Storage
|
||||
get { return "TopMostRecords"; }
|
||||
}
|
||||
|
||||
internal bool IsTopMost(Plugin.Result result)
|
||||
internal bool IsTopMost(Result result)
|
||||
{
|
||||
return records.Any(o => o.Value.Title == result.Title
|
||||
&& o.Value.SubTitle == result.SubTitle
|
||||
@@ -28,7 +29,7 @@ namespace Wox.Storage
|
||||
&& o.Key == result.OriginQuery.RawQuery);
|
||||
}
|
||||
|
||||
internal void Remove(Plugin.Result result)
|
||||
internal void Remove(Result result)
|
||||
{
|
||||
if (records.ContainsKey(result.OriginQuery.RawQuery))
|
||||
{
|
||||
@@ -37,7 +38,7 @@ namespace Wox.Storage
|
||||
}
|
||||
}
|
||||
|
||||
internal void AddOrUpdate(Plugin.Result result)
|
||||
internal void AddOrUpdate(Result result)
|
||||
{
|
||||
if (records.ContainsKey(result.OriginQuery.RawQuery))
|
||||
{
|
||||
@@ -47,11 +48,11 @@ namespace Wox.Storage
|
||||
}
|
||||
else
|
||||
{
|
||||
records.Add(result.OriginQuery.RawQuery, new TopMostRecord()
|
||||
{
|
||||
records.Add(result.OriginQuery.RawQuery, new TopMostRecord
|
||||
{
|
||||
PluginID = result.PluginID,
|
||||
Title = result.Title,
|
||||
SubTitle = result.SubTitle,
|
||||
SubTitle = result.SubTitle
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user