private void OnStateChanging(ChannelServiceStateOptions state) { if (this.StateChanging != null) { this.StateChanging(state); } }
/// <summary> /// 获取通道服务运行状态的文字说明。 /// </summary> /// <param name="channelServiceState">通道服务状态</param> /// <returns>通道服务运行状态的文字说明</returns> public static string GetDescription(this ChannelServiceStateOptions channelServiceState) { switch (channelServiceState) { case ChannelServiceStateOptions.Ready: return("就绪"); case ChannelServiceStateOptions.Running: return("运行"); case ChannelServiceStateOptions.Stopped: return("停止"); case ChannelServiceStateOptions.Exception: return("故障"); default: throw new NotImplementedException("尚未实现该枚举。"); } }