Exemple #1
0
        public ExportForm(IPersistence persistence, ConnectionManager connectionManager, FavoriteIcons favoriteIcons)
        {
            this.persistence = persistence;
            this.InitializeComponent();

            this.treeLoader = new FavoriteTreeListLoader(this.favsTree, this.persistence, this.favoriteIcons);
            this.treeLoader.LoadRootNodes();
            this.connectionManager     = connectionManager;
            this.favoriteIcons         = favoriteIcons;
            this.exporters             = new Exporters(this.persistence, this.connectionManager);
            this.saveFileDialog.Filter = this.exporters.GetProvidersDialogFilter();
        }
Exemple #2
0
        public void CreateTestTreeStructure()
        {
            var favoriteIcons = TestConnectionManager.CreateTestFavoriteIcons();

            this.treeView.AssignServices(this.Persistence, favoriteIcons, TestConnectionManager.Instance);
            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, favoriteIcons);
            this.treeLoader.LoadRootNodes();
            this.treeView.ExpandAllTreeNodes();
        }
Exemple #3
0
 private void FavsList_Load(object sender, EventArgs e)
 {
     this.favsTree.AssignServices(this.persistence, this.favoriteIcons, this.connectionManager);
     this.treeLoader = new FavoriteTreeListLoader(this.favsTree, this.persistence, this.favoriteIcons);
     this.treeLoader.LoadRootNodes();
     this.historyTreeView.Load(this.persistence, this.favoriteIcons);
     this.LoadState();
     this.favsTree.MouseUp += new MouseEventHandler(this.FavsTree_MouseUp);
     this.searchTextBox.LoadEvents(this.persistence);
     // hadle events
     this.searchPanel1.LoadEvents(this.persistence, this.favoriteIcons);
     this.renameCommand = new FavoriteRenameCommand(this.persistence, new RenameService(this.persistence.Favorites));
 }
Exemple #4
0
        public void LoadRecursiveLoadsCompleateSubtree()
        {
            var treeView   = new TestTreeView();
            var treeLoader = new FavoriteTreeListLoader(treeView, this.Persistence, TestConnectionManager.CreateTestFavoriteIcons());

            treeLoader.LoadRootNodes(); // now we have 7 including Dummy nodes
            treeLoader.LoadGroupNodesRecursive();
            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();
        }