本文整理汇总了C#中DeviceState.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# DeviceState.ToString方法的具体用法?C# DeviceState.ToString怎么用?C# DeviceState.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DeviceState
的用法示例。
在下文中一共展示了DeviceState.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: From
public static StateModel From(DeviceState state, DateTime changeDate, string macAddress, string comment)
{
return new StateModel()
{
State = state.ToString(),
ChangeDate = changeDate,
MacAddress = macAddress,
Comment = comment
};
}
示例2: State2Description
public static string State2Description(DeviceState ds)
{
switch (ds)
{
case DeviceState.UNKNOWN:
return XMLResourceLoaderUtils.GetString("NA");
case DeviceState.OK:
return XMLResourceLoaderUtils.GetString("READY");
case DeviceState.RING:
return XMLResourceLoaderUtils.GetString("RINGING");
case DeviceState.BUSY:
return XMLResourceLoaderUtils.GetString("BUSY");
case DeviceState.ERROR:
return XMLResourceLoaderUtils.GetString("ERROR");
}
return ds.ToString();
}
示例3: InitButtons
private void InitButtons(DeviceState state)
{
tsslStatus.Text = state.ToString();
switch (state)
{
case DeviceState.Opened:
tsbNew.Enabled = false;
tsbOpen.Enabled = false;
tsbRecord.Enabled = rp.CanRecord;
tsbRecordFrom.Enabled = rp.CanRecord;
tsbPlay.Enabled = true;
tsbPause.Enabled = false;
tsbStop.Enabled = false;
tsbForward.Enabled = true;
tsbBackward.Enabled = true;
tsbPlayFrom.Enabled = true;
tsbClose.Enabled = true;
Text = rp.FormatDetails.ToString();
cbPlayer.Enabled = true;
cbRecorder.Enabled = true;
nudBufferSizeInMs.Enabled = true;
break;
case DeviceState.Stopped:
tsbNew.Enabled = false;
tsbOpen.Enabled = false;
tsbRecord.Enabled = rp.CanRecord;
tsbRecordFrom.Enabled = rp.CanRecord;
tsbPlay.Enabled = true;
tsbPause.Enabled = false;
tsbStop.Enabled = false;
tsbForward.Enabled = true;
tsbBackward.Enabled = true;
tsbPlayFrom.Enabled = true;
tsbClose.Enabled = true;
cbPlayer.Enabled = true;
cbRecorder.Enabled = true;
nudBufferSizeInMs.Enabled = true;
break;
case DeviceState.Paused:
tsbNew.Enabled = false;
tsbOpen.Enabled = false;
tsbRecord.Enabled = rp.CanRecord;
tsbRecordFrom.Enabled = rp.CanRecord;
tsbPlay.Enabled = true;
tsbPause.Enabled = false;
tsbStop.Enabled = true;
tsbForward.Enabled = true;
tsbBackward.Enabled = true;
tsbPlayFrom.Enabled = true;
tsbClose.Enabled = false;
cbPlayer.Enabled = false;
cbRecorder.Enabled = false;
nudBufferSizeInMs.Enabled = true;
break;
case DeviceState.InProgress:
tsbNew.Enabled = false;
tsbOpen.Enabled = false;
tsbRecord.Enabled = false;
tsbRecordFrom.Enabled = false;
tsbPlay.Enabled = false;
tsbPause.Enabled = true;
tsbStop.Enabled = true;
tsbForward.Enabled = true;
tsbBackward.Enabled = true;
tsbPlayFrom.Enabled = true;
tsbClose.Enabled = false;
cbPlayer.Enabled = false;
cbRecorder.Enabled = false;
nudBufferSizeInMs.Enabled = false;
break;
case DeviceState.Closed:
default:
tsbNew.Enabled = true;
tsbOpen.Enabled = true;
tsbRecord.Enabled = false;
tsbRecordFrom.Enabled = false;
tsbPlay.Enabled = false;
tsbPause.Enabled = false;
tsbStop.Enabled = false;
tsbForward.Enabled = false;
tsbBackward.Enabled = false;
tsbPlayFrom.Enabled = false;
tsbClose.Enabled = false;
cbPlayer.Enabled = true;
cbRecorder.Enabled = true;
nudBufferSizeInMs.Enabled = true;
break;
}
}
示例4: From
internal static DeviceModel From(MacAddress macAddress, DeviceState state, DateTime lastRequestDate, string comment)
{
return new DeviceModel()
{
MacAddress = macAddress.ToString(),
State = state.ToString(),
LastRequestDate = lastRequestDate,
Comment = comment
};
}