Beispiel #1
0
        public static IEnumerable <Selector> GetCurrent()
        {
            SelectorSetHeader header = OperationContextProxy.Current.FindHeader <SelectorSetHeader>();

            if (header == null)
            {
                return(new Selector[] {});
            }
            return(header.Selectors);
        }
Beispiel #2
0
        private static List <Selector> GetSelectors()
        {
            SelectorSetHeader selectorSetHeader = OperationContextProxy.Current.FindHeader <SelectorSetHeader>();

            List <Selector> selectors = selectorSetHeader != null
            ? selectorSetHeader.Selectors
            : new List <Selector>();

            return(selectors);
        }
Beispiel #3
0
      public static SelectorSetHeader ReadFrom(XmlReader reader)
      {
         SelectorSetHeader result = new SelectorSetHeader();
		 reader.ReadStartElement(ElementName, ManagementNamespaces.Namespace);
         while (reader.LocalName == Selector.ElementName)
         {
            Selector newSelector = Selector.ReadFrom(reader);
            result.Selectors.Add(newSelector);
         }
         if (reader.NodeType == XmlNodeType.EndElement)
         {
            reader.ReadEndElement();
         }
         return result;
      }      
Beispiel #4
0
        public static SelectorSetHeader ReadFrom(XmlReader reader)
        {
            SelectorSetHeader result = new SelectorSetHeader();

            reader.ReadStartElement(ElementName, ManagementNamespaces.Namespace);
            while (reader.LocalName == Selector.ElementName)
            {
                Selector newSelector = Selector.ReadFrom(reader);
                result.Selectors.Add(newSelector);
            }
            if (reader.NodeType == XmlNodeType.EndElement)
            {
                reader.ReadEndElement();
            }
            return(result);
        }