/// <summary> /// Добавляет узел, отображающий указанный файл /// </summary> public void AddFileNode(string FileName) { if (Path.GetExtension(FileName) == ".plt") { this.AddPultFileNode(FileName); } else { FileTreeNode fnode = new FileTreeNode(FileName, this.solution); if (FileName == this.Solution.ProgramFileName) { fnode.NodeFont = new Font(this.NodeFont, FontStyle.Bold); } this.Nodes.Add(fnode); } }
/// <summary> /// Добавляет узел, отображаюий указанный файл пультов /// </summary> public void AddPultFileNode(string FileName) { FileTreeNode fnode = new FileTreeNode(FileName, this.Solution); if (FileName == this.Solution.PultFileName) { fnode.NodeFont = new Font(this.NodeFont, FontStyle.Bold); } int idx = 3; // 0-узел свойств, 1 - программа, 2 - пульт по-умолчанию while (idx < this.Nodes.Count && this.Nodes[idx] is FileTreeNode && Path.GetExtension(((FileTreeNode)this.Nodes[idx]).FileName) == ".plt") { idx++; } this.Nodes.Insert(idx, fnode); }
private void cmiExcludeFromSolution_Click(object sender, EventArgs e) { try { if (!(this.tvSolutionExplorer.SelectedNode is ControllerProgramSolutionTreeNode)) { FileTreeNode node = (FileTreeNode)this.tvSolutionExplorer.SelectedNode; node.Solution.Files.Remove(node.FileName); node.Solution.Save(); node.Remove(); } } catch (Exception ex) { Utils.ErrorMessage(ex.Message); } }
private void cmiSetAsActivePult_Click(object sender, EventArgs e) { ControllerProgramSolution solution = ((ControllerProgramSolutionTreeNode)this.tvSolutionExplorer.SelectedNode.Parent).Solution; FileTreeNode cn = (FileTreeNode)this.tvSolutionExplorer.SelectedNode; foreach (TreeNode node in this.tvSolutionExplorer.SelectedNode.Parent.Nodes) { if (node is FileTreeNode && ((FileTreeNode)node).FileName == solution.PultFileName) { node.NodeFont = new Font(this.Font, FontStyle.Regular); break; } } solution.PultFileName = cn.FileName; string s = cn.Text; cn.NodeFont = new Font(this.Font, FontStyle.Bold); cn.Text = s; MainForm.MainFormInstance.ReloadSolutionPropertiesDocument(solution); }
public FileTreeNodeTextChangedEventArgs(FileTreeNode Node, string Text) : base(Node) { this.text = Text; }
public FileTreeNodeEventArgs(FileTreeNode Node) { this.node = Node; }