示例#1
0
 public MainForm()
 {
     InitializeComponent();
     Node = new NewTreeNode("Корень ");
     treeView.Nodes.Add(Node);
     listBox.MultiColumn = true;
 }
示例#2
0
 /// <summary>
 /// Adding a section.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void addMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         NewTreeNode node = new NewTreeNode();
         node.Text = "Новый раздел";
         treeView.SelectedNode.Nodes.Add(node);
         treeView.SelectedNode = node;
         treeView.SelectedNode.BeginEdit();
     }
     catch
     {
         MessageBox.Show("Что-то пошло не так...");
     }
 }
示例#3
0
 /// <summary>
 /// Csv writer.
 /// </summary>
 /// <param name="treeNode"></param>
 void csvWriter(NewTreeNode treeNode)
 {
     if (treeNode.Nodes.Count > 0)
     {
         foreach (NewTreeNode node in treeNode.Nodes)
         {
             csvWriter(node);
         }
     }
     else
     {
         foreach (var item in treeNode.Items)
         {
             try
             {
                 csv.Append($"\n{treeNode.FullPath};{item.Name};{item.VendorCode};{item.Price};{item.Count}");
             }
             catch { }
         }
     }
 }