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


C# JsonTextReader.ReadInt32方法代碼示例

本文整理匯總了C#中Newtonsoft.Json.JsonTextReader.ReadInt32方法的典型用法代碼示例。如果您正苦於以下問題:C# JsonTextReader.ReadInt32方法的具體用法?C# JsonTextReader.ReadInt32怎麽用?C# JsonTextReader.ReadInt32使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Newtonsoft.Json.JsonTextReader的用法示例。


在下文中一共展示了JsonTextReader.ReadInt32方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Parse

        public void Parse()
        {
            if (_IsParsed) return;

            var json = Encoding.UTF8.GetString(this.data);
            using (var strReader = new System.IO.StringReader(json)) {
                using (var r = new JsonTextReader(strReader)) {
                    while (r.Read()) {
                        if (r.TokenType == JsonToken.PropertyName) {
                            switch (r.Value.ToString()) {
                                #region Boolean
                                case "OnlyOne":
                                    _OnlyOne = r.ReadInt32() != 0;
                                    break;
                                case "DisablePassedOthers":
                                    _DisablePassedOthers = r.ReadInt32() != 0;
                                    break;
                                case "Crest":
                                    _Crest = r.ReadInt32() != 0;
                                    break;
                                #endregion

                                #region Int64[]
                                case "bnpc":
                                    _BNpcs = r.ReadInt64Array();
                                    break;
                                #endregion

                                #region Int32[]
                                case "shopnpc":
                                    _ShopENpcs = r.ReadInt32Array();
                                    break;
                                case "instance_content":
                                    _InstanceContents = r.ReadInt32Array();
                                    break;
                                case "recipe":
                                    _Recipes = r.ReadInt32Array();
                                    break;
                                case "quest":
                                    _Quests = r.ReadInt32Array();
                                    break;
                                case "classjob":
                                    _ClassJobs = r.ReadInt32Array();
                                    break;
                                case "achievement":
                                    _Achievements = r.ReadInt32Array();
                                    break;
                                #endregion

                                #region Int32
                                case "sell_price":
                                    _SellPrice = r.ReadInt32();
                                    break;
                                case "Repair":
                                    _RepairClassJob = r.ReadInt32();
                                    break;
                                case "RepairItem":
                                    _RepairItem = r.ReadInt32();
                                    break;
                                case "repair_price":
                                    _RepairPrice = r.ReadInt32();
                                    break;
                                case "MateriaSocket":
                                    _MateriaSocket = r.ReadInt32();
                                    break;
                                case "MaterializeType":
                                    _MaterializeType = r.ReadInt32();
                                    break;
                                case "Stain":
                                    _Stain = r.ReadInt32();
                                    break;
                                case "CondClassJob":
                                    _CondClassJob = r.ReadInt32();
                                    break;
                                case "Series":
                                    _Series = r.ReadInt32();
                                    break;
                                case "RecastTime":
                                    _RecastTime = r.ReadInt32();
                                    break;
                                #endregion

                                #region Obj
                                case "basic_param":
                                    _BasicParams = ParseBasicParam(r);
                                    break;
                                case "basic_param_hq":
                                    _BasicParamsHq = ParseBasicParam(r);
                                    break;
                                case "action":
                                    _Actions = ParseActions(r);
                                    break;
                                case "action_hq":
                                    _ActionsHq = ParseActions(r);
                                    break;
                                case "bonus":
                                    _Bonuses = ParseBonuses(r);
                                    break;
                                case "bonus_hq":
                                    _BonusesHq = ParseBonuses(r);
//.........這裏部分代碼省略.........
開發者ID:KevinAllenWiegand,項目名稱:SaintCoinach,代碼行數:101,代碼來源:Item.Parse.cs


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