void setNodeFont(TreeNode node) { Adv_data tag; if (node.Tag != null) { tag = (Adv_data)node.Tag; } else { tag = new Adv_data(); } if (node.Checked) { node.NodeFont = font_chekednew; } else if (tag.important) { node.NodeFont = font_important; } else { node.NodeFont = font_uncheked; } }
void edit_node(bool new_node = false) { FormEditNode form_edit = new FormEditNode(); if (node_cur != null) { form_edit.textBox1.Text = node_cur.Text; form_edit.checkBox1.Checked = node_cur.Checked; if (node_cur.Tag != null) { Adv_data tag = (Adv_data)node_cur.Tag; form_edit.checkBox_important.Checked = tag.important; form_edit.textBox_itil_obrashenie.Text = tag.itil_obrashenie; } } form_edit.ShowDialog(); if (!form_edit.ok) { return; } if (new_node) { add_node(form_edit.textBox1.Text); } else { node_cur.Text = form_edit.textBox1.Text; node_cur.Checked = form_edit.checkBox1.Checked; if (node_cur.Tag == null) { node_cur.Tag = (Adv_data) new Adv_data(); } Adv_data tag = (Adv_data)node_cur.Tag; tag.important = form_edit.checkBox_important.Checked; tag.itil_obrashenie = form_edit.textBox_itil_obrashenie.Text; node_cur.Tag = (Adv_data)tag; setNodeFont(node_cur); } save_to_file(); }