本文整理汇总了C#中DBElement.editElementData方法的典型用法代码示例。如果您正苦于以下问题:C# DBElement.editElementData方法的具体用法?C# DBElement.editElementData怎么用?C# DBElement.editElementData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBElement
的用法示例。
在下文中一共展示了DBElement.editElementData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: edit_element
private void edit_element(out string str, ref IEnumerator<string> msg_enumerator, DBEngine<int, DBElement<int, string>> db, string edit_action)
{
int key1 = 0;
string name = "", descr = "", payload = null;
DateTime timestamp = new DateTime();
List<int> childList = new List<int>();
while (msg_enumerator.MoveNext())
{
switch (msg_enumerator.Current)
{
case "key":
msg_enumerator.MoveNext();
key1 = int.Parse(msg_enumerator.Current);
break;
case "name":
msg_enumerator.MoveNext();
name = msg_enumerator.Current;
break;
case "descr":
msg_enumerator.MoveNext();
descr = msg_enumerator.Current;
break;
case "timestamp":
msg_enumerator.MoveNext();
timestamp = DateTime.Parse(msg_enumerator.Current.ToString());
break;
case "children":
msg_enumerator.MoveNext();
int childcount = int.Parse(msg_enumerator.Current);
while (childcount-- > 0)
{
msg_enumerator.MoveNext();
childList.Add(int.Parse(msg_enumerator.Current));
}
break;
case "payload":
msg_enumerator.MoveNext();
int payloadcount = int.Parse(msg_enumerator.Current);
payload = addPayload(ref msg_enumerator);
break;
}
}
DBElement<int, string> element = new DBElement<int, string>();
if (db.getValue(key1, out element))
{
element.editElementData(timestamp, payload, name, descr, edit_action, childList);
str = "element at key: " + key1 + " has been edited\n";
}
else
str = "element not found in database\n";
}