本文整理汇总了C#中ProtoBuf.ProtoReader.ThrowEnumException方法的典型用法代码示例。如果您正苦于以下问题:C# ProtoReader.ThrowEnumException方法的具体用法?C# ProtoReader.ThrowEnumException怎么用?C# ProtoReader.ThrowEnumException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProtoBuf.ProtoReader
的用法示例。
在下文中一共展示了ProtoReader.ThrowEnumException方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
/// <summary>
/// The read.
/// </summary>
/// <param name="targetPlatform">
/// The target platform.
/// </param>
/// <param name="protoReader">
/// The proto reader.
/// </param>
/// <returns>
/// The <see cref="TargetPlatform"/>.
/// </returns>
private static TargetPlatform Read(TargetPlatform targetPlatform, ProtoReader protoReader)
{
int num = protoReader.ReadInt32();
var result = TargetPlatform.Windows;
if (num != 0)
{
if (num != 1)
{
if (num != 2)
{
if (num != 3)
{
if (num != 4)
{
if (num != 5)
{
if (num != 6)
{
if (num != 7)
{
if (num != 8)
{
if (num != 9)
{
if (num != 10)
{
if (num != 11)
{
if (num != 12)
{
protoReader.ThrowEnumException(
typeof(TargetPlatform),
num);
}
else
{
result = TargetPlatform.RaspberryPi;
}
}
else
{
result = TargetPlatform.WindowsPhone8;
}
}
else
{
result = TargetPlatform.PlayStationMobile;
}
}
else
{
result = TargetPlatform.Ouya;
}
}
else
{
result = TargetPlatform.NativeClient;
}
}
else
{
result = TargetPlatform.WindowsStoreApp;
}
}
else
{
result = TargetPlatform.MacOSX;
}
}
else
{
result = TargetPlatform.Linux;
}
}
else
{
result = TargetPlatform.Android;
}
}
else
{
result = TargetPlatform.iOS;
}
}
else
{
result = TargetPlatform.WindowsPhone;
}
//.........这里部分代码省略.........