コード例 #1
0
 private void LoadXml(XmlReader xmlReader)
 {
     var result = new List<INotifyAction>();
     XPathNavigator nav = new XPathDocument(xmlReader).CreateNavigator();
     var manager = new XmlNamespaceManager(nav.NameTable);
     manager.AddNamespace("act", "urn:asc.notify.action.xsd");
     XPathNodeIterator nodes = nav.Select("act:catalog/action", manager);
     while (nodes.MoveNext())
     {
         result.Add(
             new NotifyAction(
                 nodes.Current.GetAttribute("id", ""),
                 nodes.Current.GetAttribute("name", "")));
     }
     _ConstProvider = new ConstActionProvider(result.ToArray());
 }
コード例 #2
0
        private void LoadXml(XmlReader xmlReader)
        {
            var            result  = new List <INotifyAction>();
            XPathNavigator nav     = new XPathDocument(xmlReader).CreateNavigator();
            var            manager = new XmlNamespaceManager(nav.NameTable);

            manager.AddNamespace("act", "urn:asc.notify.action.xsd");
            XPathNodeIterator nodes = nav.Select("act:catalog/action", manager);

            while (nodes.MoveNext())
            {
                result.Add(
                    new NotifyAction(
                        nodes.Current.GetAttribute("id", ""),
                        nodes.Current.GetAttribute("name", "")));
            }
            _ConstProvider = new ConstActionProvider(result.ToArray());
        }