private void Reset()
 {
     connectionTimeout = 15;
     pooling           = true;
     port                = 3306;
     server              = String.Empty;
     persistSI           = false;
     connectionLifetime  = 0;
     connectionReset     = false;
     minPoolSize         = 0;
     maxPoolSize         = 100;
     userId              = "";
     password            = "";
     useUsageAdvisor     = false;
     charSet             = "";
     compress            = false;
     pipeName            = "MYSQL";
     logging             = false;
     oldSyntax           = false;
     sharedMemName       = "MYSQL";
     allowBatch          = true;
     convertZeroDatetime = false;
     database            = "";
     driverType          = MySqlDriverType.Native;
     protocol            = MySqlConnectionProtocol.Sockets;
     allowZeroDatetime   = false;
     usePerfMon          = false;
     procCacheSize       = 25;
     useSSL              = false;
     ignorePrepare       = true;
     useProcedureBodies  = true;
 }
		private void SetValue(Keyword kw, object value) {
			switch (kw) {
				case Keyword.UserID:
					this.userId = (string)value;
					return;

				case Keyword.Password:
					this.password = (string)value;
					return;

				case Keyword.Server:
					this.server = (string)value;
					return;

				case Keyword.Port:
					this.port = ConvertToUInt(value);
					return;

				case Keyword.UseUsageAdvisor:
					this.useUsageAdvisor = ConvertToBool(value);
					return;

				case Keyword.CharacterSet:
					this.charSet = (string)value;
					return;

				case Keyword.Compress:
					this.compress = ConvertToBool(value);
					return;

				case Keyword.PipeName:
					this.pipeName = (string)value;
					return;

				case Keyword.Logging:
					this.logging = ConvertToBool(value);
					return;

				case Keyword.OldSyntax:
					this.oldSyntax = ConvertToBool(value);
					if (this.clearing) {
						break;
					}
					Logger.LogWarning("Use Old Syntax is now obsolete.  Please see documentation");
					return;

				case Keyword.SharedMemoryName:
					this.sharedMemName = (string)value;
					return;

				case Keyword.AllowBatch:
					this.allowBatch = ConvertToBool(value);
					return;

				case Keyword.ConvertZeroDatetime:
					this.convertZeroDatetime = ConvertToBool(value);
					return;

				case Keyword.PersistSecurityInfo:
					this.persistSI = ConvertToBool(value);
					return;

				case Keyword.Database:
					this.database = (string)value;
					return;

				case Keyword.ConnectionTimeout:
					this.connectionTimeout = ConvertToUInt(value);
					return;

				case Keyword.Pooling:
					this.pooling = ConvertToBool(value);
					return;

				case Keyword.MinimumPoolSize:
					this.minPoolSize = ConvertToUInt(value);
					return;

				case Keyword.MaximumPoolSize:
					this.maxPoolSize = ConvertToUInt(value);
					return;

				case Keyword.ConnectionLifetime:
					this.connectionLifetime = ConvertToUInt(value);
					return;

				case Keyword.DriverType:
					this.driverType = ConvertToDriverType(value);
					return;

				case Keyword.Protocol:
					this.protocol = ConvertToProtocol(value);
					return;

				case Keyword.ConnectionReset:
					this.connectionReset = ConvertToBool(value);
					return;

				case Keyword.AllowZeroDatetime:
					this.allowZeroDatetime = ConvertToBool(value);
					return;

				case Keyword.UsePerformanceMonitor:
					this.usePerfMon = ConvertToBool(value);
					return;

				case Keyword.ProcedureCacheSize:
					this.procCacheSize = ConvertToUInt(value);
					return;

				case Keyword.IgnorePrepare:
					this.ignorePrepare = ConvertToBool(value);
					return;

				case Keyword.UseSSL:
					this.useSSL = ConvertToBool(value);
					return;

				case Keyword.UseProcedureBodies:
					this.useProcedureBodies = ConvertToBool(value);
					return;

				case Keyword.AutoEnlist:
					this.autoEnlist = ConvertToBool(value);
					return;

				case Keyword.RespectBinaryFlags:
					this.respectBinaryFlags = ConvertToBool(value);
					return;

				case Keyword.TreatBlobsAsUTF8:
					this.treatBlobsAsUTF8 = ConvertToBool(value);
					return;

				case Keyword.BlobAsUTF8IncludePattern:
					this.blobAsUtf8IncludePattern = (string)value;
					return;

				case Keyword.BlobAsUTF8ExcludePattern:
					this.blobAsUtf8ExcludePattern = (string)value;
					return;

				case Keyword.DefaultCommandTimeout:
					this.defaultCommandTimeout = ConvertToUInt(value);
					return;

				case Keyword.TreatTinyAsBoolean:
					this.treatTinyAsBoolean = ConvertToBool(value);
					return;

				case Keyword.AllowUserVariables:
					this.allowUserVariables = ConvertToBool(value);
					return;

				case Keyword.InteractiveSession:
					this.interactiveSession = ConvertToBool(value);
					return;

				case Keyword.FunctionsReturnString:
					this.functionsReturnString = ConvertToBool(value);
					break;

				default:
					return;
			}
		}
        private void SetValue(Keyword kw, object value)
        {
            switch (kw)
            {
            case Keyword.UserID:
                userId = (string)value; break;

            case Keyword.Password:
                password = (string)value; break;

            case Keyword.Port:
                port = ConvertToUInt(value); break;

            case Keyword.Server:
                server = (string)value; break;

            case Keyword.UseUsageAdvisor:
                useUsageAdvisor = ConvertToBool(value); break;

            case Keyword.CharacterSet:
                charSet = (string)value; break;

            case Keyword.Compress:
                compress = ConvertToBool(value); break;

            case Keyword.PipeName:
                pipeName = (string)value; break;

            case Keyword.Logging:
                logging = ConvertToBool(value); break;

            case Keyword.OldSyntax:
                oldSyntax = ConvertToBool(value); break;

            case Keyword.SharedMemoryName:
                sharedMemName = (string)value; break;

            case Keyword.AllowBatch:
                allowBatch = ConvertToBool(value); break;

            case Keyword.ConvertZeroDatetime:
                convertZeroDatetime = ConvertToBool(value); break;

            case Keyword.PersistSecurityInfo:
                persistSI = ConvertToBool(value); break;

            case Keyword.Database:
                database = (string)value; break;

            case Keyword.ConnectionTimeout:
                connectionTimeout = ConvertToUInt(value); break;

            case Keyword.Pooling:
                pooling = ConvertToBool(value); break;

            case Keyword.MinimumPoolSize:
                minPoolSize = ConvertToUInt(value); break;

            case Keyword.MaximumPoolSize:
                maxPoolSize = ConvertToUInt(value); break;

            case Keyword.ConnectionLifetime:
                connectionLifetime = ConvertToUInt(value); break;

            case Keyword.DriverType:
                driverType = ConvertToDriverType(value); break;

            case Keyword.Protocol:
                protocol = ConvertToProtocol(value); break;

            case Keyword.ConnectionReset:
                connectionReset = ConvertToBool(value); break;

            case Keyword.UsePerformanceMonitor:
                usePerfMon = ConvertToBool(value); break;

            case Keyword.AllowZeroDatetime:
                allowZeroDatetime = ConvertToBool(value); break;

            case Keyword.ProcedureCacheSize:
                procCacheSize = ConvertToUInt(value); break;

            case Keyword.IgnorePrepare:
                ignorePrepare = ConvertToBool(value); break;

            case Keyword.UseSSL:
                useSSL = ConvertToBool(value); break;

            case Keyword.UseProcedureBodies:
                useProcedureBodies = ConvertToBool(value); break;
            }
        }
