public bool ContainsValue(EventSourceFilter item)
 {
     return m_Bag.ContainsValue(item);
 }
Example #2
0
 private void ParseFilterRefs(XmlElement element, EventSourceFilter evSourceFilter)
 {
     foreach (XmlNode node1 in element.ChildNodes)
     {
       if (node1.NodeType == XmlNodeType.Element)
       {
     XmlElement element1 = (XmlElement) node1;
     if (element1.LocalName != "filterRef")
     {
       throw new InvalidOperationException(element1.LocalName + " is not allowed in this context.");
     }
     XmlAttribute attribute1 = element1.Attributes["name"];
     if ((attribute1 == null) || (attribute1.Value == string.Empty))
     {
       throw new InvalidOperationException("name is mandatory,  it cannot be omitted or empty.");
     }
     string text1 = attribute1.Value;
     EventFilter filter1 = m_Filters[text1];
     if (filter1 == null)
     {
       throw new InvalidOperationException("The referenced '" + text1 + "' event filter does not exist.");
     }
     evSourceFilter.EventFilters.Add(text1, filter1);
       }
     }
 }
 public void Add(string key, EventSourceFilter item)
 {
     m_Bag.Add(key, item);
 }
Example #4
0
 private void ParseEventSource(XmlElement element)
 {
     XmlAttribute attribute1 = element.Attributes["name"];
     if ((attribute1 == null) || (attribute1.Value == string.Empty))
     {
       throw new InvalidOperationException("name is mandatory,  it cannot be omitted or empty.");
     }
     string text1 = attribute1.Value;
     bool flag1 = true;
     XmlAttribute attribute2 = element.Attributes["enabled"];
     if ((attribute2 != null) && (attribute2.Value.ToLower().Trim() == "false"))
     {
       flag1 = false;
     }
     EventSourceFilter filter1 = new EventSourceFilter(text1);
     filter1.Enabled = flag1;
     m_EventSources.Add(text1, filter1);
     ParseFilterRefs(element, filter1);
 }