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


C# JsonArray.Insert方法代码示例

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


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

示例1: SaveClassInfo

        void SaveClassInfo(DocComment dc, CorePlus.Json.JsonObject obj)
        {
            string fullName = dc.FullName;
            obj.Add("fullName",fullName);
            obj.Add("source", dc.Source);

            if(dc.Source != null) {
                obj.Add("sourceFile", "data/source/" + dc.Source + ".html#" + fullName.Replace('.', '-'));
            }

            SortedList<string, DocComment> members = new SortedList<string,DocComment>();
            SortedList<string, DocComment> statics = new SortedList<string, DocComment>();

            if (dc.MemberType == "class" && dc.Variant.Members != null) {
                GetMembersAndCopyToTmpList(dc.Variant.Members, members, statics);
            }

            // 如果有成员。生成成员字段。
            if(dc.Variant.Count > 0) {
                GetMembersAndCopyToTmpList(dc.Variant, members, statics);
            }

            if (_project.DefaultExtends != null && dc.MemberType == "class") {

                DocComment dc2 ;

                if (_data.DocComments.TryGetValue(_project.DefaultExtends, out dc2) && dc2.Variant != null) {

                    GetMembersAndCopyToTmpList(dc2.Variant, members, statics);
                }

            }

            DocComment e;
            if(dc.Extends != null && _data.DocComments.TryGetValue(dc.Extends, out e)) {
                string extends = dc.Extends;
                if (e.Variant.Members != null) {
                    GetMembersAndCopyToTmpList(e.Variant.Members, members, statics);
                }

                JsonArray baseClasses = new JsonArray();

                obj["baseClasses"] = baseClasses;
                while (extends != null && _data.DocComments.TryGetValue(extends, out e)) {
                    baseClasses.Insert(0, extends);

                    extends = e.Extends;
                }
            }

            if(dc.Implements != null) {
                foreach(string im in dc.Implements) {
                    if(_data.DocComments.TryGetValue(im, out e))
                        GetMembersAndCopyToTmpList(e.Variant, members, members);
                }
            }

            string memberOf = dc.FullName;
            SaveTmpList(members, obj, memberOf, false);
            SaveTmpList(statics, obj, memberOf, true);

            if(_extendsInfo.ContainsKey(fullName)) {

                JsonArray subClasses = new JsonArray();

                obj["subClasses"] = subClasses;
                var list = _extendsInfo[fullName];
                list.Sort();
                subClasses.AddRange(list);
            }

            foreach(string key in dc){
                AddSingle(obj, key, dc[key]);
            }
        }
开发者ID:xuld,项目名称:DocPlus,代码行数:75,代码来源:DocGenerator.cs


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