Logo Search packages:      
Sourcecode: f-spot version File versions  Download package

Methods.cs

using System;
using System.Xml;
using System.Xml.Serialization;
using System.Xml.Schema;

namespace FlickrNet
{
      /// <summary>
      /// Summary description for Methods.
      /// </summary>
00011       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;
            }
      }

      /// <summary>
      /// A method supported by the Flickr API.
      /// </summary>
      /// <remarks>
      /// See <a href="http://www.flickr.com/services/api">Flickr API Documentation</a> for a complete list
      /// of methods.
      /// </remarks>
      [Serializable]
00037       public class Method
      {
            /// <summary>
            /// Default constructor.
            /// </summary>
00042             public Method()
            {
            }

            /// <summary>
            /// The name of the method.
            /// </summary>
            [XmlAttribute("name", Form=XmlSchemaForm.Unqualified)]
00050             public string Name;

            /// <summary>
            /// The description of the method.
            /// </summary>
            [XmlElement("description", Form=XmlSchemaForm.Unqualified)]
00056             public string Description;

            /// <summary>
            /// An example response for the method.
            /// </summary>
            [XmlElement("response", Form=XmlSchemaForm.Unqualified)]
00062             public string Response;

            /// <summary>
            /// An explanation of the example response for the method.
            /// </summary>
            [XmlElement("explanation", Form=XmlSchemaForm.Unqualified)]
00068             public string Explanation;

            /// <summary>
            /// The arguments of the method.
            /// </summary>
            [XmlElement("arguments", Form=XmlSchemaForm.Unqualified)]
00074             public Arguments Arguments;

            /// <summary>
            /// The possible errors that could be returned by the method.
            /// </summary>
            [XmlArray()]
            [XmlArrayItem("error", typeof(MethodError), Form=XmlSchemaForm.Unqualified)]
00081             public MethodError[] Errors;

      }

      /// <summary>
      /// An instance containing a collection of <see cref="Argument"/> instances.
      /// </summary>
      [Serializable]
00089       public class Arguments
      {
            /// <summary>
            /// A collection of <see cref="Argument"/> instances.
            /// </summary>
            [XmlElement("argument", Form=XmlSchemaForm.Unqualified)]
00095             public Argument[] ArgumentCollection;
      }

      /// <summary>
      /// An argument for a method.
      /// </summary>
      [Serializable]
00102       public class Argument
      {
            /// <summary>
            /// The name of the argument.
            /// </summary>
            [XmlElement("name")]
00108             public string ArgumentName;

            /// <summary>
            /// Is the argument optional or not.
            /// </summary>
            [XmlElement("optional")]
00114             public int Optional;

            /// <summary>
            /// The description of the argument.
            /// </summary>
            [XmlText()]
00120             public string ArgumentDescription;
      }

      /// <summary>
      /// A possible error that a method can return.
      /// </summary>
      [Serializable]
00127       public class MethodError
      {
            /// <summary>
            /// The code for the error.
            /// </summary>
            [XmlElement("code")]
00133             public int Code;

      }
}

Generated by  Doxygen 1.6.0   Back to index