Beispiel #1
0
        protected override void LoadExtraData(string name, XmlNode node)
        {
            XmlAttribute xatt = node.Attributes ["attrib"];

            if (xatt != null)
            {
                access [name] = xatt.Value;
            }

            XmlNode orig = node;

            node = node.FirstChild;
            while (node != null)
            {
                if (node != null && node.Name == "attributes")
                {
                    XMLAttributes a = new XMLAttributes();
                    a.LoadData(node);
                    if (attributeMap == null)
                    {
                        attributeMap = new Hashtable();
                    }

                    attributeMap [name] = a;
                    break;
                }
                node = node.NextSibling;
            }

            base.LoadExtraData(name, orig);
        }
Beispiel #2
0
        public override void LoadData(XmlNode node)
        {
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            name    = node.Attributes ["name"].Value;
            version = node.Attributes  ["version"].Value;
            XmlNode atts = node.FirstChild;

            attributes = new XMLAttributes();
            if (atts.Name == "attributes")
            {
                attributes.LoadData(atts);
                atts = atts.NextSibling;
            }

            if (atts == null || atts.Name != "namespaces")
            {
                Console.Error.WriteLine("Warning: no namespaces found!");
                return;
            }

            namespaces = (XMLNamespace [])LoadRecursive(atts.ChildNodes, typeof(XMLNamespace));
        }
Beispiel #3
0
        public override void LoadData(XmlNode node)
        {
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            if (node.Name != "parameter")
            {
                throw new ArgumentException("Expecting <parameter>");
            }

            name   = node.Attributes["name"].Value;
            type   = node.Attributes["type"].Value;
            attrib = node.Attributes["attrib"].Value;
            if (node.Attributes ["direction"] != null)
            {
                direction = node.Attributes["direction"].Value;
            }
            if (node.Attributes["unsafe"] != null)
            {
                isUnsafe = bool.Parse(node.Attributes["unsafe"].Value);
            }
            if (node.Attributes["optional"] != null)
            {
                isOptional = bool.Parse(node.Attributes["optional"].Value);
            }
            if (node.Attributes["defaultValue"] != null)
            {
                defaultValue = node.Attributes["defaultValue"].Value;
            }

            XmlNode child = node.FirstChild;

            if (child == null)
            {
                return;
            }

            if (child.Name == "attributes")
            {
                attributes = new XMLAttributes();
                attributes.LoadData(child);
                child = child.NextSibling;
            }
        }
Beispiel #4
0
        public override void LoadData(XmlNode node)
        {
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            name = node.Attributes ["name"].Value;
            type = node.Attributes  ["type"].Value;
            XmlAttribute xatt = node.Attributes ["base"];

            if (xatt != null)
            {
                baseName = xatt.Value;
            }

            xatt     = node.Attributes ["sealed"];
            isSealed = (xatt != null && xatt.Value == "true");

            xatt       = node.Attributes ["abstract"];
            isAbstract = (xatt != null && xatt.Value == "true");

            xatt           = node.Attributes["serializable"];
            isSerializable = (xatt != null && xatt.Value == "true");

            xatt = node.Attributes["charset"];
            if (xatt != null)
            {
                charSet = xatt.Value;
            }

            xatt = node.Attributes["layout"];
            if (xatt != null)
            {
                layout = xatt.Value;
            }

            XmlNode child = node.FirstChild;

            if (child == null)
            {
                // Console.Error.WriteLine ("Empty class {0} {1}", name, type);
                return;
            }

            if (child.Name == "attributes")
            {
                attributes = new XMLAttributes();
                attributes.LoadData(child);
                child = child.NextSibling;
            }

            if (child != null && child.Name == "interfaces")
            {
                interfaces = new XMLInterfaces();
                interfaces.LoadData(child);
                child = child.NextSibling;
            }

            if (child != null && child.Name == "generic-parameters")
            {
                genericParameters = new XMLGenericParameters();
                genericParameters.LoadData(child);
                child = child.NextSibling;
            }

            if (child != null && child.Name == "fields")
            {
                fields = new XMLFields();
                fields.LoadData(child);
                child = child.NextSibling;
            }

            if (child != null && child.Name == "constructors")
            {
                constructors = new XMLConstructors();
                constructors.LoadData(child);
                child = child.NextSibling;
            }

            if (child != null && child.Name == "properties")
            {
                properties = new XMLProperties();
                properties.LoadData(child);
                child = child.NextSibling;
            }

            if (child != null && child.Name == "events")
            {
                events = new XMLEvents();
                events.LoadData(child);
                child = child.NextSibling;
            }

            if (child != null && child.Name == "methods")
            {
                methods = new XMLMethods();
                methods.LoadData(child);
                child = child.NextSibling;
            }

            if (child == null)
            {
                return;
            }

            if (child.Name != "classes")
            {
                Console.WriteLine("name: {0} type: {1} {2}", name, type, child.NodeType);
                throw new FormatException("Expecting <classes>. Got <" + child.Name + ">");
            }

            nested = (XMLClass [])LoadRecursive(child.ChildNodes, typeof(XMLClass));
        }
