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


C# Match.ReadGroupValue方法代码示例

本文整理汇总了C#中System.Text.RegularExpressions.Match.ReadGroupValue方法的典型用法代码示例。如果您正苦于以下问题:C# Match.ReadGroupValue方法的具体用法?C# Match.ReadGroupValue怎么用?C# Match.ReadGroupValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Text.RegularExpressions.Match的用法示例。


在下文中一共展示了Match.ReadGroupValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Build

        public IResponse Build(Match match)
        {
            Status status = match.ReadGroupAs<Status>(StatusGroup, value => (Status)Enum.Parse(typeof(Status), value, true));
            string firmware = match.ReadGroupValue(FirmwareGroup);
            string version = match.ReadGroupValue(VersionGroup);
            string build = match.ReadGroupValue(BuildGroup);

            return new Command.Response.Version(status, firmware, version, build);
        }
开发者ID:jamesleech,项目名称:Harmonize,代码行数:9,代码来源:VersionResponse.cs

示例2: Build

        public IResponse Build(Match match)
        {
            Status status = match.ReadGroupAs<Status>(StatusGroup, value => (Status)Enum.Parse(typeof(Status), value, true));
            int index = match.ReadGroupAs<int>(IndexGroup, Int32.Parse);
            string deviceAddress = match.ReadGroupValue(DeviceAddressGroup);
            string deviceType = match.ReadGroupValue(DeviceTypeGroup);
            int secondsSinceListPacketReceived = match.ReadGroupAs<int>(SecondsSinceLastPacketReceivedGroup, Int32.Parse);
            string deviceState = match.ReadGroupValue(DeviceStateGroup);
            Values.SignalStrength signalStrength = match.ReadGroupAs<Values.SignalStrength>(SignalStrengthGroup, Values.SignalStrength.Parse);
            Values.LinkQuality linkQuality = match.ReadGroupAs<Values.LinkQuality>(LinkQualityGroup, Values.LinkQuality.Parse);
            Values.BatteryState batteryState = match.ReadGroupAs<Values.BatteryState>(BatteryStateGroup, Values.BatteryState.Parse);
            int receivedPackets = match.ReadGroupAs<int>(ReceivedPacketsGroup, Int32.Parse);
            int sentPackets = match.ReadGroupAs<int>(SentPacketsGroup, Int32.Parse);
            string unknown1 = match.ReadGroupValue(Unknown1Group);
            string unknown2 = match.ReadGroupValue(Unknown2Group);
            string unknown3 = match.ReadGroupValue(Unknown3Group);
            string unknown4 = match.ReadGroupValue(Unknown4Group);
            string unknown5 = match.ReadGroupValue(Unknown5Group);
            string unknown6 = match.ReadGroupValue(Unknown6Group);

            return new Command.Response.Device(status, index, deviceAddress, deviceType, deviceState, signalStrength, linkQuality, batteryState, TimeSpan.FromSeconds(secondsSinceListPacketReceived), receivedPackets, sentPackets, unknown1, unknown2, unknown3, unknown4, unknown5, unknown6);
        }
开发者ID:ibebbs,项目名称:OneCog.Io.Owl.Intuition,代码行数:22,代码来源:DeviceResponse.cs


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