mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
wrapping up everything minus var renaming (#5952)
This commit is contained in:
@@ -25,15 +25,15 @@ namespace PowerLauncher.ViewModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._command;
|
||||
return _command;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
// ICommand does not implement the INotifyPropertyChanged interface and must call OnPropertyChanged() to prevent memory leaks
|
||||
if (value != this._command)
|
||||
if (value != _command)
|
||||
{
|
||||
this._command = value;
|
||||
_command = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,10 +29,8 @@ namespace PowerLauncher.ViewModel
|
||||
{
|
||||
public class MainViewModel : BaseModel, ISavable, IDisposable
|
||||
{
|
||||
private Query _currentQuery;
|
||||
private static Query _emptyQuery = new Query();
|
||||
private static bool _disposed;
|
||||
private string _queryTextBeforeLeaveResults;
|
||||
|
||||
private readonly WoxJsonStorage<QueryHistory> _historyItemsStorage;
|
||||
private readonly WoxJsonStorage<UserSelectedRecord> _userSelectedRecordStorage;
|
||||
@@ -41,6 +39,11 @@ namespace PowerLauncher.ViewModel
|
||||
private readonly QueryHistory _history;
|
||||
private readonly UserSelectedRecord _userSelectedRecord;
|
||||
private readonly TopMostRecord _topMostRecord;
|
||||
private readonly object _addResultsLock = new object();
|
||||
private readonly Internationalization _translator = InternationalizationManager.Instance;
|
||||
|
||||
private Query _currentQuery;
|
||||
private string _queryTextBeforeLeaveResults;
|
||||
|
||||
private CancellationTokenSource _updateSource { get; set; }
|
||||
|
||||
@@ -50,11 +53,8 @@ namespace PowerLauncher.ViewModel
|
||||
private HotkeyManager _hotkeyManager { get; set; }
|
||||
|
||||
private ushort _hotkeyHandle;
|
||||
private readonly Internationalization _translator = InternationalizationManager.Instance;
|
||||
private System.Diagnostics.Stopwatch hotkeyTimer = new System.Diagnostics.Stopwatch();
|
||||
|
||||
private readonly object _addResultsLock = new object();
|
||||
|
||||
public MainViewModel(Settings settings)
|
||||
{
|
||||
_hotkeyManager = new HotkeyManager();
|
||||
@@ -110,7 +110,8 @@ namespace PowerLauncher.ViewModel
|
||||
var plugin = (IResultUpdated)pair.Plugin;
|
||||
plugin.ResultsUpdated += (s, e) =>
|
||||
{
|
||||
Task.Run(() =>
|
||||
Task.Run(
|
||||
() =>
|
||||
{
|
||||
PluginManager.UpdatePluginMetadata(e.Results, pair.Metadata, e.Query);
|
||||
UpdateResultView(e.Results, e.Query, _updateToken);
|
||||
@@ -257,6 +258,7 @@ namespace PowerLauncher.ViewModel
|
||||
if (!string.IsNullOrEmpty(QueryText))
|
||||
{
|
||||
ChangeQueryText(string.Empty, true);
|
||||
|
||||
// Push Event to UI SystemQuery has changed
|
||||
OnPropertyChanged(nameof(SystemQueryText));
|
||||
}
|
||||
@@ -465,7 +467,8 @@ namespace PowerLauncher.ViewModel
|
||||
if (query != null)
|
||||
{
|
||||
_currentQuery = query;
|
||||
Task.Run(() =>
|
||||
Task.Run(
|
||||
() =>
|
||||
{
|
||||
Thread.Sleep(20);
|
||||
var plugins = PluginManager.ValidPluginsForQuery(query);
|
||||
|
||||
@@ -231,7 +231,7 @@ namespace PowerLauncher.ViewModel
|
||||
|
||||
public bool HasSelectedContextButton()
|
||||
{
|
||||
var isContextSelected = (ContextMenuSelectedIndex != NoSelectionIndex);
|
||||
var isContextSelected = ContextMenuSelectedIndex != NoSelectionIndex;
|
||||
return isContextSelected;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user