本文整理汇总了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]);
}
}