ProxySettings.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace FastReport.Messaging
  5. {
  6. /// <summary>
  7. /// Represents proxy settings of the messenger.
  8. /// </summary>
  9. public class ProxySettings
  10. {
  11. #region Fields
  12. private string server;
  13. private int port;
  14. private string username;
  15. private string password;
  16. private ProxyType proxyType;
  17. #endregion // Fields
  18. #region Properties
  19. /// <summary>
  20. /// Gets or sets the proxy server.
  21. /// </summary>
  22. public string Server
  23. {
  24. get { return server; }
  25. set { server = value; }
  26. }
  27. /// <summary>
  28. /// Gets or sets the port number of proxy server.
  29. /// </summary>
  30. public int Port
  31. {
  32. get { return port; }
  33. set { port = value; }
  34. }
  35. /// <summary>
  36. /// Gets or sets the username.
  37. /// </summary>
  38. public string Username
  39. {
  40. get { return username; }
  41. set { username = value; }
  42. }
  43. /// <summary>
  44. /// Gets or sets the user's password.
  45. /// </summary>
  46. public string Password
  47. {
  48. get { return password; }
  49. set { password = value; }
  50. }
  51. /// <summary>
  52. /// Gets or sets the type of proxy.
  53. /// </summary>
  54. public ProxyType ProxyType
  55. {
  56. get { return proxyType; }
  57. set { proxyType = value; }
  58. }
  59. #endregion // Properties
  60. #region Constructors
  61. /// <summary>
  62. /// Initializes a new instance of the <see cref="ProxySettings"/> class.
  63. /// </summary>
  64. /// <param name="server">The proxy server.</param>
  65. /// <param name="port">The port number of server.</param>
  66. /// <param name="username">The username.</param>
  67. /// <param name="password">The user's password.</param>
  68. /// <param name="proxyType">The type of proxy.</param>
  69. public ProxySettings(string server, int port, string username, string password, ProxyType proxyType)
  70. {
  71. this.server = server;
  72. this.port = port;
  73. this.username = username;
  74. this.password = password;
  75. this.proxyType = proxyType;
  76. }
  77. #endregion // Constructors
  78. }
  79. /// <summary>
  80. /// Represents the type of rpoxy.
  81. /// </summary>
  82. public enum ProxyType
  83. {
  84. /// <summary>
  85. /// The HTTP proxy type.
  86. /// </summary>
  87. Http,
  88. /// <summary>
  89. /// The SOCKS4 proxy type.
  90. /// </summary>
  91. Socks4,
  92. /// <summary>
  93. /// The SOCKS5 proxy type.
  94. /// </summary>
  95. Socks5
  96. }
  97. }