/// <summary>
 /// Emulates standard adapter method that stores tags to the underlying logging subsystem.
 /// This method just stores tag values to inmemory collection, to be accessible for test purposes.
 /// </summary>
 /// <param name="tags">Tag collection.</param>
 /// <param name="builtInTags">Built-in tag collection.</param>
 public void InvalidateTags(ITagReadonlyCollection tags, ITagReadonlyCollection builtInTags)
 {
     _tagSnapshot = new TagSnapshot
     {
         Tags        = tags,
         BuiltInTags = builtInTags
     };
 }
Example #2
0
        internal TagCollectionDebugView(ITagReadonlyCollection collection)
        {
            if (collection == null)
            {
                throw new ArgumentNullException("collection");
            }

            _collection = collection;
        }
Example #3
0
        public TagReadonlyCollection(ITagReadonlyCollection collection)
        {
            if (null == collection)
            {
                throw new ArgumentNullException("collection", Properties.Resources.ValueCanNotBeNull_ErrorMessage);
            }

            _collection = collection;
        }
Example #4
0
        public TagEffectiveCollection(ITagReadonlyCollection parent, ITagReadonlyCollection current)
        {
            if (null == parent)
            {
                throw new ArgumentNullException("parent", Properties.Resources.ValueCanNotBeNull_ErrorMessage);
            }

            if (null == current)
            {
                throw new ArgumentNullException("current", Properties.Resources.ValueCanNotBeNull_ErrorMessage);
            }

            _parent  = parent;
            _current = current;
        }
Example #5
0
 public void InvalidateTags(ITagReadonlyCollection tags, ITagReadonlyCollection builtInTags)
 {
     // Do nothing.
 }
Example #6
0
 public void InvalidateTags(ITagReadonlyCollection tags, ITagReadonlyCollection builtInTags)
 {
     MdcStorage.Save(TagSerializer.TagsToString(tags, builtInTags));
 }
Example #7
0
 public TagScope(ITagThreadContext threadContext, ITagReadonlyCollection applicationScopeTags, IDictionary <string, string> tags)
     : this(threadContext, applicationScopeTags)
 {
     AddOrReplaceTags(tags);
 }
Example #8
0
 public TagScope(ITagThreadContext threadContext, ITagReadonlyCollection applicationScopeTags)
     : this( threadContext )
 {
     _inheritedTags = new TagReadonlyCollection(applicationScopeTags);
     _effectiveTags = new TagEffectiveCollection(_inheritedTags, _tags);
 }