fx\src\data\System\Data\SqlClient\SqlConnectionStringBuilder.cs (226)
88internal const int KeywordsCount = (int)Keywords.KeywordsCount;
91private static readonly Dictionary<string,Keywords> _keywords;
137validKeywords[(int)Keywords.ApplicationIntent] = DbConnectionStringKeywords.ApplicationIntent;
138validKeywords[(int)Keywords.ApplicationName] = DbConnectionStringKeywords.ApplicationName;
139validKeywords[(int)Keywords.AsynchronousProcessing] = DbConnectionStringKeywords.AsynchronousProcessing;
140validKeywords[(int)Keywords.AttachDBFilename] = DbConnectionStringKeywords.AttachDBFilename;
141validKeywords[(int)Keywords.PoolBlockingPeriod] = DbConnectionStringKeywords.PoolBlockingPeriod;
142validKeywords[(int)Keywords.ConnectionReset] = DbConnectionStringKeywords.ConnectionReset;
143validKeywords[(int)Keywords.ContextConnection] = DbConnectionStringKeywords.ContextConnection;
144validKeywords[(int)Keywords.ConnectTimeout] = DbConnectionStringKeywords.ConnectTimeout;
145validKeywords[(int)Keywords.CurrentLanguage] = DbConnectionStringKeywords.CurrentLanguage;
146validKeywords[(int)Keywords.DataSource] = DbConnectionStringKeywords.DataSource;
147validKeywords[(int)Keywords.Encrypt] = DbConnectionStringKeywords.Encrypt;
148validKeywords[(int)Keywords.Enlist] = DbConnectionStringKeywords.Enlist;
149validKeywords[(int)Keywords.FailoverPartner] = DbConnectionStringKeywords.FailoverPartner;
150validKeywords[(int)Keywords.InitialCatalog] = DbConnectionStringKeywords.InitialCatalog;
151validKeywords[(int)Keywords.IntegratedSecurity] = DbConnectionStringKeywords.IntegratedSecurity;
152validKeywords[(int)Keywords.LoadBalanceTimeout] = DbConnectionStringKeywords.LoadBalanceTimeout;
153validKeywords[(int)Keywords.MaxPoolSize] = DbConnectionStringKeywords.MaxPoolSize;
154validKeywords[(int)Keywords.MinPoolSize] = DbConnectionStringKeywords.MinPoolSize;
155validKeywords[(int)Keywords.MultipleActiveResultSets] = DbConnectionStringKeywords.MultipleActiveResultSets;
156validKeywords[(int)Keywords.MultiSubnetFailover] = DbConnectionStringKeywords.MultiSubnetFailover;
157validKeywords[(int)Keywords.TransparentNetworkIPResolution] = DbConnectionStringKeywords.TransparentNetworkIPResolution;
159validKeywords[(int)Keywords.NetworkLibrary] = DbConnectionStringKeywords.NetworkLibrary;
160validKeywords[(int)Keywords.PacketSize] = DbConnectionStringKeywords.PacketSize;
161validKeywords[(int)Keywords.Password] = DbConnectionStringKeywords.Password;
162validKeywords[(int)Keywords.PersistSecurityInfo] = DbConnectionStringKeywords.PersistSecurityInfo;
163validKeywords[(int)Keywords.Pooling] = DbConnectionStringKeywords.Pooling;
164validKeywords[(int)Keywords.Replication] = DbConnectionStringKeywords.Replication;
165validKeywords[(int)Keywords.TransactionBinding] = DbConnectionStringKeywords.TransactionBinding;
166validKeywords[(int)Keywords.TrustServerCertificate] = DbConnectionStringKeywords.TrustServerCertificate;
167validKeywords[(int)Keywords.TypeSystemVersion] = DbConnectionStringKeywords.TypeSystemVersion;
168validKeywords[(int)Keywords.UserID] = DbConnectionStringKeywords.UserID;
169validKeywords[(int)Keywords.UserInstance] = DbConnectionStringKeywords.UserInstance;
170validKeywords[(int)Keywords.WorkstationID] = DbConnectionStringKeywords.WorkstationID;
171validKeywords[(int)Keywords.ConnectRetryCount] = DbConnectionStringKeywords.ConnectRetryCount;
172validKeywords[(int)Keywords.ConnectRetryInterval] = DbConnectionStringKeywords.ConnectRetryInterval;
173validKeywords[(int)Keywords.Authentication] = DbConnectionStringKeywords.Authentication;
174validKeywords[(int)Keywords.ColumnEncryptionSetting] = DbConnectionStringKeywords.ColumnEncryptionSetting;
175validKeywords[(int)Keywords.EnclaveAttestationUrl] = DbConnectionStringKeywords.EnclaveAttestationUrl;
178Dictionary<string, Keywords> hash = new Dictionary<string, Keywords>(KeywordsCount + SqlConnectionString.SynonymCount, StringComparer.OrdinalIgnoreCase);
179hash.Add(DbConnectionStringKeywords.ApplicationIntent, Keywords.ApplicationIntent);
180hash.Add(DbConnectionStringKeywords.ApplicationName, Keywords.ApplicationName);
181hash.Add(DbConnectionStringKeywords.AsynchronousProcessing, Keywords.AsynchronousProcessing);
182hash.Add(DbConnectionStringKeywords.AttachDBFilename, Keywords.AttachDBFilename);
183hash.Add(DbConnectionStringKeywords.PoolBlockingPeriod, Keywords.PoolBlockingPeriod);
184hash.Add(DbConnectionStringKeywords.ConnectTimeout, Keywords.ConnectTimeout);
185hash.Add(DbConnectionStringKeywords.ConnectionReset, Keywords.ConnectionReset);
186hash.Add(DbConnectionStringKeywords.ContextConnection, Keywords.ContextConnection);
187hash.Add(DbConnectionStringKeywords.CurrentLanguage, Keywords.CurrentLanguage);
188hash.Add(DbConnectionStringKeywords.DataSource, Keywords.DataSource);
189hash.Add(DbConnectionStringKeywords.Encrypt, Keywords.Encrypt);
190hash.Add(DbConnectionStringKeywords.Enlist, Keywords.Enlist);
191hash.Add(DbConnectionStringKeywords.FailoverPartner, Keywords.FailoverPartner);
192hash.Add(DbConnectionStringKeywords.InitialCatalog, Keywords.InitialCatalog);
193hash.Add(DbConnectionStringKeywords.IntegratedSecurity, Keywords.IntegratedSecurity);
194hash.Add(DbConnectionStringKeywords.LoadBalanceTimeout, Keywords.LoadBalanceTimeout);
195hash.Add(DbConnectionStringKeywords.MultipleActiveResultSets, Keywords.MultipleActiveResultSets);
196hash.Add(DbConnectionStringKeywords.MaxPoolSize, Keywords.MaxPoolSize);
197hash.Add(DbConnectionStringKeywords.MinPoolSize, Keywords.MinPoolSize);
198hash.Add(DbConnectionStringKeywords.MultiSubnetFailover, Keywords.MultiSubnetFailover);
199hash.Add(DbConnectionStringKeywords.TransparentNetworkIPResolution, Keywords.TransparentNetworkIPResolution);
201hash.Add(DbConnectionStringKeywords.NetworkLibrary, Keywords.NetworkLibrary);
202hash.Add(DbConnectionStringKeywords.PacketSize, Keywords.PacketSize);
203hash.Add(DbConnectionStringKeywords.Password, Keywords.Password);
204hash.Add(DbConnectionStringKeywords.PersistSecurityInfo, Keywords.PersistSecurityInfo);
205hash.Add(DbConnectionStringKeywords.Pooling, Keywords.Pooling);
206hash.Add(DbConnectionStringKeywords.Replication, Keywords.Replication);
207hash.Add(DbConnectionStringKeywords.TransactionBinding, Keywords.TransactionBinding);
208hash.Add(DbConnectionStringKeywords.TrustServerCertificate, Keywords.TrustServerCertificate);
209hash.Add(DbConnectionStringKeywords.TypeSystemVersion, Keywords.TypeSystemVersion);
210hash.Add(DbConnectionStringKeywords.UserID, Keywords.UserID);
211hash.Add(DbConnectionStringKeywords.UserInstance, Keywords.UserInstance);
212hash.Add(DbConnectionStringKeywords.WorkstationID, Keywords.WorkstationID);
213hash.Add(DbConnectionStringKeywords.ConnectRetryCount, Keywords.ConnectRetryCount);
214hash.Add(DbConnectionStringKeywords.ConnectRetryInterval, Keywords.ConnectRetryInterval);
215hash.Add(DbConnectionStringKeywords.Authentication, Keywords.Authentication);
216hash.Add(DbConnectionStringKeywords.ColumnEncryptionSetting, Keywords.ColumnEncryptionSetting);
217hash.Add(DbConnectionStringKeywords.EnclaveAttestationUrl, Keywords.EnclaveAttestationUrl);
219hash.Add(DbConnectionStringSynonyms.APP, Keywords.ApplicationName);
220hash.Add(DbConnectionStringSynonyms.Async, Keywords.AsynchronousProcessing);
221hash.Add(DbConnectionStringSynonyms.EXTENDEDPROPERTIES, Keywords.AttachDBFilename);
222hash.Add(DbConnectionStringSynonyms.INITIALFILENAME, Keywords.AttachDBFilename);
223hash.Add(DbConnectionStringSynonyms.CONNECTIONTIMEOUT, Keywords.ConnectTimeout);
224hash.Add(DbConnectionStringSynonyms.TIMEOUT, Keywords.ConnectTimeout);
225hash.Add(DbConnectionStringSynonyms.LANGUAGE, Keywords.CurrentLanguage);
226hash.Add(DbConnectionStringSynonyms.ADDR, Keywords.DataSource);
227hash.Add(DbConnectionStringSynonyms.ADDRESS, Keywords.DataSource);
228hash.Add(DbConnectionStringSynonyms.NETWORKADDRESS, Keywords.DataSource);
229hash.Add(DbConnectionStringSynonyms.SERVER, Keywords.DataSource);
230hash.Add(DbConnectionStringSynonyms.DATABASE, Keywords.InitialCatalog);
231hash.Add(DbConnectionStringSynonyms.TRUSTEDCONNECTION, Keywords.IntegratedSecurity);
232hash.Add(DbConnectionStringSynonyms.ConnectionLifetime, Keywords.LoadBalanceTimeout);
233hash.Add(DbConnectionStringSynonyms.NET, Keywords.NetworkLibrary);
234hash.Add(DbConnectionStringSynonyms.NETWORK, Keywords.NetworkLibrary);
235hash.Add(DbConnectionStringSynonyms.Pwd, Keywords.Password);
236hash.Add(DbConnectionStringSynonyms.PERSISTSECURITYINFO, Keywords.PersistSecurityInfo);
237hash.Add(DbConnectionStringSynonyms.UID, Keywords.UserID);
238hash.Add(DbConnectionStringSynonyms.User, Keywords.UserID);
239hash.Add(DbConnectionStringSynonyms.WSID, Keywords.WorkstationID);
256Keywords index = GetIndex(keyword);
261Keywords index = GetIndex(keyword);
263case Keywords.ApplicationIntent: this.ApplicationIntent = ConvertToApplicationIntent(keyword, value); break;
264case Keywords.ApplicationName: ApplicationName = ConvertToString(value); break;
265case Keywords.AttachDBFilename: AttachDBFilename = ConvertToString(value); break;
266case Keywords.CurrentLanguage: CurrentLanguage = ConvertToString(value); break;
267case Keywords.DataSource: DataSource = ConvertToString(value); break;
268case Keywords.FailoverPartner: FailoverPartner = ConvertToString(value); break;
269case Keywords.InitialCatalog: InitialCatalog = ConvertToString(value); break;
271case Keywords.NetworkLibrary: NetworkLibrary = ConvertToString(value); break;
272case Keywords.Password: Password = ConvertToString(value); break;
273case Keywords.UserID: UserID = ConvertToString(value); break;
274case Keywords.TransactionBinding: TransactionBinding = ConvertToString(value); break;
275case Keywords.TypeSystemVersion: TypeSystemVersion = ConvertToString(value); break;
276case Keywords.WorkstationID: WorkstationID = ConvertToString(value); break;
278case Keywords.ConnectTimeout: ConnectTimeout = ConvertToInt32(value); break;
279case Keywords.LoadBalanceTimeout: LoadBalanceTimeout = ConvertToInt32(value); break;
280case Keywords.MaxPoolSize: MaxPoolSize = ConvertToInt32(value); break;
281case Keywords.MinPoolSize: MinPoolSize = ConvertToInt32(value); break;
282case Keywords.PacketSize: PacketSize = ConvertToInt32(value); break;
284case Keywords.IntegratedSecurity: IntegratedSecurity = ConvertToIntegratedSecurity(value); break;
286case Keywords.Authentication: Authentication = ConvertToAuthenticationType(keyword, value); break;
287case Keywords.ColumnEncryptionSetting: ColumnEncryptionSetting = ConvertToColumnEncryptionSetting(keyword, value); break;
288case Keywords.EnclaveAttestationUrl: EnclaveAttestationUrl = ConvertToString(value); break;
289case Keywords.AsynchronousProcessing: AsynchronousProcessing = ConvertToBoolean(value); break;
290case Keywords.PoolBlockingPeriod: PoolBlockingPeriod = ConvertToPoolBlockingPeriod(keyword, value); break;
292case Keywords.ConnectionReset: ConnectionReset = ConvertToBoolean(value); break;
294case Keywords.ContextConnection: ContextConnection = ConvertToBoolean(value); break;
295case Keywords.Encrypt: Encrypt = ConvertToBoolean(value); break;
296case Keywords.TrustServerCertificate: TrustServerCertificate = ConvertToBoolean(value); break;
297case Keywords.Enlist: Enlist = ConvertToBoolean(value); break;
298case Keywords.MultipleActiveResultSets: MultipleActiveResultSets = ConvertToBoolean(value); break;
299case Keywords.MultiSubnetFailover: MultiSubnetFailover = ConvertToBoolean(value); break;
300case Keywords.TransparentNetworkIPResolution: TransparentNetworkIPResolution = ConvertToBoolean(value); break;
301case Keywords.PersistSecurityInfo: PersistSecurityInfo = ConvertToBoolean(value); break;
302case Keywords.Pooling: Pooling = ConvertToBoolean(value); break;
303case Keywords.Replication: Replication = ConvertToBoolean(value); break;
304case Keywords.UserInstance: UserInstance = ConvertToBoolean(value); break;
305case Keywords.ConnectRetryCount: ConnectRetryCount = ConvertToInt32(value); break;
306case Keywords.ConnectRetryInterval: ConnectRetryInterval = ConvertToInt32(value); break;
889values[i] = GetAt((Keywords)i);
898Reset((Keywords)i);
948private object GetAt(Keywords index) {
950case Keywords.ApplicationIntent: return this.ApplicationIntent;
951case Keywords.ApplicationName: return ApplicationName;
952case Keywords.AsynchronousProcessing: return AsynchronousProcessing;
953case Keywords.AttachDBFilename: return AttachDBFilename;
954case Keywords.PoolBlockingPeriod: return PoolBlockingPeriod;
955case Keywords.ConnectTimeout: return ConnectTimeout;
957case Keywords.ConnectionReset: return ConnectionReset;
959case Keywords.ContextConnection: return ContextConnection;
960case Keywords.CurrentLanguage: return CurrentLanguage;
961case Keywords.DataSource: return DataSource;
962case Keywords.Encrypt: return Encrypt;
963case Keywords.Enlist: return Enlist;
964case Keywords.FailoverPartner: return FailoverPartner;
965case Keywords.InitialCatalog: return InitialCatalog;
966case Keywords.IntegratedSecurity: return IntegratedSecurity;
967case Keywords.LoadBalanceTimeout: return LoadBalanceTimeout;
968case Keywords.MultipleActiveResultSets: return MultipleActiveResultSets;
969case Keywords.MaxPoolSize: return MaxPoolSize;
970case Keywords.MinPoolSize: return MinPoolSize;
971case Keywords.MultiSubnetFailover: return MultiSubnetFailover;
972case Keywords.TransparentNetworkIPResolution: return TransparentNetworkIPResolution;
974case Keywords.NetworkLibrary: return NetworkLibrary;
975case Keywords.PacketSize: return PacketSize;
976case Keywords.Password: return Password;
977case Keywords.PersistSecurityInfo: return PersistSecurityInfo;
978case Keywords.Pooling: return Pooling;
979case Keywords.Replication: return Replication;
980case Keywords.TransactionBinding: return TransactionBinding;
981case Keywords.TrustServerCertificate: return TrustServerCertificate;
982case Keywords.TypeSystemVersion: return TypeSystemVersion;
983case Keywords.UserID: return UserID;
984case Keywords.UserInstance: return UserInstance;
985case Keywords.WorkstationID: return WorkstationID;
986case Keywords.ConnectRetryCount: return ConnectRetryCount;
987case Keywords.ConnectRetryInterval: return ConnectRetryInterval;
988case Keywords.Authentication: return Authentication;
989case Keywords.ColumnEncryptionSetting: return ColumnEncryptionSetting;
990case Keywords.EnclaveAttestationUrl: return EnclaveAttestationUrl;
997private Keywords GetIndex(string keyword) {
999Keywords index;
1035Keywords index;
1045private void Reset(Keywords index) {
1047case Keywords.ApplicationIntent:
1050case Keywords.ApplicationName:
1053case Keywords.AsynchronousProcessing:
1056case Keywords.AttachDBFilename:
1059case Keywords.Authentication:
1062case Keywords.PoolBlockingPeriod:
1066case Keywords.ConnectTimeout:
1069case Keywords.ConnectionReset:
1072case Keywords.ContextConnection:
1075case Keywords.CurrentLanguage:
1078case Keywords.DataSource:
1081case Keywords.Encrypt:
1084case Keywords.Enlist:
1087case Keywords.FailoverPartner:
1090case Keywords.InitialCatalog:
1093case Keywords.IntegratedSecurity:
1096case Keywords.LoadBalanceTimeout:
1099case Keywords.MultipleActiveResultSets:
1102case Keywords.MaxPoolSize:
1105case Keywords.MinPoolSize:
1108case Keywords.MultiSubnetFailover:
1111case Keywords.TransparentNetworkIPResolution:
1117case Keywords.NetworkLibrary:
1120case Keywords.PacketSize:
1123case Keywords.Password:
1126case Keywords.PersistSecurityInfo:
1129case Keywords.Pooling:
1132case Keywords.ConnectRetryCount:
1135case Keywords.ConnectRetryInterval:
1138case Keywords.Replication:
1141case Keywords.TransactionBinding:
1144case Keywords.TrustServerCertificate:
1147case Keywords.TypeSystemVersion:
1150case Keywords.UserID:
1153case Keywords.UserInstance:
1156case Keywords.WorkstationID:
1159case Keywords.ColumnEncryptionSetting:
1162case Keywords.EnclaveAttestationUrl:
1201Keywords index;
1206Keywords index;