private void AddGroupNodes(GroupTreeNode groupNode)
        {
            IEnumerable <IGroup> childGroups = this.GetChildGroups(groupNode.Group);
            var nodes = new TreeListNodes(groupNode.Nodes, this.toolTipBuilder, this.favoriteIcons);

            nodes.InsertGroupNodes(childGroups);
        }
Exemple #2
0
        private void AddNewHistoryGroupNode(string name, string imageKey)
        {
            var virtualGroup = this.persistence.Factory.CreateGroup(name);
            var groupNode    = new GroupTreeNode(virtualGroup, imageKey);

            this.Nodes.Add(groupNode);
        }
Exemple #3
0
        private void RefreshGroupNodes(GroupTreeNode groupNode)
        {
            groupNode.Nodes.Clear();
            var groupFavorites = this.persistence.ConnectionHistory.GetDateItems(groupNode.Name);

            CreateGroupNodes(groupNode, groupFavorites);
        }
        private void OnTreeViewExpand(object sender, TreeViewEventArgs e)
        {
            GroupTreeNode groupNode = e.Node as GroupTreeNode;

            if (groupNode != null)
            {
                this.LoadGroupNode(groupNode);
            }
        }
 private void ExpandDateGroupNode(GroupTreeNode groupNode)
 {
     this.Cursor = Cursors.WaitCursor;
     if (groupNode.NotLoadedYet)
     {
         RefreshGroupNodes(groupNode);
     }
     this.Cursor = Cursors.Default;
 }
        private void PerformFavoritesUpdate(FavoritesChangedEventArgs args)
        {
            GroupTreeNode selectedGroup    = this.treeList.FindSelectedGroupNode();
            IFavorite     selectedFavorite = this.treeList.SelectedFavorite;
            var           updater          = new FavoritesLevelUpdate(this.favoriteIcons, this.RootNodes, args, this.toolTipBuilder);

            updater.Run();
            this.treeList.RestoreSelectedFavorite(selectedGroup, selectedFavorite);
        }
Exemple #7
0
 private void ExpandDateGroupNode(GroupTreeNode groupNode)
 {
     this.Cursor = Cursors.WaitCursor;
     if (groupNode.NotLoadedYet)
     {
         RefreshGroupNodes(groupNode);
     }
     this.Cursor = Cursors.Default;
 }
 private static void CreateGroupNodes(GroupTreeNode groupNode,
     SortableList<IFavorite> groupFavorites)
 {
     foreach (IFavorite favorite in groupFavorites)
     {
         var favoriteNode = new FavoriteTreeNode(favorite);
         groupNode.Nodes.Add(favoriteNode);
     }
 }
 private static void InsertRecordedNode(GroupTreeNode todayGroup, HistoryRecordedEventArgs args)
 {
     IFavorite favorite = args.Favorite;
     if (favorite != null) // shouldnt happen, because the favorite was actualy processed
     {
         var nodes = new TreeListNodes(todayGroup.Nodes);
         nodes.InsertFavorite(favorite);
     }
 }
Exemple #10
0
 private void CreateGroupNodes(GroupTreeNode groupNode,
                               SortableList <IFavorite> groupFavorites)
 {
     foreach (var favorite in groupFavorites)
     {
         var toolTip      = this.toolTipBuilder.BuildTooTip(favorite);
         var favoriteNode = new FavoriteTreeNode(this.favoriteIcons, favorite, toolTip);
         groupNode.Nodes.Add(favoriteNode);
     }
 }
Exemple #11
0
        private void InsertRecordedNode(GroupTreeNode todayGroup, HistoryRecordedEventArgs args)
        {
            var favorite = args.Favorite;

            if (favorite != null) // shouldnt happen, because the favorite was actualy processed
            {
                var nodes = new TreeListNodes(todayGroup.Nodes, this.toolTipBuilder, this.favoriteIcons);
                nodes.InsertFavorite(favorite);
            }
        }
 /// <summary>
 /// Create new not root level container if parent is defined, otherwise
 /// create root level container. Than this is an entry point of the update.
 /// </summary>
 protected TreeNodesLevelUpdate(FavoriteIcons favoriteIcons, TreeNodeCollection nodes, TChanges changes,
                                ToolTipBuilder toolTipBuilder, GroupTreeNode parent = null)
 {
     this.nodes          = nodes;
     this.FavoriteIcons  = favoriteIcons;
     this.ToolTipBuilder = toolTipBuilder;
     this.Nodes          = new TreeListNodes(nodes, toolTipBuilder, favoriteIcons);
     this.Changes        = changes;
     this.Parent         = parent;
 }
        private void LoadGroupNode(GroupTreeNode groupNode)
        {
            if (!groupNode.NotLoadedYet)
            {
                return;
            }

            groupNode.Nodes.Clear();
            this.AddGroupNodes(groupNode);
            var nodes = new TreeListNodes(groupNode.Nodes, this.toolTipBuilder, this.favoriteIcons);

            nodes.AddFavoriteNodes(groupNode.Favorites);
        }
Exemple #14
0
        private void InsertRecordedNode(HistoryRecordedEventArgs args)
        {
            GroupTreeNode todayGroup = this.Nodes[HistoryIntervals.TODAY] as GroupTreeNode;

            if (todayGroup.NotLoadedYet)
            {
                return;
            }

            if (!todayGroup.ContainsFavoriteNode(args.Favorite))
            {
                InsertRecordedNode(todayGroup, args);
            }
        }
 private void AddGroupNodes(GroupTreeNode groupNode)
 {
     IEnumerable<IGroup> childGroups = this.GetChildGroups(groupNode.Group);
     var nodes = new TreeListNodes(groupNode.Nodes);
     nodes.InsertGroupNodes(childGroups);
 }
 private void AddNewHistoryGroupNode(string name, string imageKey)
 {
     IGroup virtualGroup = this.persistence.Factory.CreateGroup(name);
     var groupNode = new GroupTreeNode(virtualGroup, imageKey);
     this.Nodes.Add(groupNode);
 }
        private void LoadGroupNode(GroupTreeNode groupNode)
        {
            if (!groupNode.NotLoadedYet)
                return;

            groupNode.Nodes.Clear();
            this.AddGroupNodes(groupNode);
            var nodes = new TreeListNodes(groupNode.Nodes);
            nodes.AddFavoriteNodes(groupNode.Favorites);
        }
 private void RefreshGroupNodes(GroupTreeNode groupNode)
 {
     groupNode.Nodes.Clear();
     var groupFavorites = this.persistence.ConnectionHistory.GetDateItems(groupNode.Name);
     CreateGroupNodes(groupNode, groupFavorites);
 }
Exemple #19
0
        /// <summary>
        /// Creates the and add Group node in tree list on proper position defined by index.
        /// This allowes the Group nodes to keep ordered by name.
        /// </summary>
        /// <param name="group">The group to create.</param>
        /// <param name="index">The index on which node would be inserted.
        /// If negative number, than it is added to the end.</param>
        internal void InsertGroupNode(IGroup group, int index = -1)
        {
            var groupNode = new GroupTreeNode(group);

            this.InsertNodePreservingOrder(index, groupNode);
        }
Exemple #20
0
 /// <summary>
 /// Create new not root level container
 /// </summary>
 private FavoritesLevelUpdate(FavoriteIcons favoriteIcons, TreeNodeCollection nodes, FavoritesChangedEventArgs changes,
                              GroupTreeNode parent, ToolTipBuilder toolTipBuilder)
     : base(favoriteIcons, nodes, changes, toolTipBuilder, parent)
 {
 }
Exemple #21
0
        private void OnTreeViewExpand(object sender, TreeViewEventArgs e)
        {
            GroupTreeNode groupNode = e.Node as GroupTreeNode;

            ExpandDateGroupNode(groupNode);
        }
 /// <summary>
 /// Creates the and add Group node in tree list on proper position defined by index.
 /// This allowes the Group nodes to keep ordered by name.
 /// </summary>
 /// <param name="group">The group to create.</param>
 /// <param name="index">The index on which node would be inserted.
 /// If negative number, than it is added to the end.</param>
 internal void InsertGroupNode(IGroup group, int index = -1)
 {
     var groupNode = new GroupTreeNode(group);
     this.InsertNodePreservingOrder(index, groupNode);
 }
 public void TestSetup()
 {
     this.sourceFavorite = this.AddFavorite("SourceFavorite");
     this.sourceFavoriteNode = new FavoriteTreeNode(sourceFavorite);
     this.sourceGroup = this.AddNewGroup("SourceGroup");
     this.sourceGroupNode = new GroupTreeNode(sourceGroup);
     this.targetFavorite = this.AddFavorite("TargetFavorite");
     this.targetGroup = this.AddNewGroup("TargetGroup");
 }