-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathIServiceControl.cs
39 lines (32 loc) · 1005 Bytes
/
IServiceControl.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DigitalPlatform.Interfaces
{
/// <summary>
/// 控制 Windows Service 模块的命令接口
/// </summary>
public interface IServiceControl
{
// 启动一个 Instance
ServiceControlResult StartInstance(string strInstanceName);
// 停止一个 Instance
ServiceControlResult StopInstance(string strInstanceName, bool delete);
// 获得一个 Instance 的信息
ServiceControlResult GetInstanceInfo(string strInstanceName, out InstanceInfo info);
}
[Serializable()]
public class ServiceControlResult
{
public string ErrorInfo { get; set; }
public int Value { get; set; }
public string ErrorCode { get; set; }
}
[Serializable()]
public class InstanceInfo
{
public string InstanceName { get; set; }
public string State { get; set; } // running / stopped
}
}