// Methods public EventCategorySink(EventCategory category) { m_EventSinks = new EventSinkBag(); m_Category = category; }
private void ParseEvents(XmlElement element, EventCategory eventCat) { foreach (XmlNode node1 in element.ChildNodes) { if (node1.NodeType == XmlNodeType.Element) { XmlElement element1 = (XmlElement) node1; if (element1.LocalName != "event") { throw new InvalidOperationException(element1.LocalName + " is not allowed in this context."); } XmlAttribute attribute1 = element1.Attributes["type"]; if ((attribute1 == null) || (attribute1.Value == string.Empty)) { throw new InvalidOperationException("type is mandatory, it cannot be omitted or empty."); } string text1 = attribute1.Value; DynamicType type1 = new DynamicType(text1); if (!type1.IsValidType) { type1 = DynamicType.InitWithDefaultNameSpace(text1, "Framework.Diagnostics.EventSchema", "Framework.Diagnostics"); } Type type2 = type1.GetDynamicType(); if (type2 == null) { throw new InvalidOperationException("'" + text1 + "' is not a valid type it the current context."); } eventCat.EventTypes.Add(type2); } } }
public bool ContainsValue(EventCategory item) { return m_Bag.ContainsValue(item); }
private void ParseEventCategory(XmlElement element) { string text1 = null; XmlAttribute attribute1 = element.Attributes["name"]; if ((attribute1 == null) || (attribute1.Value == string.Empty)) { throw new InvalidOperationException("name is mandatory, it cannot be omitted or empty."); } text1 = attribute1.Value; if (m_EventCategories[text1] != null) { throw new InvalidOperationException(text1 + " EventCategory already exists."); } EventCategory category1 = new EventCategory(text1); m_EventCategories.Add(text1, category1); ParseEvents(element, category1); }
public void Add(string key, EventCategory item) { m_Bag.Add(key, item); }