本文整理匯總了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;
}
//.........這裏部分代碼省略.........