当前位置: 首页>>代码示例>>C#>>正文


C# DeviceState.ToString方法代码示例

本文整理汇总了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
     };
 }
开发者ID:hendrikdelarey,项目名称:appcampus,代码行数:10,代码来源:StateResponseModel.cs

示例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();
        }
开发者ID:belsoft,项目名称:traingraph,代码行数:21,代码来源:IconElement.cs

示例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;
     }
 }
开发者ID:MatejS86,项目名称:Praktikum,代码行数:89,代码来源:MainForm.cs

示例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
     };
 }
开发者ID:hendrikdelarey,项目名称:appcampus,代码行数:10,代码来源:DeviceModel.cs


注:本文中的DeviceState.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。