whitespace forced changes (#6002)

This commit is contained in:
Clint Rutkas
2020-08-17 10:00:56 -07:00
committed by GitHub
parent 649e7e103d
commit d055ba1c3b
129 changed files with 14175 additions and 14175 deletions

View File

@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using System.Linq;
using Microsoft.Plugin.WindowWalker.Components;
@@ -12,9 +12,9 @@ namespace Microsoft.Plugin.WindowWalker
public class Main : IPlugin, IPluginI18n
{
private static List<SearchResult> _results = new List<SearchResult>();
private string IconPath { get; set; }
private PluginInitContext Context { get; set; }
static Main()
@@ -24,45 +24,45 @@ namespace Microsoft.Plugin.WindowWalker
}
public List<Result> Query(Query query)
{
SearchController.Instance.UpdateSearchText(query.RawQuery).Wait();
{
SearchController.Instance.UpdateSearchText(query.RawQuery).Wait();
OpenWindows.Instance.UpdateOpenWindowsList();
return _results.Select(x => new Result()
{
Title = x.Result.Title,
IcoPath = IconPath,
SubTitle = "Running: " + x.Result.ProcessName,
Action = c =>
{
x.Result.SwitchToWindow();
return true;
Action = c =>
{
x.Result.SwitchToWindow();
return true;
},
}).ToList();
}
public void Init(PluginInitContext context)
{
Context = context;
Context.API.ThemeChanged += OnThemeChanged;
UpdateIconPath(Context.API.GetCurrentTheme());
}
// Todo : Update with theme based IconPath
private void UpdateIconPath(Theme theme)
{
if (theme == Theme.Light || theme == Theme.HighContrastWhite)
{
IconPath = "Images/windowwalker.light.png";
}
else
{
IconPath = "Images/windowwalker.dark.png";
}
}
private void OnThemeChanged(Theme currentTheme, Theme newTheme)
{
UpdateIconPath(newTheme);
Context = context;
Context.API.ThemeChanged += OnThemeChanged;
UpdateIconPath(Context.API.GetCurrentTheme());
}
// Todo : Update with theme based IconPath
private void UpdateIconPath(Theme theme)
{
if (theme == Theme.Light || theme == Theme.HighContrastWhite)
{
IconPath = "Images/windowwalker.light.png";
}
else
{
IconPath = "Images/windowwalker.dark.png";
}
}
private void OnThemeChanged(Theme currentTheme, Theme newTheme)
{
UpdateIconPath(newTheme);
}
public string GetTranslatedPluginTitle()
@@ -75,9 +75,9 @@ namespace Microsoft.Plugin.WindowWalker
return Context.API.GetTranslation("wox_plugin_windowwalker_plugin_description");
}
private static void SearchResultUpdated(object sender, SearchController.SearchResultUpdateEventArgs e)
{
_results = SearchController.Instance.SearchMatches;
private static void SearchResultUpdated(object sender, SearchController.SearchResultUpdateEventArgs e)
{
_results = SearchController.Instance.SearchMatches;
}
}
}