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

◆ SetProperties() [2/2]

static void System.Data.XMLSchema.SetProperties ( object instance,
XmlAttributeCollection attrs )
inlinestaticpackageinherited

Definition at line 18 of file XMLSchema.cs.

19 {
20 for (int i = 0; i < attrs.Count; i++)
21 {
22 if (!(attrs[i].NamespaceURI == "urn:schemas-microsoft-com:xml-msdata"))
23 {
24 continue;
25 }
26 string localName = attrs[i].LocalName;
27 string value = attrs[i].Value;
28 switch (localName)
29 {
30 case "Expression":
31 if (instance is DataColumn)
32 {
33 continue;
34 }
35 break;
36 case "DefaultValue":
37 case "RemotingFormat":
38 continue;
39 }
41 if (propertyDescriptor == null)
42 {
43 continue;
44 }
47 object value2;
48 if (converter.CanConvertFrom(typeof(string)))
49 {
50 value2 = converter.ConvertFromInvariantString(value);
51 }
52 else if (propertyType == typeof(Type))
53 {
55 }
56 else
57 {
59 {
60 throw ExceptionBuilder.CannotConvert(value, propertyType.FullName);
61 }
63 }
64 propertyDescriptor.SetValue(instance, value2);
65 }
66 }
static PropertyDescriptorCollection GetProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static Type GetType(string value)
static TypeConverter GetConverter(Type type)
Definition XMLSchema.cs:12

References System.Data.ExceptionBuilder.CannotConvert(), System.converter, System.Xml.Dictionary, System.Data.XMLSchema.GetConverter(), System.ComponentModel.TypeDescriptor.GetProperties(), System.Data.Common.DataStorage.GetType(), and System.value.

Referenced by System.Data.XDRSchema.HandleColumn(), System.Data.XDRSchema.InstantiateSimpleTable(), and System.Data.XDRSchema.InstantiateTable().