using System; using System.Xml; using System.Xml.Serialization; using System.Xml.Schema; namespace FlickrNet { /// /// Summary description for Methods. /// public class Methods { private Methods() { } internal static string[] GetMethods(XmlElement element) { XmlNodeList nodes = element.SelectNodes("method"); string[] _methods = new string[nodes.Count]; for(int i = 0; i < nodes.Count; i++) { _methods[i] = nodes[i].Value; } return _methods; } } /// /// A method supported by the Flickr API. /// /// /// See Flickr API Documentation for a complete list /// of methods. /// [Serializable] public class Method { /// /// Default constructor. /// public Method() { } /// /// The name of the method. /// [XmlAttribute("name", Form=XmlSchemaForm.Unqualified)] public string Name; /// /// The description of the method. /// [XmlElement("description", Form=XmlSchemaForm.Unqualified)] public string Description; /// /// An example response for the method. /// [XmlElement("response", Form=XmlSchemaForm.Unqualified)] public string Response; /// /// An explanation of the example response for the method. /// [XmlElement("explanation", Form=XmlSchemaForm.Unqualified)] public string Explanation; /// /// The arguments of the method. /// [XmlElement("arguments", Form=XmlSchemaForm.Unqualified)] public Arguments Arguments; /// /// The possible errors that could be returned by the method. /// [XmlArray()] [XmlArrayItem("error", typeof(MethodError), Form=XmlSchemaForm.Unqualified)] public MethodError[] Errors; } /// /// An instance containing a collection of instances. /// [Serializable] public class Arguments { /// /// A collection of instances. /// [XmlElement("argument", Form=XmlSchemaForm.Unqualified)] public Argument[] ArgumentCollection; } /// /// An argument for a method. /// [Serializable] public class Argument { /// /// The name of the argument. /// [XmlElement("name")] public string ArgumentName; /// /// Is the argument optional or not. /// [XmlElement("optional")] public int Optional; /// /// The description of the argument. /// [XmlText()] public string ArgumentDescription; } /// /// A possible error that a method can return. /// [Serializable] public class MethodError { /// /// The code for the error. /// [XmlElement("code")] public int Code; } }