當前位置: 首頁>>代碼示例>>C#>>正文


C# ProtoReader.ThrowEnumException方法代碼示例

本文整理匯總了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;
                    }
//.........這裏部分代碼省略.........
開發者ID:RedpointGames,項目名稱:Protogame,代碼行數:101,代碼來源:CompiledAssetSerializer.cs


注:本文中的ProtoBuf.ProtoReader.ThrowEnumException方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。