mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +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:
@@ -15,7 +15,8 @@ namespace PowerLauncher.ViewModel
|
||||
public string Title { get; set; }
|
||||
public string Glyph { get; set; }
|
||||
public string FontFamily { get; set; }
|
||||
public ICommand Command {
|
||||
public ICommand Command
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._command;
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -42,10 +42,10 @@ namespace PowerLauncher.ViewModel
|
||||
{
|
||||
Result = result;
|
||||
}
|
||||
|
||||
|
||||
ContextMenuSelectedIndex = NoSelectionIndex;
|
||||
LoadContextMenu();
|
||||
|
||||
|
||||
ActivateContextButtonsHoverCommand = new RelayCommand(ActivateContextButtonsHoverAction);
|
||||
ActivateContextButtonsSelectionCommand = new RelayCommand(ActivateContextButtonsSelectionAction);
|
||||
DeactivateContextButtonsHoverCommand = new RelayCommand(DeactivateContextButtonsHoverAction);
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace PowerLauncher.ViewModel
|
||||
public void SelectNextTabItem()
|
||||
{
|
||||
//Do nothing if there is no selected item or we've selected the next context button
|
||||
if(!SelectedItem?.SelectNextContextButton() ?? true)
|
||||
if (!SelectedItem?.SelectNextContextButton() ?? true)
|
||||
{
|
||||
SelectNextResult();
|
||||
}
|
||||
@@ -320,6 +320,6 @@ namespace PowerLauncher.ViewModel
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ namespace PowerLauncher.ViewModel
|
||||
#region about
|
||||
|
||||
public string ActivatedTimes => string.Format(CultureInfo.InvariantCulture, _translater.GetTranslation("about_activate_times"), Settings.ActivateTimes);
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user