Esempio n. 1
0
        private IList<Method> ParseMethods(XmlNodeList xmlMethods)
        {
            IList<Method> methods = new List<Method>();

            if (xmlMethods == null) {
                return methods;
            }

            for (int i = 0; i < xmlMethods.Count; i++) {
                XmlNode xmlMethod = xmlMethods[i];

                Method method = new Method();
                method.Name = GetAttributeStringValue(xmlMethod, "name");
                method.ReturnType = GetAttributeStringValue(xmlMethod, "return");
                method.Description = GetNodeInnerXml(xmlMethod, "desc");
                method.Arguments = ParseArguments(GetNodeList(xmlMethod, "argument"));
                method.Signatures = ParseSignatures(GetNodeList(xmlMethod, "signature"));

                methods.Add(method);
            }

            return methods;
        }
Esempio n. 2
0
        private IList<Method> ParseMethods(XmlNodeList xmlMethods)
        {
            IList<Method> methods = new List<Method>();

            if (xmlMethods == null) {
                return methods;
            }

            for (int i = 0; i < xmlMethods.Count; i++) {
                XmlNode xmlMethod = xmlMethods[i];
                Method method = new Method();
                if (xmlMethod.Name == "method") {
                    method.Name = GetAttributeStringValue(xmlMethod, "name");
                    method.ReturnType = GetAttributeStringValue(xmlMethod, "return");
                    method.Description = GetNodeInnerXml(xmlMethod, "desc");
                    method.Arguments = ParseArguments(GetNodeList(xmlMethod, "argument"));
                    method.Signatures = ParseSignatures(GetNodeList(xmlMethod, "signature"));
                }
                else if (xmlMethod.Name == "widget-inherit") {
                    var id = xmlMethod.Attributes["id"].Value;
                    Debug.Assert(id.StartsWith("widget-"));
                    var origMethod = Widget.Methods.SingleOrDefault(m => m.Name == id.Substring(7));
                    if (origMethod == null)
                        continue;
                    method.Name = origMethod.Name;
                    method.ReturnType = origMethod.ReturnType;
                    method.Description = origMethod.Description;
                    method.Arguments = origMethod.Arguments;
                    method.Signatures = origMethod.Signatures;
                }
                methods.Add(method);
            }

            return methods;
        }