Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. using GiveawayGrabber.Models;
  2. using GiveawayGrabber.ViewModels;
  3.  
  4. namespace GiveawayGrabber.Logic
  5. {
  6. public interface IGiveawaySite
  7. {
  8. /// <summary>
  9. /// Describing name of the website.
  10. /// </summary>
  11. string Name { get; }
  12.  
  13. /// <summary>
  14. /// Url of the website's homepage.
  15. /// </summary>
  16. string Url { get; }
  17.  
  18. GiveawayViewModel GiveawayViewModel { get; set; }
  19.  
  20. /// <summary>
  21. /// Retrieve all the won giveaways that have not yet been confirmed (i.e. that still need to be activated).
  22. /// </summary>
  23. /// <returns>Array of all the unconfirmed giveaways wins.</returns>
  24. GiveawayModel[] Wins();
  25.  
  26. GiveawayModel[] Giveaways();
  27.  
  28. /// <summary>
  29. /// Check to determine whether or not the given giveaway should be entered or not.
  30. /// </summary>
  31. /// <param name="model">Giveaway that should be entered or not.</param>
  32. /// <returns>True if the gift can be entered, false otherwise.</returns>
  33. bool CanEnter(GiveawayModel model);
  34.  
  35. /// <summary>
  36. /// Enter the given giveaway on the website.
  37. /// </summary>
  38. /// <param name="model">Giveaway to enter.</param>
  39. /// <returns>True if the giveaway was successfully entered, false otherwise.</returns>
  40. bool Enter(GiveawayModel model);
  41.  
  42. /// <summary>
  43. /// Reload all the GiveawaySite's properties by sending a new request to the website and parsing the received response.
  44. /// </summary>
  45. void Refresh();
  46.  
  47. /// <summary>
  48. /// Update the GiveawaySite's properties by parsing the content of the given document string.
  49. /// </summary>
  50. /// <param name="document">Document string of the web response.</param>
  51. /// <param name="page">String description of the source page. Can be used in cases where certain information can only be parsed from certain sites.</param>
  52. void ParseResponse(string document, string page = "");
  53.  
  54. /// <summary>
  55. /// Call the GiveawaySite's sync functionality online.
  56. /// </summary>
  57. /// <returns>True is the online sync functionality was successfully called, false otherwise.</returns>
  58. bool Sync();
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement