示例#1
0
        public void ReadXml(System.Xml.XmlReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            XPathDocument  doc = new XPathDocument(reader);
            XPathNavigator nav = doc.CreateNavigator();

            XPathNavigator iter         = nav.SelectSingleNode("/ConfigDefinition/IsJava");
            string         isJavaString = iter.Value;
            bool           tmpIsJava;

            if (isJavaString != null && bool.TryParse(isJavaString, out tmpIsJava))
            {
                IsJava = tmpIsJava;
            }

            XPathNodeIterator propertyObjectsIterator = nav.Select("/ConfigDefinition//PropertyObject");

            while (propertyObjectsIterator.MoveNext())
            {
                ConfigPropertyObject propertyObject = new ConfigPropertyObject();
                propertyObject.ReadXml(propertyObjectsIterator.Current.ReadSubtree());
                Properties.Add(propertyObject.Name, propertyObject);
            }
        }
示例#2
0
        private void ReadVersionOne(XPathNavigator nav)
        {
            XPathNavigator iter         = nav.SelectSingleNode("/Metadata/ConfigWrapper");
            string         isJavaString = iter.GetAttribute("IsJava", String.Empty);
            bool           tmpIsJava;

            if (isJavaString != null && bool.TryParse(isJavaString, out tmpIsJava))
            {
                IsJava = tmpIsJava;
            }

            XPathNodeIterator propertyObjectsIterator = nav.Select("/Metadata/ConfigWrapper//PropertyObject");

            while (propertyObjectsIterator.MoveNext())
            {
                ConfigPropertyObject propertyObject = new ConfigPropertyObject();
                propertyObject.ReadXml(propertyObjectsIterator.Current.ReadSubtree());
                propertyObject.PropertyChanged += property_PropertyChanged;
                ConfigValues.Add(propertyObject.Name, propertyObject);
            }
        }
        private void ReadVersionOne(XPathNavigator nav)
        {
            XPathNavigator iter = nav.SelectSingleNode("/Metadata/ConfigWrapper");
            string isJavaString = iter.GetAttribute("IsJava", String.Empty);
            bool tmpIsJava;
            if (isJavaString != null && bool.TryParse(isJavaString, out tmpIsJava))
            {
                IsJava = tmpIsJava;
            }

            XPathNodeIterator propertyObjectsIterator = nav.Select("/Metadata/ConfigWrapper//PropertyObject");
            while (propertyObjectsIterator.MoveNext())
            {
                ConfigPropertyObject propertyObject = new ConfigPropertyObject();
                propertyObject.ReadXml(propertyObjectsIterator.Current.ReadSubtree());
                propertyObject.PropertyChanged += property_PropertyChanged;
                ConfigValues.Add(propertyObject.Name, propertyObject);
            }
        }
        public void ReadXml(System.Xml.XmlReader reader)
        {
            if (reader == null)
                throw new ArgumentNullException("reader");

            XPathDocument doc = new XPathDocument(reader);
            XPathNavigator nav = doc.CreateNavigator();

            XPathNavigator iter = nav.SelectSingleNode("/ConfigDefinition/IsJava");
            string isJavaString = iter.Value;
            bool tmpIsJava;
            if (isJavaString != null && bool.TryParse(isJavaString, out tmpIsJava))
            {
                IsJava = tmpIsJava;
            }

            XPathNodeIterator propertyObjectsIterator = nav.Select("/ConfigDefinition//PropertyObject");
            while (propertyObjectsIterator.MoveNext())
            {
                ConfigPropertyObject propertyObject = new ConfigPropertyObject();
                propertyObject.ReadXml(propertyObjectsIterator.Current.ReadSubtree());
                Properties.Add(propertyObject.Name, propertyObject);
            }
        }