本文整理汇总了C#中Entry.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Entry.Clone方法的具体用法?C# Entry.Clone怎么用?C# Entry.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entry
的用法示例。
在下文中一共展示了Entry.Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnModifyEntry
public void OnModifyEntry(Entry ent, TreeNodeAdv node)
{
ModifyEntryDialog diag = new ModifyEntryDialog();
if (ent != null)
diag.Edited = ent.Clone();
diag.ShowDialog();
if (diag.Confirmed)
{
TreePath path = node.Tree.GetPath(node);
SectionEntry parent = (SectionEntry)node.Parent.Tag;
int nodeIndex = node.Index;
if (ent != null)
{//if the entry is different, we need to remove the old one
parent.Entries.Remove(ent);
this.NodesRemoved(this, new TreeModelEventArgs(path.Up(), new int[] { node.Index }, new object[] { ent }));
}
if (diag.Edited != null)
{//if the new entry exists (this was not just a deletion), we need to add it to the tree
parent.Entries.Insert(nodeIndex, diag.Edited);
diag.Edited.Parent = parent;
this.NodesInserted(this, new TreeModelEventArgs(path.Up(), new int[] { nodeIndex }, new object[] { diag.Edited }));
}
}
}