C# 클래스 Xml.Net.Utilities

A selection of common methods called from multiple classes.
파일 보기 프로젝트 열기: hughbe/xml.net

공개 메소드들

메소드 설명
AddChildElement ( System.Xml.Linq.XElement child, System.Xml.Linq.XElement parent ) : void

Adds the specified XElement to the parent XElement if it is not null;

GetChildElement ( string name, System.Xml.Linq.XElement parent ) : System.Xml.Linq.XElement

Gets the name-specified child XElement of the parent XElement.

GetCollectionElementName ( PropertyInfo property ) : string

Gets the custom name of collection elements of a property. Defaults to "Element".

GetDictionaryElementName ( PropertyInfo property ) : string>.KeyValuePair

Gets the custom name of collection key and value elements of a property.

GetElementType ( System.Xml.Linq.XElement element, Type parentType, int genericArgumentIndex ) : Type

Gets the type of an object from its serialized XElement (e.g. if it has a type attribute) and its parent container type (e.g. if it is generic).

GetIdentifier ( MemberInfo memberInfo ) : string

Gets the XML identifier of the member.

GetIdentifier ( object obj ) : string

Gets the XML identifier of the class from an object of that class.

SetupSerializedElement ( object value, System.Xml.Linq.XElement element, XmlConvertOptions options ) : System.Xml.Linq.XElement

Formats a serialized XElement with options.

ShouldIgnoreProperty ( PropertyInfo property ) : bool

Checks if a property should not be serialized.

메소드 상세

AddChildElement() 공개 정적인 메소드

Adds the specified XElement to the parent XElement if it is not null;
public static AddChildElement ( System.Xml.Linq.XElement child, System.Xml.Linq.XElement parent ) : void
child System.Xml.Linq.XElement The child XElement to add to the parent XElement.
parent System.Xml.Linq.XElement The parent XElement to add the child XElement to.
리턴 void

GetChildElement() 공개 정적인 메소드

Gets the name-specified child XElement of the parent XElement.
public static GetChildElement ( string name, System.Xml.Linq.XElement parent ) : System.Xml.Linq.XElement
name string The name of the child XElement to get.
parent System.Xml.Linq.XElement The parent of the child XElement to get.
리턴 System.Xml.Linq.XElement

GetCollectionElementName() 공개 정적인 메소드

Gets the custom name of collection elements of a property. Defaults to "Element".
public static GetCollectionElementName ( PropertyInfo property ) : string
property System.Reflection.PropertyInfo The property to use.
리턴 string

GetDictionaryElementName() 공개 정적인 메소드

Gets the custom name of collection key and value elements of a property.
public static GetDictionaryElementName ( PropertyInfo property ) : string>.KeyValuePair
property System.Reflection.PropertyInfo The property to use.
리턴 string>.KeyValuePair

GetElementType() 공개 정적인 메소드

Gets the type of an object from its serialized XElement (e.g. if it has a type attribute) and its parent container type (e.g. if it is generic).
public static GetElementType ( System.Xml.Linq.XElement element, Type parentType, int genericArgumentIndex ) : Type
element System.Xml.Linq.XElement The XElement representing the object used to get the type.
parentType System.Type The type of the object's parent container used to check if the object is in a generic container.
genericArgumentIndex int The index of the object's type in the list of its parent container's generic arguments.
리턴 System.Type

GetIdentifier() 공개 정적인 메소드

Gets the XML identifier of the member.
public static GetIdentifier ( MemberInfo memberInfo ) : string
memberInfo System.Reflection.MemberInfo The information about the member to use.
리턴 string

GetIdentifier() 공개 정적인 메소드

Gets the XML identifier of the class from an object of that class.
public static GetIdentifier ( object obj ) : string
obj object The object to use.
리턴 string

SetupSerializedElement() 공개 정적인 메소드

Formats a serialized XElement with options.
public static SetupSerializedElement ( object value, System.Xml.Linq.XElement element, XmlConvertOptions options ) : System.Xml.Linq.XElement
value object The object serialized.
element System.Xml.Linq.XElement The serialized XElement of the object.
options XmlConvertOptions Indicates how the output is formatted or serialized.
리턴 System.Xml.Linq.XElement

ShouldIgnoreProperty() 공개 정적인 메소드

Checks if a property should not be serialized.
public static ShouldIgnoreProperty ( PropertyInfo property ) : bool
property System.Reflection.PropertyInfo The property to check.
리턴 bool