FlickrNet.Flickr.TestEcho C# (CSharp) Method

TestEcho() public method

Runs the flickr.test.echo method and returned an array of XmlElement items.
The APi Key has been removed from the returned array and will not be shown.
public TestEcho ( string echoParameter, string echoValue ) : XmlElement[]
echoParameter string The parameter to pass to the method.
echoValue string The value to pass to the method with the parameter.
return XmlElement[]
        public XmlElement[] TestEcho(string echoParameter, string echoValue)
        {
            Hashtable parameters = new Hashtable();
            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);
            }
        }
Flickr