Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();

            fontFactory        = new FontFactory();
            fileSystemDao      = new FileSystemDAO();
            fileNameTranslator = new FilenameTranslator();
            treeViewController = new TreeViewController(fileSystemDao.DefaultDirectoryInfo, treeView1, fileNameTranslator);


            InitializeFonts();

            FolderTextBox.Text        = fileSystemDao.DefaultDirectoryInfo.FullName;
            treeViewController.Editor = fastColoredTextBox1;

            EditorTab.TabPages.Remove(DesignerTab);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Typically the GUI instantiates the TreeViewGrid as part of some XAML.   However to do its job that
        /// object needs to know what data it is operating on.  This is what 'SetController' does.   By defining
        /// an object implementing ITreeViewController and passing it to this method, you populate the TreeViewGrid
        /// with data.
        /// </summary>
        public void SetController(ITreeViewController controller)
        {
            m_controller = controller;

            // Set up the columns
            for (int i = 0; i < m_controller.ColumnNames.Count; i++)
            {
                var columnName = m_controller.ColumnNames[i];
                var columnIdx  = i + 1;     // Skip the name column
                if (columnIdx < Grid.Columns.Count)
                {
                    var column = Grid.Columns[columnIdx];
                    column.Header     = columnName;
                    column.Visibility = System.Windows.Visibility.Visible;
                }
            }

            List <TreeViewGridNode> newFlattenedTree = new List <TreeViewGridNode>();

            newFlattenedTree.Add(new TreeViewGridNode(this, controller.Root, null));

            // Copy over the nodes to the new flattened tree (as best we can)
            if (m_flattenedTree.Count > 0 && m_flattenedTree[0].Name == controller.Name(controller.Root))
            {
                TreeViewGridNode.CopyExpandedStateForNode(newFlattenedTree, 0, m_flattenedTree, 0);
            }

            // Destroy old nodes (to save memory because GUI keeps references to them)
            foreach (var node in m_flattenedTree)
            {
                node.Dispose();
            }

            // Update the whole tree with the new tree.
            m_flattenedTree.ReplaceRange(0, m_flattenedTree.Count, newFlattenedTree);
            Validate();

            // Expand the root element
            m_flattenedTree[0].IsExpanded = true;
        }
 public FileAssociationsTreeView(TreeModel model, ITreeViewController controller, IUIApplication environment, ITooltipManager tooltipManager, IWindowsHookManager windowsHookManager, IActionManager actionManager)
     : base(model, controller, environment, tooltipManager, windowsHookManager, actionManager)
 {
 }
 public FileAssociationsTreeView(TreeModel model, ITreeViewController controller) : base(model, controller)
 {
 }
Ejemplo n.º 5
0
 public FileAssociationsTreeView(TreeModel model, ITreeViewController controller) : base(model, controller)
 {
 }
 public YouTrackIssueView(ITreeViewController controller)
     : base(controller)
 {
 }
 public YouTrackIssueView(TreeModel model, ITreeViewController controller)
     : base(model, controller)
 {
 }