本文整理汇总了C#中TreeNode.SetTagValue方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.SetTagValue方法的具体用法?C# TreeNode.SetTagValue怎么用?C# TreeNode.SetTagValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TreeNode
的用法示例。
在下文中一共展示了TreeNode.SetTagValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: menuPaste_Click
private void menuPaste_Click(object sender, EventArgs e)
{
if ((this.treeView1.SelectedNode != null) && !this.treeView1.SelectedNode.HasTagValue())
{
try
{
string text = Clipboard.GetText();
if (!string.IsNullOrEmpty(text))
{
TreeNode selectedNode = this.treeView1.SelectedNode;
foreach (XmlCommand command in XmlHelper.XmlDeserialize<List<XmlCommand>>(text, Encoding.UTF8))
{
TreeNode node = new TreeNode(command.CommandName, int_2, int_3);
node.SetTagValue(command);
selectedNode.Nodes.Add(node);
this.method_1();
}
}
}
catch (Exception exception)
{
MessageBox.Show(exception.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Hand);
}
}
}
示例2: method_4
private void method_4(string[] string_2, bool bool_1)
{
foreach (string str in string_2)
{
List<XmlCommand> list = null;
try
{
list = XmlHelper.XmlDeserializeFromFile<List<XmlCommand>>(str, Encoding.UTF8);
}
catch (Exception exception)
{
throw new InvalidOperationException(string.Format("在读取文件 {0} 时失败,错误原因:\r\n{1}", str, exception.Message), exception);
}
if (comparison_0 == null)
{
comparison_0 = new Comparison<XmlCommand>(MainForm.smethod_0);
}
list.Sort(comparison_0);
TreeNode node = null;
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(str);
if (bool_1)
{
node = this.treeView1.Nodes.CompareText(fileNameWithoutExtension);
}
if (node == null)
{
node = new TreeNode(fileNameWithoutExtension, int_0, int_1);
this.treeView1.Nodes.Add(node);
}
else
{
node.Text = fileNameWithoutExtension;
node.Nodes.Clear();
}
foreach (XmlCommand command in list)
{
TreeNode node2 = new TreeNode(command.CommandName, int_2, int_3);
node2.SetTagValue(command);
node.Nodes.Add(node2);
}
}
}
示例3: menuAdd_Click
private void menuAdd_Click(object sender, EventArgs e)
{
TreeNode selectedNode = this.treeView1.SelectedNode;
if (selectedNode != null)
{
TreeNode node3 = selectedNode.IsTagEmpty() ? selectedNode : selectedNode.Parent;
EditCommandDialogFix dialog = new EditCommandDialogFix();
if (dialog.ShowDialog() == DialogResult.OK)
{
XmlCommand command = dialog.method_4();
TreeNode node2 = new TreeNode(command.CommandName, int_2, int_3);
node2.SetTagValue(command);
node3.Nodes.Add(node2);
this.treeView1.SelectedNode = node2;
node2.EnsureVisible();
this.method_1();
}
}
}