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