FlickrNet.Flickr.NotesAdd C# (CSharp) Method

NotesAdd() public method

Add a note to a picture.
public NotesAdd ( string photoId, int noteX, int noteY, int noteWidth, int noteHeight, string noteText ) : string
photoId string The photo id to add the note to.
noteX int The X co-ordinate of the upper left corner of the note.
noteY int The Y co-ordinate of the upper left corner of the note.
noteWidth int The width of the note.
noteHeight int The height of the note.
noteText string The text in the note.
return string
        public string NotesAdd(string photoId, int noteX, int noteY, int noteWidth, int noteHeight, string noteText)
        {
            Hashtable parameters = new Hashtable();
            parameters.Add("method", "flickr.photos.notes.add");
            parameters.Add("photo_id", photoId);
            parameters.Add("note_x", noteX.ToString());
            parameters.Add("note_y", noteY.ToString());
            parameters.Add("note_w", noteWidth.ToString());
            parameters.Add("note_h", noteHeight.ToString());
            parameters.Add("note_text", noteText);

            FlickrNet.Response response = GetResponseCache(parameters);

            if( response.Status == ResponseStatus.OK )
            {
                foreach(XmlElement element in response.AllElements)
                {
                    return element.Attributes["id", ""].Value;
                }
                return string.Empty;
            }
            else
            {
                throw new FlickrException(response.Error);
            }
        }
Flickr