The easy to use and full featured Irc Bot everyone is talking about!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ServerConfig.cs 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Net;
  6. using System.Threading.Tasks;
  7. using Combot.Modules;
  8. namespace Combot.Configurations
  9. {
  10. public class ServerConfig
  11. {
  12. public event Action ModifyEvent;
  13. public ServerConfig()
  14. {
  15. SetDefaults();
  16. }
  17. public void SetDefaults()
  18. {
  19. AutoConnect = false;
  20. CommandPrefix = string.Empty;
  21. Channels = new List<ChannelConfig>();
  22. Modules = new List<Module>();
  23. Hosts = new List<HostConfig>();
  24. Nickname = string.Empty;
  25. Realname = string.Empty;
  26. Username = string.Empty;
  27. }
  28. public void Save()
  29. {
  30. if (ModifyEvent != null)
  31. {
  32. ModifyEvent();
  33. }
  34. }
  35. private string _Name;
  36. public string Name
  37. {
  38. get
  39. {
  40. return _Name;
  41. }
  42. set
  43. {
  44. if (_Name != value)
  45. {
  46. _Name = value;
  47. }
  48. }
  49. }
  50. private string _Nickname;
  51. public string Nickname
  52. {
  53. get
  54. {
  55. return _Nickname;
  56. }
  57. set
  58. {
  59. if (_Nickname != value)
  60. {
  61. _Nickname = value;
  62. }
  63. }
  64. }
  65. private string _Username;
  66. public string Username
  67. {
  68. get
  69. {
  70. return _Username;
  71. }
  72. set
  73. {
  74. if (_Username != value)
  75. {
  76. _Username = value;
  77. }
  78. }
  79. }
  80. private string _Realname;
  81. public string Realname
  82. {
  83. get
  84. {
  85. return _Realname;
  86. }
  87. set
  88. {
  89. if (_Realname != value)
  90. {
  91. _Realname = value;
  92. }
  93. }
  94. }
  95. private string _CommandPrefix;
  96. public string CommandPrefix
  97. {
  98. get
  99. {
  100. return _CommandPrefix;
  101. }
  102. set
  103. {
  104. if (_CommandPrefix != value)
  105. {
  106. _CommandPrefix = value;
  107. }
  108. }
  109. }
  110. private bool _AutoConnect;
  111. public bool AutoConnect
  112. {
  113. get
  114. {
  115. return _AutoConnect;
  116. }
  117. set
  118. {
  119. if (_AutoConnect != value)
  120. {
  121. _AutoConnect = value;
  122. }
  123. }
  124. }
  125. private List<HostConfig> _Hosts;
  126. public List<HostConfig> Hosts
  127. {
  128. get
  129. {
  130. return _Hosts;
  131. }
  132. set
  133. {
  134. if (_Hosts != value)
  135. {
  136. _Hosts = value;
  137. }
  138. }
  139. }
  140. private List<ChannelConfig> _Channels;
  141. public List<ChannelConfig> Channels
  142. {
  143. get
  144. {
  145. return _Channels;
  146. }
  147. set
  148. {
  149. if (_Channels != value)
  150. {
  151. _Channels = value;
  152. }
  153. }
  154. }
  155. private List<Module> _Modules;
  156. public List<Module> Modules
  157. {
  158. get
  159. {
  160. return _Modules;
  161. }
  162. set
  163. {
  164. if (_Modules != value)
  165. {
  166. _Modules = value;
  167. }
  168. }
  169. }
  170. }
  171. }