Пример #4
0
        private void SetValue(Keyword kw, object value)
        {
            switch (kw)
            {
            case Keyword.UserID:
                this.userId = (string)value;
                return;

            case Keyword.Password:
                this.password = (string)value;
                return;

            case Keyword.Server:
                this.server = (string)value;
                return;

            case Keyword.Port:
                this.port = ConvertToUInt(value);
                return;

            case Keyword.UseUsageAdvisor:
                this.useUsageAdvisor = ConvertToBool(value);
                return;

            case Keyword.CharacterSet:
                this.charSet = (string)value;
                return;

            case Keyword.Compress:
                this.compress = ConvertToBool(value);
                return;

            case Keyword.PipeName:
                this.pipeName = (string)value;
                return;

            case Keyword.Logging:
                this.logging = ConvertToBool(value);
                return;

            case Keyword.OldSyntax:
                this.oldSyntax = ConvertToBool(value);
                if (this.clearing)
                {
                    break;
                }
                Logger.LogWarning("Use Old Syntax is now obsolete.  Please see documentation");
                return;

            case Keyword.SharedMemoryName:
                this.sharedMemName = (string)value;
                return;

            case Keyword.AllowBatch:
                this.allowBatch = ConvertToBool(value);
                return;

            case Keyword.ConvertZeroDatetime:
                this.convertZeroDatetime = ConvertToBool(value);
                return;

            case Keyword.PersistSecurityInfo:
                this.persistSI = ConvertToBool(value);
                return;

            case Keyword.Database:
                this.database = (string)value;
                return;

            case Keyword.ConnectionTimeout:
                this.connectionTimeout = ConvertToUInt(value);
                return;

            case Keyword.Pooling:
                this.pooling = ConvertToBool(value);
                return;

            case Keyword.MinimumPoolSize:
                this.minPoolSize = ConvertToUInt(value);
                return;

            case Keyword.MaximumPoolSize:
                this.maxPoolSize = ConvertToUInt(value);
                return;

            case Keyword.ConnectionLifetime:
                this.connectionLifetime = ConvertToUInt(value);
                return;

            case Keyword.DriverType:
                this.driverType = ConvertToDriverType(value);
                return;

            case Keyword.Protocol:
                this.protocol = ConvertToProtocol(value);
                return;

            case Keyword.ConnectionReset:
                this.connectionReset = ConvertToBool(value);
                return;

            case Keyword.AllowZeroDatetime:
                this.allowZeroDatetime = ConvertToBool(value);
                return;

            case Keyword.UsePerformanceMonitor:
                this.usePerfMon = ConvertToBool(value);
                return;

            case Keyword.ProcedureCacheSize:
                this.procCacheSize = ConvertToUInt(value);
                return;

            case Keyword.IgnorePrepare:
                this.ignorePrepare = ConvertToBool(value);
                return;

            case Keyword.UseSSL:
                this.useSSL = ConvertToBool(value);
                return;

            case Keyword.UseProcedureBodies:
                this.useProcedureBodies = ConvertToBool(value);
                return;

            case Keyword.AutoEnlist:
                this.autoEnlist = ConvertToBool(value);
                return;

            case Keyword.RespectBinaryFlags:
                this.respectBinaryFlags = ConvertToBool(value);
                return;

            case Keyword.TreatBlobsAsUTF8:
                this.treatBlobsAsUTF8 = ConvertToBool(value);
                return;

            case Keyword.BlobAsUTF8IncludePattern:
                this.blobAsUtf8IncludePattern = (string)value;
                return;

            case Keyword.BlobAsUTF8ExcludePattern:
                this.blobAsUtf8ExcludePattern = (string)value;
                return;

            case Keyword.DefaultCommandTimeout:
                this.defaultCommandTimeout = ConvertToUInt(value);
                return;

            case Keyword.TreatTinyAsBoolean:
                this.treatTinyAsBoolean = ConvertToBool(value);
                return;

            case Keyword.AllowUserVariables:
                this.allowUserVariables = ConvertToBool(value);
                return;

            case Keyword.InteractiveSession:
                this.interactiveSession = ConvertToBool(value);
                return;

            case Keyword.FunctionsReturnString:
                this.functionsReturnString = ConvertToBool(value);
                break;

            default:
                return;
            }
        }
 private void SetValue(Keyword kw, object value)
 {
     switch (kw)
     {
         case Keyword.UserID: 
             userId = (string)value; break;
         case Keyword.Password: 
             password = (string)value; break;
         case Keyword.Port: 
             port = ConvertToUInt(value); break;
         case Keyword.Server: 
             server = (string)value; break;
         case Keyword.UseUsageAdvisor: 
             useUsageAdvisor = ConvertToBool(value); break;
         case Keyword.CharacterSet: 
             charSet = (string)value; break;
         case Keyword.Compress: 
             compress = ConvertToBool(value); break;
         case Keyword.PipeName: 
             pipeName = (string)value; break;
         case Keyword.Logging: 
             logging = ConvertToBool(value); break;
         case Keyword.OldSyntax: 
             oldSyntax = ConvertToBool(value); break;
         case Keyword.SharedMemoryName: 
             sharedMemName = (string)value; break;
         case Keyword.AllowBatch: 
             allowBatch = ConvertToBool(value); break;
         case Keyword.ConvertZeroDatetime: 
             convertZeroDatetime = ConvertToBool(value); break;
         case Keyword.PersistSecurityInfo: 
             persistSI = ConvertToBool(value); break;
         case Keyword.Database: 
             database = (string)value; break;
         case Keyword.ConnectionTimeout: 
             connectionTimeout = ConvertToUInt(value); break;
         case Keyword.Pooling: 
             pooling = ConvertToBool(value); break;
         case Keyword.MinimumPoolSize: 
             minPoolSize = ConvertToUInt(value); break;
         case Keyword.MaximumPoolSize: 
             maxPoolSize = ConvertToUInt(value); break;
         case Keyword.ConnectionLifetime: 
             connectionLifetime = ConvertToUInt(value); break;
         case Keyword.DriverType: 
             driverType = ConvertToDriverType(value); break;
         case Keyword.Protocol: 
             protocol = ConvertToProtocol(value); break;
         case Keyword.ConnectionReset: 
             connectionReset = ConvertToBool(value); break;
         case Keyword.UsePerformanceMonitor: 
             usePerfMon = ConvertToBool(value); break;
         case Keyword.AllowZeroDatetime: 
             allowZeroDatetime = ConvertToBool(value); break;
         case Keyword.ProcedureCacheSize: 
             procCacheSize = ConvertToUInt(value); break;
         case Keyword.IgnorePrepare: 
             ignorePrepare = ConvertToBool(value); break;
         case Keyword.UseSSL: 
             useSSL = ConvertToBool(value); break;
         case Keyword.UseProcedureBodies: 
             useProcedureBodies = ConvertToBool(value); break;
         case Keyword.AutoEnlist:
             autoEnlist = ConvertToBool(value); break;
         case Keyword.RespectBinaryFlags:
             respectBinaryFlags = ConvertToBool(value); break;
         case Keyword.TreatBlobsAsUTF8:
             treatBlobsAsUTF8 = ConvertToBool(value); break;
         case Keyword.BlobAsUTF8ExcludePattern:
             blobAsUtf8ExcludePattern = (string)value; break;
         case Keyword.BlobAsUTF8IncludePattern:
             blobAsUtf8IncludePattern = (string)value; break;
         case Keyword.DefaultCommandTimeout:
             defaultCommandTimeout = ConvertToUInt(value); break;
         case Keyword.TreatTinyAsBoolean:
             treatTinyAsBoolean = ConvertToBool(value); break;
     }
 }