コード例 #1
0
        public ExportForm(IPersistence persistence)
        {
            this.persistence = persistence;
            this.InitializeComponent();

            this.treeLoader = new FavoriteTreeListLoader(this.favsTree, this.persistence);
            this.treeLoader.LoadRootNodes();
            this.saveFileDialog.Filter = Integrations.Exporters.GetProvidersDialogFilter();
            this.rootNodes = new TreeListNodes(this.favsTree.Nodes);
        }
コード例 #2
0
        public void LoadRecursiveLoadsCompleateSubtree()
        {
            var treeView = new TestTreeView();
            var treeLoader = new FavoriteTreeListLoader(treeView, this.Persistence);
            treeLoader.LoadRootNodes(); // now we have 7 including Dummy nodes
            var rootNodes = new TreeListNodes(treeView.Nodes);

            treeLoader.LoadGroupNodesRecursive(rootNodes);
            int allLoadedCount = treeView.GetNodeCount(true);
            // or assert: treeView.Nodes[1].Nodes[0].Nodes[0].Name = "FavoriteA"
            // Dummy are replaced, and also Favorite nodes are included
            Assert.AreEqual(8, allLoadedCount, "Loading recursive subtree should load all nodes without expanding them");

            treeView.Dispose();
        }
コード例 #3
0
        public void CreateTestTreeStructure()
        {
            this.treeView.Persistence = this.Persistence;
            this.CreateData();

            // loaded tree is needed for all tests, if if there is a "load all test", which tests next line only
            this.treeLoader = new FavoriteTreeListLoader(this.treeView, this.Persistence);
            this.treeLoader.LoadRootNodes();
            this.treeView.ExpandAllTreeNodes();
        }
コード例 #4
0
 private void FavsList_Load(object sender, EventArgs e)
 {
     this.favsTree.Persistence = this.Persistence;
     this.treeLoader = new FavoriteTreeListLoader(this.favsTree, this.Persistence);
     this.treeLoader.LoadRootNodes();
     this.historyTreeView.Load(this.Persistence);
     this.LoadState();
     this.favsTree.MouseUp += new MouseEventHandler(this.FavsTree_MouseUp);
     this.searchTextBox.LoadEvents(this.Persistence);
     // hadle events
     this.searchPanel1.LoadEvents(this.Persistence);
     this.renameCommand = new FavoriteRenameCommand(this.Persistence, new RenameService(this.Persistence.Favorites));
 }