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


C# DBElement.showChildren方法代码示例

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


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

示例1: ImmutableCloneDb

 /// <summary>
 /// Immutable clone db constructed here 
 /// </summary>
 /// <param name="msg"></param>
 /// <param name="msgid"></param>
 /// <param name="value"></param>
 /// <param name="lstChi"></param>
 private void ImmutableCloneDb(string msg, out string msgid, out string value, out List<int> lstChi)
 {
     Write("\n    Creation of immutable database from query");
     WriteLine();
     bool status = false; value = "";
     DBElement<string, string> elem = new DBElement<string, string>();
     XDocument doc = XDocument.Load(new StringReader(msg));
     msgid = doc.Descendants("MessageID").Select(i => i).Single().Value;
     int key = int.Parse(doc.Descendants("Key").Select(i => i).Single().Value);
     WriteLine("..Creation of new immutable Database from compound queries..\n");
     WriteLine("..First we will retrieve the results from the main DB..\n");
     DBElement<int, string> elem1 = new DBElement<int, string>();
     WriteLine("\n\n..Getting the children of specific key..\n");
     status = query.getChildren(db, key, out elem1);      //get the children based on the key provided
     DBFactoryGen<int, string> el = new DBFactoryGen<int, string>();
     WriteLine("\n..Children with Key {0} successfully retrieved..\n", key);
     WriteLine("  Key : {0}", key);
     elem1.showChildren();       //show the child elements
     lstChi = new List<int>();
     WriteLine("\n..We will store the same in a immutable DB..\n");
     if (elem1 != null && elem1.children != null)
     {
         foreach (var i in elem1.children)
         {
             lstChi.Add(i);
         }
     }
 }
开发者ID:darshanmp,项目名称:Remote-NoSQL-DB,代码行数:35,代码来源:RequestHandler.cs

示例2: GetChildren

 /// <summary>
 /// Get by GetChildren results are handled here and query constructed
 /// </summary>
 /// <param name="status"></param>
 /// <param name="doc"></param>
 /// <param name="key"></param>
 /// <param name="elem"></param>
 private void GetChildren(out bool status, ref XDocument doc, out int key, out DBElement<int, string> elem)
 {
     sb = new StringBuilder();
     key = int.Parse(doc.Descendants("Key").Select(i => i).Single().Value);
     WriteLine("\n\n..Getting the children of specific key..\n");
     status = query.getChildren(db, key, out elem);
     WriteLine("\nChildren for Key:{0} are\n",key);
     sb.Append(elem.showChildren());
     sb.AppendLine();
     doc.Descendants("Response").Select(i => i).Single().Value = sb.ToString();
     elem.showChildren();
 }
开发者ID:darshanmp,项目名称:Remote-NoSQL-DB,代码行数:19,代码来源:RequestHandler.cs


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