当前位置: 首页>>代码示例>>C#>>正文


C# JsonReader.SkipArray方法代码示例

本文整理汇总了C#中LitJson.JsonReader.SkipArray方法的典型用法代码示例。如果您正苦于以下问题:C# JsonReader.SkipArray方法的具体用法?C# JsonReader.SkipArray怎么用?C# JsonReader.SkipArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LitJson.JsonReader的用法示例。


在下文中一共展示了JsonReader.SkipArray方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildModel

 private void BuildModel(JsonReader reader)
 {
     // root/
     string prop = null;
     while (reader.Read())
     {
         if (reader.Token == JsonToken.ObjectEnd) break;
         if (reader.Token == JsonToken.PropertyName) prop = reader.Value.ToString();
         else if (reader.Token == JsonToken.ObjectStart)
         {
             reader.SkipObject();
         }
         else if (reader.Token == JsonToken.ArrayStart)
         {
             if (prop == "modules") ReadModules(reader);
             else reader.SkipArray();
         }
     }
 }
开发者ID:Neverbirth,项目名称:flashdevelop,代码行数:19,代码来源:LibParser.cs

示例2: ReadMetas

 private void ReadMetas(JsonReader reader, MemberModel member)
 {
     reader.SkipArray();
 }
开发者ID:Neverbirth,项目名称:flashdevelop,代码行数:4,代码来源:LibParser.cs

示例3: ReadProperty

        private void ReadProperty(JsonReader reader, ClassModel cClass)
        {
            MemberModel member = new MemberModel();
            member.Flags = FlagType.Variable;

            MemberModel getter = null;
            MemberModel setter = null;
            string prop = null;
            string name = null;
            string doc = null;
            while (reader.Read())
            {
                if (reader.Token == JsonToken.ObjectEnd) break;
                if (reader.Token == JsonToken.PropertyName) prop = reader.Value.ToString();
                else if (reader.Token == JsonToken.String)
                {
                    string val = reader.Value.ToString();
                    switch (prop)
                    {
                        case "name": name = val; break;
                        case "docstring": doc = ExtractDoc(val); break;
                    }
                }
                else if (reader.Token == JsonToken.ArrayStart)
                {
                    switch (prop)
                    {
                        //case "propertyattributes": ReadAttributes(reader, member); break;
                        //case "metainfo": reader.SkipArray(); break;
                        default: reader.SkipArray(); break;
                    }
                }
                else if (reader.Token == JsonToken.ObjectStart)
                {
                    switch (prop)
                    {
                        case "getter": 
                            getter = ReadMethod(reader, cClass);
                            getter.Flags |= FlagType.Getter;
                            break;
                        case "setter":
                            setter = ReadMethod(reader, cClass);
                            setter.Flags |= FlagType.Setter;
                            break;
                        default: reader.SkipObject(); break;
                    }
                }
            }
            if (getter != null)
            {
                getter.Name = name;
                getter.Comments = doc;
                getter.Flags &= ~FlagType.Function;
            }
            if (setter != null)
            {
                setter.Name = name;
                if (getter == null) setter.Comments = doc;
                setter.Flags &= ~FlagType.Function;
            }
        }
开发者ID:Neverbirth,项目名称:flashdevelop,代码行数:61,代码来源:LibParser.cs

示例4: ReadTemplateTypes

 private void ReadTemplateTypes(JsonReader reader, MemberModel member)
 {
     string prop = null;
     List<string> names = null;
     while (reader.Read())
     {
         if (reader.Token == JsonToken.ObjectEnd) break;
         if (reader.Token == JsonToken.PropertyName) prop = reader.Value.ToString();
         else if (reader.Token == JsonToken.String)
         {
             string val = reader.Value.ToString();
             switch (prop)
             {
                 case "type": member.Type = CleanType(val); break;
             }
         }
         else if (reader.Token == JsonToken.ArrayStart)
         {
             switch (prop)
             {
                 case "types": names = ReadNames(reader); break;
                 default: reader.SkipArray(); break;
             }
         }
     }
     if (names != null) 
         member.Type += ".<" + String.Join(",", names.ToArray()) + ">";
 }
开发者ID:Neverbirth,项目名称:flashdevelop,代码行数:28,代码来源:LibParser.cs

