本文整理汇总了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);
}
示例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);
}