Advertisement
cansik

TM Random Pic

Jun 10th, 2011
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.08 KB | None | 0 0
  1. /// <summary>
  2.         /// Returns a random picture of TM
  3.         /// </summary>
  4.         /// <param name="token">User authentification token</param>
  5.         /// <returns>GalleryPicture with filled informations</returns>
  6.         public static GalleryPicture GetRandomPic(string token)
  7.         {
  8.             return GetRandomPic(token, Gender.Empty);
  9.         }
  10.        
  11.         /// <summary>
  12.         /// Returns a random picture of TM
  13.         /// </summary>
  14.         /// <param name="token">User authentification token</param>
  15.         /// <param name="filter">Specify if just random pics from male or female returns</param>
  16.         /// <returns>GalleryPicture with filled informations</returns>
  17.         public static GalleryPicture GetRandomPic(string token, Gender filter)
  18.         {
  19.             //Fill API Data
  20.             ApiCall call = new ApiCall("getRandomPic");
  21.             call.Parameter.Add("token", token);
  22.            
  23.             //check for gender
  24.             if (filter != Gender.Empty)
  25.             {
  26.                 call.Parameter.Add("gender", filter.ToString());
  27.             }
  28.             call.PostRequest = POSTRequest;
  29.            
  30.             //Handle Request
  31.             XmlDocument memberdata = CallNativeApiFunction(call);
  32.             return ServiceFunctions.FillGalleryPictureData(memberdata.SelectSingleNode("pic"));
  33.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement