/// <summary>
 ///     add new history item in todays list and/or perform full refresh,
 ///     if day has changed since last refresh
 /// </summary>
 private void OnHistoryRecorded(ConnectionHistory sender, HistoryRecordedEventArgs args)
 {
     if (this.IsDayGone())
         this.RefreshAllExpanded();
     else
         this.InsertRecordedNode(args);
 }
        private void FireOnHistoryRecorded(string favoriteName)
        {
            HistoryRecordedEventArgs args = new HistoryRecordedEventArgs {
                ConnectionName = favoriteName
            };

            if (this.OnHistoryRecorded != null)
            {
                this.OnHistoryRecorded(this, args);
            }
        }
        private void InsertRecordedNode(HistoryRecordedEventArgs args)
        {
            TagTreeNode todayGroup = this.Nodes[HistoryByFavorite.TODAY] as TagTreeNode;
            if (todayGroup.NotLoadedYet)
                return;

            if (!todayGroup.ContainsFavoriteNode(args.ConnectionName))
                InsertRecordedNode(todayGroup, args);
        }
        private static void InsertRecordedNode(TagTreeNode todayGroup, HistoryRecordedEventArgs args)
        {
            FavoriteConfigurationElement favorite = Settings.GetOneFavorite(args.ConnectionName, false);

            // shouldn't happen, because the favorite was actualy processed
            if (favorite != null)
            {
                int insertIndex = TreeListLoader.FindFavoriteNodeInsertIndex(todayGroup.Nodes, favorite);
                FavoriteTreeNode favoriteNode = new FavoriteTreeNode(favorite);
                todayGroup.Nodes.Insert(insertIndex, favoriteNode);
            }
        }
 private void FireOnHistoryRecorded(string favoriteName)
 {
     HistoryRecordedEventArgs args = new HistoryRecordedEventArgs {ConnectionName = favoriteName};
     if (this.OnHistoryRecorded != null)
     {
         this.OnHistoryRecorded(this, args);
     }
 }