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.

107 lines
3.7 KiB

4 years ago
  1. // Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
  2. //
  3. // MySQL Connector/NET is licensed under the terms of the GPLv2
  4. // <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
  5. // MySQL Connectors. There are special exceptions to the terms and
  6. // conditions of the GPLv2 as it is applied to this software, see the
  7. // FLOSS License Exception
  8. // <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
  9. //
  10. // This program is free software; you can redistribute it and/or modify
  11. // it under the terms of the GNU General Public License as published
  12. // by the Free Software Foundation; version 2 of the License.
  13. //
  14. // This program is distributed in the hope that it will be useful, but
  15. // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  16. // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  17. // for more details.
  18. //
  19. // You should have received a copy of the GNU General Public License along
  20. // with this program; if not, write to the Free Software Foundation, Inc.,
  21. // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  22. #if MYSQL_6_9
  23. using System;
  24. using System.Collections.Generic;
  25. using System.Configuration;
  26. using System.Text;
  27. namespace Externals.MySql.Data.MySqlClient
  28. {
  29. /// <summary>
  30. /// Used to define a Replication configurarion element in configuration file
  31. /// </summary>
  32. internal sealed class ReplicationConfigurationElement : ConfigurationElement
  33. {
  34. [ConfigurationProperty("ServerGroups", IsRequired = true)]
  35. [ConfigurationCollection(typeof(ReplicationServerGroupConfigurationElement), AddItemName = "Group")]
  36. public GenericConfigurationElementCollection<ReplicationServerGroupConfigurationElement> ServerGroups
  37. {
  38. get { return (GenericConfigurationElementCollection<ReplicationServerGroupConfigurationElement>)this["ServerGroups"]; }
  39. }
  40. }
  41. /// <summary>
  42. /// Used to define a Replication server group in configuration file
  43. /// </summary>
  44. internal sealed class ReplicationServerGroupConfigurationElement : ConfigurationElement
  45. {
  46. [ConfigurationProperty("name", IsRequired = true)]
  47. public string Name
  48. {
  49. get { return (string)this["name"]; }
  50. set { this["name"] = value; }
  51. }
  52. [ConfigurationProperty("groupType", IsRequired = false)]
  53. public string GroupType
  54. {
  55. get { return (string)this["groupType"]; }
  56. set { this["groupType"] = value; }
  57. }
  58. [ConfigurationProperty("retryTime", IsRequired = false, DefaultValue = 60)]
  59. public int RetryTime
  60. {
  61. get { return (int)this["retryTime"]; }
  62. set { this["retryTime"] = value; }
  63. }
  64. [ConfigurationProperty("Servers")]
  65. [ConfigurationCollection(typeof(ReplicationServerConfigurationElement), AddItemName = "Server")]
  66. public GenericConfigurationElementCollection<ReplicationServerConfigurationElement> Servers
  67. {
  68. get { return (GenericConfigurationElementCollection<ReplicationServerConfigurationElement>)this["Servers"]; }
  69. }
  70. }
  71. /// <summary>
  72. /// Defines a Replication server in configuration file
  73. /// </summary>
  74. internal sealed class ReplicationServerConfigurationElement : ConfigurationElement
  75. {
  76. [ConfigurationProperty("name", IsRequired = true)]
  77. public string Name
  78. {
  79. get { return (string)this["name"]; }
  80. set { this["name"] = value; }
  81. }
  82. [ConfigurationProperty("IsMaster", IsRequired = false, DefaultValue = false)]
  83. public bool IsMaster
  84. {
  85. get { return (bool)this["IsMaster"]; }
  86. set { this["IsMaster"] = value; }
  87. }
  88. [ConfigurationProperty("connectionstring", IsRequired = true)]
  89. public string ConnectionString
  90. {
  91. get { return (string)this["connectionstring"]; }
  92. set { this["connectionstring"] = value; }
  93. }
  94. }
  95. }
  96. #endif