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

XmlElement [] FlickrNet::Flickr::TestEcho ( string  echoParameter,
string  echoValue 
) [inline]

Runs the flickr.test.echo method and returned an array of XmlElement items.

Parameters:
echoParameter The parameter to pass to the method.
echoValue The value to pass to the method with the parameter.
Returns:
An array of XmlElement items.

The APi Key has been removed from the returned array and will not be shown.

                XmlElement[] elements = flickr.TestEcho("&param=value");
                foreach(XmlElement element in elements)
                {
                        if( element.Name = "method" )
                              Console.WriteLine("Method = " + element.InnerXml);
                        if( element.Name = "param" )
                              Console.WriteLine("Param = " + element.InnerXml);
                }

Definition at line 2870 of file Flickr.cs.

            {
                  NameValueCollection parameters = new NameValueCollection();
                  parameters.Add("method", "flickr.test.echo");
                  parameters.Add("api_key", _apiKey);
                  if( echoParameter != null && echoParameter.Length > 0 )
                  {
                        parameters.Add(echoParameter, echoValue);
                  }

                  FlickrNet.Response response = GetResponseCache(parameters);

                  if( response.Status == ResponseStatus.OK )
                  {
                        // Remove the api_key element from the array.
                        XmlElement[] elements = new XmlElement[response.AllElements.Length - 1];
                        int c = 0;
                        foreach(XmlElement element in response.AllElements)
                        {
                              if(element.Name != "api_key" )
                                    elements[c++] = element;
                        }
                        return elements;
                  }
                  else
                  {
                        throw new FlickrException(response.Error);
                  }
            }


Generated by  Doxygen 1.6.0   Back to index