Beispiel #5
0
		protected override void LoadExtraData (string name, XmlNode node)
		{
			XmlAttribute xatt = node.Attributes ["attrib"];
			if (xatt != null)
				access [name] = xatt.Value;
			
			XmlNode orig = node;

			node = node.FirstChild;
			while (node != null) {
				if (node != null && node.Name == "attributes") {
					XMLAttributes a = new XMLAttributes ();
					a.LoadData (node);
					if (attributeMap == null)
						attributeMap = new Hashtable ();

					attributeMap [name] = a;
					break;
				}
				node = node.NextSibling;
			}

			base.LoadExtraData (name, orig);
		}
Beispiel #6
0
		public override void LoadData (XmlNode node)
		{
			if (node == null)
				throw new ArgumentNullException ("node");

			if (node.Name != "parameter")
				throw new ArgumentException ("Expecting <parameter>");

			name = node.Attributes["name"].Value;
			type = node.Attributes["type"].Value;
			attrib = node.Attributes["attrib"].Value;
			if (node.Attributes ["direction"] != null)
				direction = node.Attributes["direction"].Value;
			if (node.Attributes["unsafe"] != null)
				isUnsafe = bool.Parse (node.Attributes["unsafe"].Value);
			if (node.Attributes["optional"] != null)
				isOptional = bool.Parse (node.Attributes["optional"].Value);
			if (node.Attributes["defaultValue"] != null)
				defaultValue = node.Attributes["defaultValue"].Value;

			XmlNode child = node.FirstChild;
			if (child == null)
				return;

			if (child.Name == "attributes") {
				attributes = new XMLAttributes ();
				attributes.LoadData (child);
				child = child.NextSibling;
			}
		}
Beispiel #7
0
		public override void LoadData (XmlNode node)
		{
			if (node == null)
				throw new ArgumentNullException ("node");

			name = node.Attributes ["name"].Value;
			type = node.Attributes  ["type"].Value;
			XmlAttribute xatt = node.Attributes ["base"];
			if (xatt != null)
				baseName = xatt.Value;

			xatt = node.Attributes ["sealed"];
			isSealed = (xatt != null && xatt.Value == "true");

			xatt = node.Attributes ["abstract"];
			isAbstract = (xatt != null && xatt.Value == "true");

			xatt = node.Attributes["serializable"];
			isSerializable = (xatt != null && xatt.Value == "true");

			xatt = node.Attributes["charset"];
			if (xatt != null)
				charSet = xatt.Value;

			xatt = node.Attributes["layout"];
			if (xatt != null)
				layout = xatt.Value;

			XmlNode child = node.FirstChild;
			if (child == null) {
				// Console.Error.WriteLine ("Empty class {0} {1}", name, type);
				return;
			}
				
			if (child.Name == "attributes") {
				attributes = new XMLAttributes ();
				attributes.LoadData (child);
				child = child.NextSibling;
			}

			if (child != null && child.Name == "interfaces") {
				interfaces = new XMLInterfaces ();
				interfaces.LoadData (child);
				child = child.NextSibling;
			}

			if (child != null && child.Name == "generic-parameters") {
				genericParameters = new XMLGenericParameters ();
				genericParameters.LoadData (child);
				child = child.NextSibling;
			}

			if (child != null && child.Name == "fields") {
				fields = new XMLFields ();
				fields.LoadData (child);
				child = child.NextSibling;
			}

			if (child != null && child.Name == "constructors") {
				constructors = new XMLConstructors ();
				constructors.LoadData (child);
				child = child.NextSibling;
			}

			if (child != null && child.Name == "properties") {
				properties = new XMLProperties ();
				properties.LoadData (child);
				child = child.NextSibling;
			}

			if (child != null && child.Name == "events") {
				events = new XMLEvents ();
				events.LoadData (child);
				child = child.NextSibling;
			}

			if (child != null && child.Name == "methods") {
				methods = new XMLMethods ();
				methods.LoadData (child);
				child = child.NextSibling;
			}

			if (child == null)
				return;

			if (child.Name != "classes") {
				Console.WriteLine ("name: {0} type: {1} {2}", name, type, child.NodeType);
				throw new FormatException ("Expecting <classes>. Got <" + child.Name + ">");
			}

			nested = (XMLClass []) LoadRecursive (child.ChildNodes, typeof (XMLClass));
		}
Beispiel #8
0
		public override void LoadData (XmlNode node)
		{
			if (node == null)
				throw new ArgumentNullException ("node");

			name = node.Attributes ["name"].Value;
			version = node.Attributes  ["version"].Value;
			XmlNode atts = node.FirstChild;
			attributes = new XMLAttributes ();
			if (atts.Name == "attributes") {
				attributes.LoadData (atts);
				atts = atts.NextSibling;
			}

			if (atts == null || atts.Name != "namespaces") {
				Console.Error.WriteLine ("Warning: no namespaces found!");
				return;
			}

			namespaces = (XMLNamespace []) LoadRecursive (atts.ChildNodes, typeof (XMLNamespace));
		}