示例5: ReadMethod

        private MemberModel ReadMethod(JsonReader reader, ClassModel cClass)
        {
            MemberModel member = new MemberModel();
            member.Flags = FlagType.Function;

            string prop = null;
            while (reader.Read())
            {
                if (reader.Token == JsonToken.ObjectEnd) break;
                if (reader.Token == JsonToken.PropertyName) prop = reader.Value.ToString();
                else if (reader.Token == JsonToken.String)
                {
                    string val = reader.Value.ToString();
                    switch (prop)
                    {
                        case "name": 
                            if (!val.StartsWith("__op_")) {
                                member.Name = val; 
                                cClass.Members.Add(member); 
                            }
                            break;
                        case "returntype": if (member.Type == null) member.Type = CleanType(val); break;
                        case "docstring": member.Comments = ExtractDoc(val); break;
                    }
                }
                else if (reader.Token == JsonToken.ArrayStart)
                {
                    switch (prop)
                    {
                        case "methodattributes": 
                            ReadAttributes(reader, member); 
                            if ((member.Flags & FlagType.Static) == 0) member.Flags |= FlagType.Dynamic;
                            break;
                        case "parameters": ReadParameters(reader, member); break;
                        case "metainfo": ReadMetas(reader, member); break;
                        default: reader.SkipArray(); break;
                    }
                }
                else if (reader.Token == JsonToken.ObjectStart)
                {
                    switch (prop)
                    {
                        case "templatetypes": ReadTemplateTypes(reader, member); break;
                        default: reader.SkipObject(); break;
                    }
                }
            }
            return member;
        }
开发者ID:Neverbirth,项目名称:flashdevelop,代码行数:49,代码来源:LibParser.cs

