Class XmlPropertySetting
Represents a property setting. Each property of Telerik controls can be serialized and deserialized through an instance of this class. The XMLPropertySetting instance describes the affected control, its property, and the current value. XmlPropertySetting is very similar to CSS style properties.
Inheritance
Inherited Members
Namespace: Telerik.WinControls
Assembly: Telerik.WinControls.dll
Syntax
public class XmlPropertySetting : ISerializationValidatable
Constructors
XmlPropertySetting()
Declaration
public XmlPropertySetting()
XmlPropertySetting(RadProperty, Object)
Declaration
public XmlPropertySetting(RadProperty property, object value)
Parameters
|
RadProperty
property
|
|
System.Object
value
|
Properties
Property
Gets or sets a string value indicating the property. For example, Telerik.WinControls.VisualElement.ForeColor.
Declaration
public string Property { get; set; }
Property Value
|
System.String
|
Value
Gets or sets an object value indicating the value of the property. For example, the value of Telerik.WinControls.VisualElement.ForeColor property could be "navy" or "128, 0, 255, 63".
Declaration
[SerializationConverter(typeof(XmlPropertySettingValueConverter))]
public object Value { get; set; }
Property Value
|
System.Object
|
Remarks
Here is how XmlPropertySetting determines whether to serialize Value or ValueString property when used in ThemeComponent with CodeDom serialization.
If the property belongs to an object from System, Telerik.WinControl or Telerik.WinCotnrols.UI assembly then Value will be serialized (the actual object). For values that are defined in other assemblies ValueString will be serialized. Tthis is Value, serialized as string using the TypeConverter specified by the corresponing RadProperty. This is important for late-binding for types declared in different assemblies: egg. Docking Otherwise a problem will occur when adding a ThemeComponent on the Form in a project which does not reference Docking or Grid, etc, or custom controls assembly.
For xml serializtion, property serialize always as string using the TypeConverter specified by the corresponing RadProperty.
ValueString
Gets or sets the value serialized to string using the corresponding property TypeConverter. Generally used in rear cases by CodeDom Serializer, if theme is serializaed to CodeDom
Declaration
public string ValueString { get; set; }
Property Value
|
System.String
|
Methods
Deserialize()
DeserializeProperty(String)
Deserializes the property given as a string. For example, Telerik.WinControls.VisualElement.ForeColor.
Declaration
public static RadProperty DeserializeProperty(string property)
Parameters
|
System.String
property
|
Returns
|
RadProperty
|
DeserializePropertySafe(String)
Deserializes the property given as a string. For example, Telerik.WinControls.VisualElement.ForeColor.
Declaration
public static RadProperty DeserializePropertySafe(string property)
Parameters
|
System.String
property
|
Returns
|
RadProperty
|
DeserializeValue(PropertyDescriptor, String, String, Boolean)
Declaration
public static object DeserializeValue(PropertyDescriptor prop, string value, string propertyDisplayName, bool throwOnError)
Parameters
|
System.ComponentModel.PropertyDescriptor
prop
|
|
System.String
value
|
|
System.String
propertyDisplayName
|
|
System.Boolean
throwOnError
|
Returns
|
System.Object
|
DeserializeValue(Type, String, String)
Declaration
public static object DeserializeValue(Type propertyType, string value, string propertyDisplayName)
Parameters
|
System.Type
propertyType
|
|
System.String
value
|
|
System.String
propertyDisplayName
|
Returns
|
System.Object
|
DeserializeValue(RadProperty, String)
Deserializes the given dependency property with the given value.
Declaration
public static object DeserializeValue(RadProperty property, string value)
Parameters
|
RadProperty
property
|
|
System.String
value
|
Returns
|
System.Object
|
DeserializeValue(RadProperty, String, Boolean)
Declaration
public static object DeserializeValue(RadProperty property, string value, bool throwOnError)
Parameters
|
RadProperty
property
|
|
System.String
value
|
|
System.Boolean
throwOnError
|
Returns
|
System.Object
|
GetConvertedValue(RadProperty, Object)
Declaration
protected object GetConvertedValue(RadProperty property, object value)
Parameters
|
RadProperty
property
|
|
System.Object
value
|
Returns
|
System.Object
|
GetDeserializedProperty()
Retrieves the deserialized property.
Declaration
public RadProperty GetDeserializedProperty()
Returns
|
RadProperty
|
GetPropertyName()
Retrieves the name of the property.
Declaration
public string GetPropertyName()
Returns
|
System.String
|
SerializeValue(PropertyDescriptor, Object, String)
Declaration
public static string SerializeValue(PropertyDescriptor prop, object value, string propertyDisplayName)
Parameters
|
System.ComponentModel.PropertyDescriptor
prop
|
|
System.Object
value
|
|
System.String
propertyDisplayName
|
Returns
|
System.String
|
SerializeValue(RadProperty, Object)
Serializes the given dependency property with the given value.
Declaration
public static string SerializeValue(RadProperty property, object value)
Parameters
|
RadProperty
property
|
|
System.Object
value
|
Returns
|
System.String
|
SetSerializeValueAsString(Boolean)
Declaration
public void SetSerializeValueAsString(bool value)
Parameters
|
System.Boolean
value
|
ToString()
Retrieves a string representation of the class.
Declaration
public override string ToString()
Returns
|
System.String
|
Overrides
Explicit Interface Implementations
ISerializationValidatable.Validate()
Declaration
void ISerializationValidatable.Validate()