IXmlSerializerProperty Interface
Defines the base requirements for a property that supports XML serialization.
public interface IXmlSerializerProperty
Properties
IsReadOnly
Indicates if the property is read-only.
IsXmlAttribute
Indicates if the property will be serialized as an XML attribute.
LocalName
The local name explicitly defined for the property.
PropertyName
The name of the property.
PropertyType
The value type of the property.
ResolvedLocalName
The resolved local name for the property.
SourceType
The type of the source object which defines the property.
Methods
GetValue(object)
Gets the value of the property.
object? GetValue(object source)
| Parameter | Type | Description |
|---|---|---|
| source | object | The instance of the object whose property will be returned. |
Returns
SetValue(object, object?)
Sets the value of the property.
void SetValue(object source, object? value)
| Parameter | Type | Description |
|---|---|---|
| source | object | The instance of the object whose property will be set. |
| value | object | The value to assign to the property. |
ShouldSerialize(object)
Returns if the property should be serialized.
bool ShouldSerialize(object source)
| Parameter | Type | Description |
|---|---|---|
| source | object | The source instance of the object that defines the property. |
Returns
- bool:
trueif the property should be serialized; otherwise,false.