示例6: ReadType

        private void ReadType(JsonReader reader)
        {
            // root/modules/types
            FileModel cFile;
            ClassModel cClass;
            cFile = new FileModel();
            cFile.HasPackage = true;
            cFile.Version = 3;
            cFile.Context = context;
            cClass = new ClassModel();
            cClass.Flags = FlagType.Class;
            MemberModel cDelegate = new MemberModel();
            List<string> names;

            string prop = null;
            while (reader.Read())
            {
                if (reader.Token == JsonToken.ObjectEnd) break;
                if (reader.Token == JsonToken.PropertyName) prop = reader.Value.ToString();
                else if (reader.Token == JsonToken.String)
                {
                    string val = reader.Value.ToString();
                    switch (prop)
                    {
                        case "name": cClass.Name = val; break;
                        case "source":
                            if (val.IndexOf('/') > 0) val = val.Substring(val.IndexOf('/') + 1);
                            cFile.FileName = path.Path + "::" + val;
                            break;
                        case "package":
                            if (val.ToLower() == "cocos2d") val = "cocos2d"; // random casing through source
                            cFile.Package = val; 
                            break;
                        case "baseType": cClass.ExtendsType = val; break;
                        case "delegateReturnType": cDelegate.Type = CleanType(val); break;
                        case "type":
                            switch (val)
                            {
                                case "CLASS": break;
                                case "INTERFACE": cClass.Flags |= FlagType.Interface; break;
                                case "STRUCT": cClass.Flags |= FlagType.Struct; break;
                                case "DELEGATE": cDelegate.Name = cClass.Name; break;
                            }
                            break;
                        case "docstring": cClass.Comments = ExtractDoc(val); break;
                    }
                }
                else if (reader.Token == JsonToken.ArrayStart)
                {
                    switch (prop)
                    {
                        case "classattributes": ReadAttributes(reader, cClass); break;
                        case "fields": ReadFields(reader, cClass); break;
                        case "methods": ReadMethods(reader, cClass); break;
                        case "properties": ReadProperties(reader, cClass); break;
                        case "metainfo": ReadMetas(reader, cClass); break;
                        case "imports": 
                            names = ReadNames(reader);
                            foreach (string name in names)
                                cFile.Imports.Add(new MemberModel(name, name, FlagType.Import, Visibility.Public)); 
                            break;
                        case "interfaces": ReadInterfaces(reader, cClass); break;
                        case "delegateTypes":
                            names = ReadNames(reader);
                            if (names.Count > 0)
                            {
                                cDelegate.Parameters = new List<MemberModel>();
                                foreach (string argType in names)
                                {
                                    cDelegate.Parameters.Add(
                                        new MemberModel("p" + cDelegate.Parameters.Count, argType, FlagType.ParameterVar, Visibility.Public));
                                }
                            }
                            break;
                        default: reader.SkipArray(); break;
                    }
                }
                else if (reader.Token == JsonToken.ObjectStart)
                {
                    switch (prop)
                    {
                        case "constructor": 
                            MemberModel ctor = ReadMethod(reader, cClass);
                            cClass.Constructor = ctor.Name;
                            break;
                        default: reader.SkipObject(); break;
                    }
                }
            }

            if (cFile.FileName == null) return;
            string key = cFile.FileName.ToUpper();
            if (files.ContainsKey(key)) cFile = files[key];
            else files.Add(key, cFile);

            if (cFile.Package.ToLower() == "system") // System classes tweaks
            {
                cFile.Package = "";
                if (cClass.Name == "Vector") cClass.Name = "Vector.<T>";
                if (cClass.Name == "Object") cClass.ExtendsType = "void";
//.........这里部分代码省略.........
开发者ID:Neverbirth,项目名称:flashdevelop,代码行数:101,代码来源:LibParser.cs

示例7: ReadDefaults

 private static string ReadDefaults(JsonReader reader)
 {
     string prop = null;
     while (reader.Read())
     {
         if (reader.Token == JsonToken.ObjectEnd) break;
         if (reader.Token == JsonToken.PropertyName) prop = reader.Value.ToString();
         else if (reader.Token == JsonToken.String)
         {
             string val = reader.Value.ToString();
             switch (prop)
             {
                 case "last_latest": return val; 
             }
         }
         else if (reader.Token == JsonToken.ObjectStart)
         {
             if (prop == "display") ReadDisplay(reader);
             else reader.SkipObject();
         }
         else if (reader.Token == JsonToken.ArrayStart)
         {
             reader.SkipArray();
         }
     }
     return "";
 }
开发者ID:ImaginationSydney,项目名称:flashdevelop,代码行数:27,代码来源:LoomHelper.cs

示例8: ReadDisplay

 private static void ReadDisplay(JsonReader reader)
 {
     string prop = null;
     while (reader.Read())
     {
         if (reader.Token == JsonToken.ObjectEnd) break;
         if (reader.Token == JsonToken.PropertyName) prop = reader.Value.ToString();
         else if (reader.Token == JsonToken.String)
         {
             string val = reader.Value.ToString();
             switch (prop)
             {
                 case "width": int.TryParse(val, out proj.MovieOptions.Width); break;
                 case "height": int.TryParse(val, out proj.MovieOptions.Height); break;
             }
         }
         else if (reader.Token == JsonToken.ObjectStart)
         {
             reader.SkipObject();
         }
         else if (reader.Token == JsonToken.ArrayStart)
         {
             reader.SkipArray();
         }
     }
 }
开发者ID:ImaginationSydney,项目名称:flashdevelop,代码行数:26,代码来源:LoomHelper.cs

示例9: ReadConfig

 private static void ReadConfig(JsonReader reader)
 {
     string prop = null;
     while (reader.Read())
     {
         if (reader.Token == JsonToken.ObjectEnd) break;
         if (reader.Token == JsonToken.PropertyName) prop = reader.Value.ToString();
         else if (reader.Token == JsonToken.String)
         {
             string val = reader.Value.ToString();
             switch (prop)
             {
                 case "sdk_version":
                     if (val == "latest") val = GetLatestSDK();
                     proj.PreferredSDK = val + ";;"; break;
             }
         }
         else if (reader.Token == JsonToken.ObjectStart)
         {
             if (prop == "display") ReadDisplay(reader);
             else reader.SkipObject();
         }
         else if (reader.Token == JsonToken.ArrayStart)
         {
             reader.SkipArray();
         }
     }
 }
开发者ID:ImaginationSydney,项目名称:flashdevelop,代码行数:28,代码来源:LoomHelper.cs


注:本文中的LitJson.JsonReader.SkipArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。