Npgsql.NpgsqlConnectionStringBuilder.GetKey C# (CSharp) Method

GetKey() private static method

private static GetKey ( string key ) : Keywords
key string
return Keywords
		private static Keywords GetKey(string key)

		{
			switch (key.ToUpperInvariant())

			{
				case "HOST":

				case "SERVER":

					return Keywords.Host;

				case "PORT":

					return Keywords.Port;

				case "PROTOCOL":

					return Keywords.Protocol;

				case "DATABASE":

				case "DB":

					return Keywords.Database;

				case "USERNAME":

				case "USER NAME":

				case "USER":

				case "USERID":

				case "USER ID":

				case "UID":

					return Keywords.UserName;

				case "PASSWORD":

				case "PSW":

				case "PWD":

					return Keywords.Password;

				case "SSL":

					return Keywords.SSL;

				case "SSLMODE":

					return Keywords.SslMode;

				case "ENCODING":
#pragma warning disable 618
					return Keywords.Encoding;
#pragma warning restore 618
				case "TIMEOUT":

					return Keywords.Timeout;

				case "SEARCHPATH":

					return Keywords.SearchPath;

				case "POOLING":

					return Keywords.Pooling;

				case "CONNECTIONLIFETIME":

					return Keywords.ConnectionLifeTime;

				case "MINPOOLSIZE":

					return Keywords.MinPoolSize;

				case "MAXPOOLSIZE":

					return Keywords.MaxPoolSize;

				case "SYNCNOTIFICATION":

					return Keywords.SyncNotification;

				case "COMMANDTIMEOUT":

					return Keywords.CommandTimeout;

				case "ENLIST":

					return Keywords.Enlist;

				case "PRELOADREADER":
				case "PRELOAD READER":
					return Keywords.PreloadReader;

				case "USEEXTENDEDTYPES":
				case "USE EXTENDED TYPES":
                    return Keywords.UseExtendedTypes;
                case "INTEGRATED SECURITY":
                    return Keywords.IntegratedSecurity;

				default:

					throw new ArgumentException(resman.GetString("Exception_WrongKeyVal"), key);
			}
		}