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

◆ SetExtProperties() [1/2]

static void System.Data.XSDSchema.SetExtProperties ( object instance,
XmlAttribute[] attrs )
inlinestaticprivate

Definition at line 282 of file XSDSchema.cs.

283 {
284 PropertyCollection propertyCollection = null;
285 if (attrs == null)
286 {
287 return;
288 }
289 for (int i = 0; i < attrs.Length; i++)
290 {
291 if (!(attrs[i].NamespaceURI == "urn:schemas-microsoft-com:xml-msprop"))
292 {
293 continue;
294 }
295 if (propertyCollection == null)
296 {
297 object value = TypeDescriptor.GetProperties(instance)["ExtendedProperties"].GetValue(instance);
298 propertyCollection = (PropertyCollection)value;
299 }
300 string text = XmlConvert.DecodeName(attrs[i].LocalName);
301 if (instance is ForeignKeyConstraint)
302 {
303 if (!text.StartsWith("fk_", StringComparison.Ordinal))
304 {
305 continue;
306 }
307 text = text.Substring(3);
308 }
309 if (instance is DataRelation && text.StartsWith("rel_", StringComparison.Ordinal))
310 {
311 text = text.Substring(4);
312 }
313 else if (instance is DataRelation && text.StartsWith("fk_", StringComparison.Ordinal))
314 {
315 continue;
316 }
317 propertyCollection.Add(text, attrs[i].Value);
318 }
319 }
void Add(TKey key, TValue value)
static PropertyDescriptorCollection GetProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static ? string DecodeName(string? name)
Definition XmlConvert.cs:55

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Xml.XmlConvert.DecodeName(), System.ComponentModel.TypeDescriptor.GetProperties(), System.text, and System.value.

Referenced by System.Data.XSDSchema.HandleAttributeColumn(), System.Data.XSDSchema.HandleConstraint(), System.Data.XSDSchema.HandleElementColumn(), System.Data.XSDSchema.HandleKeyref(), System.Data.XSDSchema.HandleRefTableProperties(), System.Data.XSDSchema.HandleRelation(), System.Data.XSDSchema.HandleSimpleContentColumn(), and System.Data.XSDSchema.HandleSimpleTypeSimpleContentColumn().