public DocTreeView( Core.Document doc, TreeView treeView ) { _doc = doc; _treeView = treeView; _rootNode = new TreeNode { ImageKey = "document.png", SelectedImageKey = "document.png" }; _treeView.Nodes.Add( _rootNode ); _nodes = new DocTreeNodeCollection( _doc.Entries, _rootNode.Nodes ); _selection = new DocTreeNodeSelection( _treeView, _doc.SelectedEntries, this.Find ); _activeNode = new ActiveNode { Font = new Font( _treeView.Font, FontStyle.Bold ) }; }
void SelectNode(TreeNode target, bool append) { // Ctrl.Current.Self の設定 Ctrl.Current.Self = (target == null) ? null : target.Tag; if (Ctrl.Current.Self is TreeNodeBuilder) { Ctrl.Current.Self = ((TreeNodeBuilder)Ctrl.Current.Self).Tag; } // プロパティグリッドの設定 this.propertyGrid.SelectedObject = Ctrl.Current.Self; // 選択された TreeNodeBuilder の探索 TreeNodeBuilder selected = null; for (TreeNode node = target; node != null; node = node.Parent) { selected = node.Tag as TreeNodeBuilder; if (selected != null) { break; } } // SelectedEntries の設定 Core.Document doc = Core.Document.Current; if (append) { Core.IEntry entry = (selected == null) ? null : selected.Tag as Core.IEntry; if (entry == null) { doc.SelectedEntry = null; } else { doc.SelectedEntries.Add(entry); } Ctrl.Current.Driver.Abort(); // 現在のオペレーションをアボート } else { Core.IEntry before = doc.SelectedEntry; doc.SelectedEntry = (selected == null) ? null : selected.Tag as Core.IEntry; if (before != doc.SelectedEntry) { // 選択エントリが変わったときは、現在のオペレーションをアボート Ctrl.Current.Driver.Abort(); } } _docviews.Invalidate(); }
public static TreeNodeBuilder New( Core.Document document, TreeView treeView ) { string name = document.ToString(); string text = document.ToString(); string icon = "document.png"; TreeNode node = treeView.Nodes.Add(name, text, icon, icon); node.Tag = new TreeNodeBuilder(document, node); return((TreeNodeBuilder)node.Tag); }
public static TreeNodeBuilder New( Core.Document document, Core.IEntry entry, TreeNodeCollection nodes ) { string name = MakeNodeName(entry.ID); string text = entry.ToString(); string icon = "entry.png"; TreeNode node = nodes.Add(name, text, icon, icon); node.Tag = new TreeNodeBuilder(document, entry, node); return((TreeNodeBuilder)node.Tag); }
public DocTreeView(Core.Document doc, TreeView treeView) { _doc = doc; _treeView = treeView; _rootNode = new TreeNode { ImageKey = "document.png", SelectedImageKey = "document.png" }; _treeView.Nodes.Add(_rootNode); _nodes = new DocTreeNodeCollection(_doc.Entries, _rootNode.Nodes); _selection = new DocTreeNodeSelection(_treeView, _doc.SelectedEntries, this.Find); _activeNode = new ActiveNode { Font = new Font(_treeView.Font, FontStyle.Bold) }; }
TreeNodeBuilder( Core.Document document, TreeNode node ) { _document = document; _path = null; _node = node; }
TreeNodeBuilder( Core.Document document, Core.IEntry entry, TreeNode node ) { _document = document; _path = entry.Path; _node = node; }
public static void Clear(Core.Document self) { Ctrl.CommandHelper.Clear(); }
TreeNodeBuilder(Core.Document document, TreeNode node) { _document = document; _path = null; _node = node; }
TreeNodeBuilder(Core.Document document, Core.IEntry entry, TreeNode node) { _document = document; _path = entry.Path; _node = node; }
public ViewOperationWithContextMenu(Core.Document document, Graphics.StandardViewOperation.Setting setting) : this(document, setting, SI.CreateContextMenu) { }
public ViewOperationWithContextMenu( Core.Document document, Func <ContextMenuStrip> createContextMenu) : base(document) { _createContextMenu = createContextMenu; }
public ViewOperationWithContextMenu( Core.Document document, Graphics.StandardViewOperation.Setting setting, Func <ContextMenuStrip> createContextMenu) : base(document, setting) { _createContextMenu = createContextMenu; }
/// <summary> /// When closing... /// </summary> private void OnClose(object sender, System.EventArgs e) { this.document = null; this.DeactivateUI(); }
private void LoadDocument(string fileName) { this.SetStatus( "Opening..." ); // Load document this.document = new Core.Document( fileName ); this.ActivateUI(); this.ShowData(); this.SetTitle( fileName ); // Prepare this.PrepareSideBar(); this.PrepareFilePositionSelector(); this.SetStatus(); }