mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +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
@@ -0,0 +1,33 @@
|
||||
// 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;
|
||||
using System.ServiceProcess;
|
||||
|
||||
namespace Microsoft.PowerToys.Run.Plugin.Service
|
||||
{
|
||||
public class ServiceResult
|
||||
{
|
||||
public string ServiceName { get; }
|
||||
|
||||
public string DisplayName { get; }
|
||||
|
||||
public ServiceStartMode StartMode { get; }
|
||||
|
||||
public bool IsRunning { get; }
|
||||
|
||||
public ServiceResult(ServiceController serviceController)
|
||||
{
|
||||
if (serviceController == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(serviceController));
|
||||
}
|
||||
|
||||
ServiceName = serviceController.ServiceName;
|
||||
DisplayName = serviceController.DisplayName;
|
||||
StartMode = serviceController.StartType;
|
||||
IsRunning = serviceController.Status != ServiceControllerStatus.Stopped && serviceController.Status != ServiceControllerStatus.StopPending;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user