Early Preview
class System.​Diagnostics.​ActivityTagsCollection
Assembly: System.Diagnostics.DiagnosticSource
Inheritance: object → ActivityTagsCollection
Implemented Interfaces
- Collections.​Generic.​IDictionary`2 (Inherits: ICollection<​KeyValuePair<​string, object>>IEnumerable<​KeyValuePair<​string, object>>IEnumerable)
ActivityTagsCollection is a collection class used to store tracing tags. This collection will be used with classes like <see cref="T:System.Diagnostics.ActivityEvent" /> and <see cref="T:System.Diagnostics.ActivityLink" /> . This collection behaves as follows: - The collection items will be ordered according to how they are added. - Don't allow duplication of items with the same key. - When using the indexer to store an item in the collection: - If the item has a key that previously existed in the collection and the value is <see langword="null" /> , the collection item matching the key will be removed from the collection. - If the item has a key that previously existed in the collection and the value is not <see langword="null" /> , the new item value will replace the old value stored in the collection. - Otherwise, the item will be added to the collection. - Add method will add a new item to the collection if an item doesn't already exist with the same key. Otherwise, it will throw an exception.