Exemplo n.º 1
0
 static MySqlConnectionStringBuilder()
 {
     MySqlConnectionStringBuilder.options = new MySqlConnectionStringOptionCollection();
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("server", "host,data source,datasource,address,addr,network address", typeof(string), "", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("database", "initial catalog", typeof(string), string.Empty, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("protocol", "connection protocol, connectionprotocol", typeof(MySqlConnectionProtocol), MySqlConnectionProtocol.Sockets, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("port", null, typeof(uint), 3306u, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("pipe", "pipe name,pipename", typeof(string), "MYSQL", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("compress", "use compression,usecompression", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("allowbatch", "allow batch", typeof(bool), true, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("logging", null, typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("sharedmemoryname", "shared memory name", typeof(string), "MYSQL", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("useoldsyntax", "old syntax,oldsyntax,use old syntax", typeof(bool), false, true, delegate(MySqlConnectionStringBuilder msb, MySqlConnectionStringOption sender, object value)
     {
         MySqlTrace.LogWarning(-1, "Use Old Syntax is now obsolete.  Please see documentation");
         msb.SetValue("useoldsyntax", value);
     }, (MySqlConnectionStringBuilder msb, MySqlConnectionStringOption sender) => (bool)msb.values["useoldsyntax"]));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("connectiontimeout", "connection timeout,connect timeout", typeof(uint), 15u, false, delegate(MySqlConnectionStringBuilder msb, MySqlConnectionStringOption sender, object Value)
     {
         uint num  = (uint)Convert.ChangeType(Value, sender.BaseType);
         uint num2 = Math.Min(num, 2147483u);
         if (num2 != num)
         {
             MySqlTrace.LogWarning(-1, string.Concat(new object[]
             {
                 "Connection timeout value too large (",
                 num,
                 " seconds). Changed to max. possible value",
                 num2,
                 " seconds)"
             }));
         }
         msb.SetValue("connectiontimeout", num2);
     }, (MySqlConnectionStringBuilder msb, MySqlConnectionStringOption sender) => (uint)msb.values["connectiontimeout"]));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("defaultcommandtimeout", "command timeout,default command timeout", typeof(uint), 30u, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("usedefaultcommandtimeoutforef", "use default command timeout for ef", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("user id", "uid,username,user name,user,userid", typeof(string), "", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("password", "pwd", typeof(string), "", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("persistsecurityinfo", "persist security info", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("encrypt", null, typeof(bool), false, true, delegate(MySqlConnectionStringBuilder msb, MySqlConnectionStringOption sender, object value)
     {
         sender.ValidateValue(ref value);
         MySqlTrace.LogWarning(-1, "Encrypt is now obsolete. Use Ssl Mode instead");
         msb.SetValue("Ssl Mode", ((bool)value) ? MySqlSslMode.Preferred : MySqlSslMode.None);
     }, (MySqlConnectionStringBuilder msb, MySqlConnectionStringOption sender) => msb.SslMode != MySqlSslMode.None));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("certificatefile", "certificate file", typeof(string), null, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("certificatepassword", "certificate password", typeof(string), null, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("certificatestorelocation", "certificate store location", typeof(MySqlCertificateStoreLocation), MySqlCertificateStoreLocation.None, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("certificatethumbprint", "certificate thumb print", typeof(string), null, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("integratedsecurity", "integrated security", typeof(bool), false, false, delegate(MySqlConnectionStringBuilder msb, MySqlConnectionStringOption sender, object value)
     {
         if (!Platform.IsWindows())
         {
             throw new MySqlException("IntegratedSecurity is supported on Windows only");
         }
         msb.SetValue("Integrated Security", value);
     }, delegate(MySqlConnectionStringBuilder msb, MySqlConnectionStringOption sender)
     {
         object obj = msb.values["Integrated Security"];
         return((bool)obj);
     }));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("allowzerodatetime", "allow zero datetime", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("convertzerodatetime", "convert zero datetime", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("useusageadvisor", "use usage advisor,usage advisor", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("procedurecachesize", "procedure cache size,procedure cache,procedurecache", typeof(uint), 25u, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("useperformancemonitor", "use performance monitor,useperfmon,perfmon", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("ignoreprepare", "ignore prepare", typeof(bool), true, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("useprocedurebodies", "use procedure bodies,procedure bodies", typeof(bool), true, true, delegate(MySqlConnectionStringBuilder msb, MySqlConnectionStringOption sender, object value)
     {
         sender.ValidateValue(ref value);
         MySqlTrace.LogWarning(-1, "Use Procedure Bodies is now obsolete.  Use Check Parameters instead");
         msb.SetValue("checkparameters", value);
         msb.SetValue("useprocedurebodies", value);
     }, (MySqlConnectionStringBuilder msb, MySqlConnectionStringOption sender) => (bool)msb.values["useprocedurebodies"]));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("autoenlist", "auto enlist", typeof(bool), true, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("respectbinaryflags", "respect binary flags", typeof(bool), true, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("treattinyasboolean", "treat tiny as boolean", typeof(bool), true, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("allowuservariables", "allow user variables", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("interactivesession", "interactive session,interactive", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("functionsreturnstring", "functions return string", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("useaffectedrows", "use affected rows", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("oldguids", "old guids", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("keepalive", "keep alive", typeof(uint), 0u, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("sqlservermode", "sql server mode", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("tablecaching", "table cache,tablecache", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("defaulttablecacheage", "default table cache age", typeof(int), 0, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("checkparameters", "check parameters", typeof(bool), true, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("replication", null, typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("exceptioninterceptors", "exception interceptors", typeof(string), null, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("commandinterceptors", "command interceptors", typeof(string), null, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("includesecurityasserts", "include security asserts", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("connectionlifetime", "connection lifetime", typeof(uint), 0u, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("pooling", null, typeof(bool), true, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("minpoolsize", "min pool size,minimum pool size", typeof(uint), 0u, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("maxpoolsize", "max pool size,maximum pool size", typeof(uint), 1000u, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("connectionreset", "connection reset", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("cacheserverproperties", "cache server properties", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("characterset", "character set,charset", typeof(string), "", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("treatblobsasutf8", "treat blobs as utf8", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("blobasutf8includepattern", null, typeof(string), "", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("blobasutf8excludepattern", null, typeof(string), "", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("sslmode", "ssl mode", typeof(MySqlSslMode), MySqlSslMode.None, false));
 }
 static MySqlConnectionStringBuilder()
 {
     MySqlConnectionStringBuilder.options = new MySqlConnectionStringOptionCollection();
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("server", "host,data source,datasource,address,addr,network address", typeof(string), "", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("database", "initial catalog", typeof(string), string.Empty, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("protocol", "connection protocol, connectionprotocol", typeof(MySqlConnectionProtocol), MySqlConnectionProtocol.Sockets, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("port", null, typeof(uint), 3306u, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("pipe", "pipe name,pipename", typeof(string), "MYSQL", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("compress", "use compression,usecompression", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("allowbatch", "allow batch", typeof(bool), true, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("logging", null, typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("sharedmemoryname", "shared memory name", typeof(string), "MYSQL", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("useoldsyntax", "old syntax,oldsyntax,use old syntax", typeof(bool), false, true, new MySqlConnectionStringOption.SetterDelegate(MySqlConnectionStringBuilder.MySqlConnectionStringBuilderSealedClass.instance.SetValue), new MySqlConnectionStringOption.GetterDelegate(MySqlConnectionStringBuilder.MySqlConnectionStringBuilderSealedClass.instance.GetValue)));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("connectiontimeout", "connection timeout,connect timeout", typeof(uint), 15u, false, new MySqlConnectionStringOption.SetterDelegate(MySqlConnectionStringBuilder.MySqlConnectionStringBuilderSealedClass.instance.SetConnectionTimeOut), new MySqlConnectionStringOption.GetterDelegate(MySqlConnectionStringBuilder.MySqlConnectionStringBuilderSealedClass.instance.getConnectiontimeout)));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("defaultcommandtimeout", "command timeout,default command timeout", typeof(uint), 30u, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("usedefaultcommandtimeoutforef", "use default command timeout for ef", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("user id", "uid,username,user name,user,userid", typeof(string), "", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("password", "pwd", typeof(string), "", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("persistsecurityinfo", "persist security info", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("encrypt", null, typeof(bool), false, true, new MySqlConnectionStringOption.SetterDelegate(MySqlConnectionStringBuilder.MySqlConnectionStringBuilderSealedClass.instance.SetSslMode), new MySqlConnectionStringOption.GetterDelegate(MySqlConnectionStringBuilder.MySqlConnectionStringBuilderSealedClass.instance.GetSslMode)));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("certificatefile", "certificate file", typeof(string), null, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("certificatepassword", "certificate password", typeof(string), null, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("certificatestorelocation", "certificate store location", typeof(MySqlCertificateStoreLocation), MySqlCertificateStoreLocation.None, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("certificatethumbprint", "certificate thumb print", typeof(string), null, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("integratedsecurity", "integrated security", typeof(bool), false, false, new MySqlConnectionStringOption.SetterDelegate(MySqlConnectionStringBuilder.MySqlConnectionStringBuilderSealedClass.instance.SetIntegratedSecurity), new MySqlConnectionStringOption.GetterDelegate(MySqlConnectionStringBuilder.MySqlConnectionStringBuilderSealedClass.instance.GetIntegratedSecurity)));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("allowzerodatetime", "allow zero datetime", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("convertzerodatetime", "convert zero datetime", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("useusageadvisor", "use usage advisor,usage advisor", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("procedurecachesize", "procedure cache size,procedure cache,procedurecache", typeof(uint), 25u, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("useperformancemonitor", "use performance monitor,useperfmon,perfmon", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("ignoreprepare", "ignore prepare", typeof(bool), true, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("useprocedurebodies", "use procedure bodies,procedure bodies", typeof(bool), true, true, new MySqlConnectionStringOption.SetterDelegate(MySqlConnectionStringBuilder.MySqlConnectionStringBuilderSealedClass.instance.SetUseprocedurebodies), new MySqlConnectionStringOption.GetterDelegate(MySqlConnectionStringBuilder.MySqlConnectionStringBuilderSealedClass.instance.GetUseprocedurebodies)));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("autoenlist", "auto enlist", typeof(bool), true, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("respectbinaryflags", "respect binary flags", typeof(bool), true, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("treattinyasboolean", "treat tiny as boolean", typeof(bool), true, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("allowuservariables", "allow user variables", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("interactivesession", "interactive session,interactive", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("functionsreturnstring", "functions return string", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("useaffectedrows", "use affected rows", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("oldguids", "old guids", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("keepalive", "keep alive", typeof(uint), 0u, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("sqlservermode", "sql server mode", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("tablecaching", "table cache,tablecache", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("defaulttablecacheage", "default table cache age", typeof(int), 60, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("checkparameters", "check parameters", typeof(bool), true, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("replication", null, typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("exceptioninterceptors", "exception interceptors", typeof(string), null, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("commandinterceptors", "command interceptors", typeof(string), null, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("includesecurityasserts", "include security asserts", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("connectionlifetime", "connection lifetime", typeof(uint), 0u, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("pooling", null, typeof(bool), true, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("minpoolsize", "minimumpoolsize,min pool size,minimum pool size", typeof(uint), 0u, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("maxpoolsize", "maximumpoolsize,max pool size,maximum pool size", typeof(uint), 100u, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("connectionreset", "connection reset", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("cacheserverproperties", "cache server properties", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("characterset", "character set,charset", typeof(string), "", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("treatblobsasutf8", "treat blobs as utf8", typeof(bool), false, false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("blobasutf8includepattern", null, typeof(string), "", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("blobasutf8excludepattern", null, typeof(string), "", false));
     MySqlConnectionStringBuilder.options.Add(new MySqlConnectionStringOption("sslmode", "ssl mode", typeof(MySqlSslMode), MySqlSslMode.Preferred, false));
 }