[PT Run] Service Plugin (#8076)

* PT Run service plugin

* icon, localization and fixes

* basic toast notification

* service start mode

* improved keys

* fixed setup

* improvements

* added _ keyword
* better shortcuts
* action for open services.msc

* pt run service plugin dll signing

* renamed Microsoft.Plugin.Service

* changed output dir

* set ! action keyword

* launcher dll

Co-authored-by: Clint Rutkas <clint@rutkas.com>
This commit is contained in:
Davide Giacometti
2021-01-06 11:40:07 +01:00
committed by GitHub
parent f0600f1725
commit 3a87c4909c
18 changed files with 1071 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation
// 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.
@@ -9,9 +9,11 @@ using System.Net;
using System.Windows;
using ManagedCommon;
using Microsoft.PowerToys.Common.UI;
using Microsoft.Toolkit.Uwp.Notifications;
using PowerLauncher.Helper;
using PowerLauncher.Plugin;
using PowerLauncher.ViewModel;
using Windows.UI.Notifications;
using Wox.Infrastructure.Image;
using Wox.Plugin;
@@ -33,6 +35,9 @@ namespace Wox
_themeManager = themeManager ?? throw new ArgumentNullException(nameof(themeManager));
_themeManager.ThemeChanged += OnThemeChanged;
WebRequest.RegisterPrefix("data", new DataWebRequestFactory());
DesktopNotificationManagerCompat.RegisterActivator<LauncherNotificationActivator>();
DesktopNotificationManagerCompat.RegisterAumidAndComServer<LauncherNotificationActivator>("PowerToysRun");
}
public void ChangeQuery(string query, bool requery = false)
@@ -79,6 +84,18 @@ namespace Wox
});
}
public void ShowNotification(string text)
{
Application.Current.Dispatcher.Invoke(() =>
{
ToastContent toastContent = new ToastContentBuilder()
.AddText(text)
.GetToastContent();
var toast = new ToastNotification(toastContent.GetXml());
DesktopNotificationManagerCompat.CreateToastNotifier().Show(toast);
});
}
public void InstallPlugin(string path)
{
Application.Current.Dispatcher.Invoke(() => PluginManager.InstallPlugin(path));