Esempio n. 1
0
        /// <summary>
        /// Adds a new <see cref="ActivityContext"/> to the store.
        /// </summary>
        /// <param name="context">The context to be added to the store.</param>
        public void AddActivity(ActivityContext activity)
        {
            if (activity == null)
            {
                throw new ArgumentNullException(nameof(activity));
            }

            lock (Activities)
            {
                Activities.AddLast(activity);
                while (Count() > Capacity)
                {
                    Activities.RemoveFirst();
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Removes any nodes on the context's scope tree that doesn't have any logs
 /// This may occur as a result of the filters turned on
 /// </summary>
 /// <param name="context">The context who's node should be condensed</param>
 /// <returns>true if the node has been condensed to null, false otherwise</returns>
 private bool CollapseActivityContext(ActivityContext context)
 {
     context.Root = CollapseHelper(context.Root);
     context.IsCollapsed = true;
     return context.Root == null;
 }