예제 #1
0
 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 ) };
 }
예제 #2
0
        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();
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
 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)
     };
 }
예제 #6
0
 TreeNodeBuilder( Core.Document document, TreeNode node )
 {
     _document = document;
       _path = null;
       _node = node;
 }
예제 #7
0
 TreeNodeBuilder( Core.Document document, Core.IEntry entry, TreeNode node )
 {
     _document = document;
       _path = entry.Path;
       _node = node;
 }
예제 #8
0
 public static void Clear(Core.Document self)
 {
     Ctrl.CommandHelper.Clear();
 }
예제 #9
0
 TreeNodeBuilder(Core.Document document, TreeNode node)
 {
     _document = document;
     _path     = null;
     _node     = node;
 }
예제 #10
0
 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;
 }
예제 #14
0
파일: Gui.cs 프로젝트: Baltasarq/Visor
 /// <summary>
 /// When closing...
 /// </summary>
 private void OnClose(object sender, System.EventArgs e)
 {
     this.document = null;
     this.DeactivateUI();
 }
예제 #15
0
파일: Gui.cs 프로젝트: Baltasarq/Visor
        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();
        }