mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Dev/crutkas/fixing warnings (#5161)
* new lines & braces * Tabs /space auto fix Co-authored-by: Clint Rutkas <crutkas@microsoft.com>
This commit is contained in:
@@ -117,7 +117,7 @@ namespace PowerLauncher.ViewModel
|
||||
|
||||
private void InitializeKeyCommands()
|
||||
{
|
||||
IgnoreCommand = new RelayCommand(_ => {});
|
||||
IgnoreCommand = new RelayCommand(_ => { });
|
||||
|
||||
EscCommand = new RelayCommand(_ =>
|
||||
{
|
||||
@@ -187,7 +187,7 @@ namespace PowerLauncher.ViewModel
|
||||
results.SelectedIndex = int.Parse(index.ToString(), CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
if(results.SelectedItem != null)
|
||||
if (results.SelectedItem != null)
|
||||
{
|
||||
//If there is a context button selected fire the action for that button before the main command.
|
||||
bool didExecuteContextButton = results.SelectedItem.ExecuteSelectedContextButton();
|
||||
@@ -218,7 +218,7 @@ namespace PowerLauncher.ViewModel
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
LoadContextMenuCommand = new RelayCommand(_ =>
|
||||
@@ -248,12 +248,12 @@ namespace PowerLauncher.ViewModel
|
||||
|
||||
ClearQueryCommand = new RelayCommand(_ =>
|
||||
{
|
||||
if(!string.IsNullOrEmpty(QueryText))
|
||||
if (!string.IsNullOrEmpty(QueryText))
|
||||
{
|
||||
ChangeQueryText(string.Empty,true);
|
||||
//Push Event to UI SystemQuery has changed
|
||||
OnPropertyChanged(nameof(SystemQueryText));
|
||||
}
|
||||
ChangeQueryText(string.Empty, true);
|
||||
//Push Event to UI SystemQuery has changed
|
||||
OnPropertyChanged(nameof(SystemQueryText));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ namespace PowerLauncher.ViewModel
|
||||
public string SystemQueryText { get; set; } = String.Empty;
|
||||
|
||||
public string QueryText { get; set; } = String.Empty;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// we need move cursor to end when we manually changed query
|
||||
@@ -280,11 +280,11 @@ namespace PowerLauncher.ViewModel
|
||||
/// </summary>
|
||||
/// <param name="queryText"></param>
|
||||
/// <param name="requery">Optional Parameter that if true, will automatically execute a query against the updated text</param>
|
||||
public void ChangeQueryText(string queryText, bool requery=false)
|
||||
public void ChangeQueryText(string queryText, bool requery = false)
|
||||
{
|
||||
SystemQueryText = queryText;
|
||||
|
||||
if(requery)
|
||||
|
||||
if (requery)
|
||||
{
|
||||
QueryText = queryText;
|
||||
Query();
|
||||
@@ -332,11 +332,13 @@ namespace PowerLauncher.ViewModel
|
||||
|
||||
private Visibility _visibility;
|
||||
|
||||
public Visibility MainWindowVisibility {
|
||||
public Visibility MainWindowVisibility
|
||||
{
|
||||
get { return _visibility; }
|
||||
set {
|
||||
set
|
||||
{
|
||||
_visibility = value;
|
||||
if(value == Visibility.Visible)
|
||||
if (value == Visibility.Visible)
|
||||
{
|
||||
PowerToysTelemetry.Log.WriteEvent(new LauncherShowEvent());
|
||||
}
|
||||
@@ -344,7 +346,7 @@ namespace PowerLauncher.ViewModel
|
||||
{
|
||||
PowerToysTelemetry.Log.WriteEvent(new LauncherHideEvent());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -503,7 +505,7 @@ namespace PowerLauncher.ViewModel
|
||||
_updateSource?.Cancel();
|
||||
_lastQuery = _emptyQuery;
|
||||
Results.SelectedItem = null;
|
||||
Results.Clear();
|
||||
Results.Clear();
|
||||
Results.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
@@ -569,7 +571,7 @@ namespace PowerLauncher.ViewModel
|
||||
hotkey.Shift = hotkeyModel.Shift;
|
||||
hotkey.Ctrl = hotkeyModel.Ctrl;
|
||||
hotkey.Win = hotkeyModel.Win;
|
||||
hotkey.Key = (byte) KeyInterop.VirtualKeyFromKey(hotkeyModel.CharKey);
|
||||
hotkey.Key = (byte)KeyInterop.VirtualKeyFromKey(hotkeyModel.CharKey);
|
||||
|
||||
_hotkeyHandle = _hotkeyManager.RegisterHotkey(hotkey, action);
|
||||
}
|
||||
@@ -672,7 +674,7 @@ namespace PowerLauncher.ViewModel
|
||||
/// </summary>
|
||||
public void UpdateResultView(List<Result> list, PluginMetadata metadata, Query originQuery)
|
||||
{
|
||||
if(list == null)
|
||||
if (list == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(list));
|
||||
}
|
||||
@@ -799,8 +801,8 @@ namespace PowerLauncher.ViewModel
|
||||
_hotkeyManager.Dispose();
|
||||
_updateSource.Dispose();
|
||||
_disposed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
Reference in New Issue
Block a user