mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-10 21:23:53 +00:00
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
namespace ElectronNET.Common
|
|
{
|
|
using System;
|
|
using System.Collections.Immutable;
|
|
using ElectronNET.Runtime.Data;
|
|
using ElectronNET.Runtime.Services;
|
|
|
|
public static class Extensions
|
|
{
|
|
public static bool IsUnpackaged(this StartupMethod method)
|
|
{
|
|
switch (method)
|
|
{
|
|
case StartupMethod.UnpackedElectronFirst:
|
|
case StartupMethod.UnpackedDotnetFirst:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool IsReady(this LifetimeServiceBase service)
|
|
{
|
|
return service != null && service.State == LifetimeState.Ready;
|
|
}
|
|
|
|
public static bool IsNotStopped(this LifetimeServiceBase service)
|
|
{
|
|
return service != null && service.State != LifetimeState.Stopped;
|
|
}
|
|
|
|
public static bool IsNullOrStopped(this LifetimeServiceBase service)
|
|
{
|
|
return service == null || service.State == LifetimeState.Stopped;
|
|
}
|
|
}
|
|
}
|