mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
[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:
committed by
GitHub
parent
f0600f1725
commit
3a87c4909c
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user