Inheritance: XMLMember
コード例 #1
0
        public static void PopulateMethodList(XMLMethods methods, List <CompNamed> method_list)
        {
            foreach (object key in methods.keys.Keys)
            {
                XMLMethods.SignatureFlags signatureFlags = (methods.signatureFlags != null &&
                                                            methods.signatureFlags.ContainsKey(key) ?
                                                            (XMLMethods.SignatureFlags)methods.signatureFlags [key] :
                                                            XMLMethods.SignatureFlags.None);

                XMLParameters parameters = (methods.parameters == null ? null
                                                            : (XMLParameters)methods.parameters[key]);
                XMLGenericParameters genericParameters = (methods.genericParameters == null ? null
                                                                                  : (XMLGenericParameters)methods.genericParameters[key]);
                XMLAttributes attributes = (methods.attributeMap == null ? null
                                                            : (XMLAttributes)methods.attributeMap[key]);
                string returnType = (methods.returnTypes == null ? null
                                                     : (string)methods.returnTypes[key]);
                method_list.Add(new MasterMethod((string)methods.keys[key],
                                                 signatureFlags,
                                                 returnType,
                                                 parameters,
                                                 genericParameters,
                                                 methods.ConvertToString(Int32.Parse((string)methods.access[key])),
                                                 attributes));
            }
        }
コード例 #2
0
ファイル: MasterMetadata.cs プロジェクト: mono/mono-tools
		public static void PopulateMethodList (XMLMethods methods, List<CompNamed> method_list)
		{
			foreach (object key in methods.keys.Keys) {
				XMLMethods.SignatureFlags signatureFlags = (methods.signatureFlags != null &&
				                                            methods.signatureFlags.ContainsKey (key) ?
				                                            (XMLMethods.SignatureFlags) methods.signatureFlags [key] :
				                                            XMLMethods.SignatureFlags.None);

				XMLParameters parameters = (methods.parameters == null ? null
				                            : (XMLParameters)methods.parameters[key]);
				XMLGenericParameters genericParameters = (methods.genericParameters == null ? null
				                                                  : (XMLGenericParameters)methods.genericParameters[key]);
				XMLAttributes attributes = (methods.attributeMap == null ? null
				                            : (XMLAttributes)methods.attributeMap[key]);
				string returnType = (methods.returnTypes == null ? null
				                     : (string)methods.returnTypes[key]);
				method_list.Add (new MasterMethod ((string)methods.keys[key],
				                                   signatureFlags,
				                                   returnType,
				                                   parameters,
				                                   genericParameters,
				                                   methods.ConvertToString (Int32.Parse ((string)methods.access[key])),
				                                   attributes));
			}
		}
コード例 #3
0
        public MasterProperty(string key, string propertyAccess, XMLMethods xml_methods, XMLAttributes attributes)
            : base(FormatName(key))
        {
            string[] keyparts = key.Split(new char[] { ':' }, 3);

            this.propertyType   = keyparts[1];
            this.propertyAccess = propertyAccess;

            methods = new List <CompNamed>();

            MasterUtils.PopulateMethodList(xml_methods, methods);
            this.attributes = attributes;
        }
コード例 #4
0
        protected override void LoadExtraData(string name, XmlNode node)
        {
            XmlNode orig = node;

            node = node.FirstChild;
            while (node != null)
            {
                if (node != null && node.Name == "methods")
                {
                    XMLMethods m      = new XMLMethods();
                    XmlNode    parent = node.ParentNode;
                    string     key    = GetNodeKey(name, parent);
                    m.LoadData(node);
                    nameToMethod [key] = m;
                    break;
                }
                node = node.NextSibling;
            }


            base.LoadExtraData(name, orig);
        }
コード例 #5
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));
        }
コード例 #6
0
        public MasterProperty(string key, string propertyAccess, XMLMethods xml_methods, XMLAttributes attributes)
            : base(FormatName (key))
        {
            string[] keyparts = key.Split(new char[] {':'}, 3);

            this.propertyType = keyparts[1];
            this.propertyAccess = propertyAccess;

            methods = new List<CompNamed>();

            MasterUtils.PopulateMethodList (xml_methods, methods);
            this.attributes = attributes;
        }
コード例 #7
0
        public MasterMethod(string name,
		                     XMLMethods.SignatureFlags signatureFlags,
		                     string returnType,
		                     XMLParameters parameters,
		                     XMLGenericParameters genericParameters,
		                     string methodAccess,
		                     XMLAttributes attributes)
            : base(String.Format ("{0} {1}", returnType, name))
        {
            this.signatureFlags = signatureFlags;
            this.returnType = returnType;
            this.parameters = parameters;
            this.genericParameters = genericParameters;
            // we don't care about the Assembly (internal) part
            this.methodAccess = methodAccess.Replace ("FamORAssem", "Family");
            this.attributes = attributes;
        }
コード例 #8
0
ファイル: Masterinfo.cs プロジェクト: nolanlum/mono-tools
		protected override void LoadExtraData (string name, XmlNode node)
		{
			XmlNode orig = node;
			node = node.FirstChild;
			while (node != null) {
				if (node != null && node.Name == "methods") {
					XMLMethods m = new XMLMethods ();
					XmlNode parent = node.ParentNode;
					string key = GetNodeKey (name, parent);
					m.LoadData (node);
					nameToMethod [key] = m;
					break;
				}
				node = node.NextSibling;
			}


			base.LoadExtraData (name, orig);
		}
コード例 #9
0
ファイル: Masterinfo.cs プロジェクト: nolanlum/mono-tools
		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));
		}