Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetProperties() [6/6]

virtual void System.Data.Common.DbConnectionStringBuilder.GetProperties ( Hashtable propertyDescriptors)
inlineprotectedvirtual

Definition at line 387 of file DbConnectionStringBuilder.cs.

388 {
389 long scopeId = DataCommonEventSource.Log.EnterScope("<comm.DbConnectionStringBuilder.GetProperties|API> {0}", ObjectID);
390 try
391 {
392 Type type = GetType();
395 {
396 if ("ConnectionString" != property.Name)
397 {
398 string displayName = property.DisplayName;
400 {
402 PropertyDescriptor value = new DbConnectionStringBuilderDescriptor(property.Name, property.ComponentType, property.PropertyType, property.IsReadOnly, attributesFromCollection);
404 }
405 }
407 {
408 propertyDescriptors["ConnectionString"] = property;
409 }
410 else
411 {
412 propertyDescriptors.Remove("ConnectionString");
413 }
414 }
415 if (IsFixedSize)
416 {
417 return;
418 }
420 foreach (string key in Keys)
421 {
423 {
424 continue;
425 }
426 object obj = this[key];
427 Type type2;
428 if (obj != null)
429 {
430 type2 = obj.GetType();
431 if (typeof(string) == type2)
432 {
433 bool result2;
434 if (int.TryParse((string)obj, out var _))
435 {
436 type2 = typeof(int);
437 }
438 else if (bool.TryParse((string)obj, out result2))
439 {
440 type2 = typeof(bool);
441 }
442 }
443 }
444 else
445 {
446 type2 = typeof(string);
447 }
448 Attribute[] attributes = null;
449 if (StringComparer.OrdinalIgnoreCase.Equals("Password", key) || StringComparer.OrdinalIgnoreCase.Equals("pwd", key))
450 {
451 attributes = new Attribute[3]
452 {
456 };
457 }
458 else if (attributesFromCollection == null)
459 {
461 {
464 };
465 attributes = attributesFromCollection;
466 }
467 PropertyDescriptor value2 = new DbConnectionStringBuilderDescriptor(key, GetType(), type2, isReadOnly: false, attributes);
469 }
470 }
471 finally
472 {
473 DataCommonEventSource.Log.ExitScope(scopeId);
474 }
475 }
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
bool ICollection< KeyValuePair< TKey, TValue > >. IsReadOnly
static readonly BrowsableAttribute Yes
static readonly PasswordPropertyTextAttribute Yes
static PropertyDescriptorCollection GetProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
Attribute[] GetAttributesFromCollection(AttributeCollection collection)

References System.Data.Common.DbConnectionStringBuilder.BrowsableConnectionString, System.Collections.Generic.Dictionary< TKey, TValue >.ContainsKey(), System.Data.Common.DbConnectionStringBuilder.Dictionary, System.Data.Common.DbConnectionStringBuilder.GetAttributesFromCollection(), System.ComponentModel.TypeDescriptor.GetProperties(), System.Data.Common.DbConnectionStringBuilder.IsFixedSize, System.Collections.Generic.Dictionary< TKey, TValue >.IsReadOnly, System.key, System.Data.Common.DbConnectionStringBuilder.Keys, System.Data.DataCommonEventSource.Log, System.obj, System.Data.Common.DbConnectionStringBuilder.ObjectID, System.StringComparer.OrdinalIgnoreCase, System.Collections.Generic.Dictionary< TKey, TValue >.Remove(), System.type, System.value, System.ComponentModel.BrowsableAttribute.Yes, and System.ComponentModel.PasswordPropertyTextAttribute.Yes.