ClassXamlSerializer
Provides functionality for serializing and deserializing XAML documents.
Definition
Namespace:Telerik.Windows.Documents.Xaml
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public class XamlSerializer
Inheritance: objectXamlSerializer
Constructors
XamlSerializer()
Declaration
public XamlSerializer()
Fields
AttachedProperties
Declaration
protected Dictionary<Type, List<XamlSerializer.AttachedProperty>> AttachedProperties
Field Value
BuiltIn
Declaration
protected static readonly TypeConverter BuiltIn
Field Value
PropEquals
Declaration
protected static readonly IEqualityComparer<PropertyInfo> PropEquals
Field Value
PropertiesToSkip
Declaration
protected HashSet<PropertyInfo> PropertiesToSkip
Field Value
RefEquals
Declaration
protected static readonly IEqualityComparer<object> RefEquals
Field Value
TypeConverters
Declaration
protected IDictionary<Type, TypeConverter> TypeConverters
Field Value
XamlNamespace
Declaration
public const string XamlNamespace = "http://schemas.microsoft.com/winfx/2006/xaml"
Field Value
Methods
CanWriteProperty(PropertyInfo)
Declaration
protected bool CanWriteProperty(PropertyInfo propertyInfo)
Parameters
propertyInfo
Returns
DiscoverAttachedProperties(Assembly)
Discovers attached properties defined in the specified assembly.
Declaration
public void DiscoverAttachedProperties(Assembly asm)
Parameters
asm
The assembly to search for attached properties.
DiscoverAttachedProperties(Type)
Discovers all attached properties defined for the specified type.
Declaration
public void DiscoverAttachedProperties(Type type)
Parameters
type
The type for which to discover attached properties.
GetAttachedOrder(AttachedProperty)
Declaration
protected virtual string GetAttachedOrder(XamlSerializer.AttachedProperty attachedProperty)
Parameters
attachedProperty
Returns
GetAttachedProperties(Type)
Declaration
protected IEnumerable<XamlSerializer.AttachedProperty> GetAttachedProperties(Type type)
Parameters
type
Returns
GetContentProperty(object)
Declaration
protected PropertyInfo GetContentProperty(object obj)
Parameters
obj
Returns
GetNamespace(Type, IDictionary<string, string>)
Declaration
protected string GetNamespace(Type type, IDictionary<string, string> prefixMappings)
Parameters
type
prefixMappings
Returns
GetPrefix(string, IDictionary<string, string>, XmlWriter)
Declaration
protected virtual string GetPrefix(string ns, IDictionary<string, string> prefixMappings, XmlWriter writer)
Parameters
ns
prefixMappings
writer
XmlWriter
Returns
GetPropertyGetter(PropertyInfo)
Declaration
protected static Func<object, object> GetPropertyGetter(PropertyInfo propertyInfo)
Parameters
propertyInfo
Returns
GetPropertyOrder(PropertyInfo)
Declaration
protected virtual string GetPropertyOrder(PropertyInfo prop)
Parameters
prop
Returns
GetTypeConverter(MemberInfo)
Declaration
protected TypeConverter GetTypeConverter(MemberInfo memberInfo)
Parameters
memberInfo
Returns
GetXmlWriter(StringBuilder)
Declaration
protected virtual XmlWriter GetXmlWriter(StringBuilder output)
Parameters
output
Returns
XmlWriter
RegisterAttachedProperty(MethodInfo, MethodInfo)
Registers an attached property using the specified getter and setter methods.
Declaration
public bool RegisterAttachedProperty(MethodInfo getter, MethodInfo setter)
Parameters
getter
The MethodInfo representing the getter method for the attached property.
setter
The MethodInfo representing the setter method for the attached property.
Returns
Returns a boolean value indicating whether the registration of the attached property was successful.
ShouldSerialize(object, object, PropertyInfo)
Declaration
protected virtual bool ShouldSerialize(object obj, object propValue, PropertyInfo prop)
Parameters
obj
propValue
prop
Returns
VisitAfterBeginElement(object, XmlWriter, IDictionary<string, string>, HashSet<object>)
Declaration
protected virtual void VisitAfterBeginElement(object obj, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)
Parameters
obj
writer
XmlWriter
prefixMappings
cycleCheckObjects
VisitAttachedProperty(object, object, string, MethodInfo, MethodInfo, XmlWriter, IDictionary<string, string>, HashSet<object>)
Declaration
protected virtual void VisitAttachedProperty(object obj, object propValue, string propertyName, MethodInfo getter, MethodInfo setter, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)
Parameters
obj
propValue
propertyName
getter
setter
writer
XmlWriter
prefixMappings
cycleCheckObjects
VisitCollectionContents(IEnumerable, XmlWriter, IDictionary<string, string>, HashSet<object>)
Declaration
protected virtual void VisitCollectionContents(IEnumerable collection, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)
Parameters
collection
writer
XmlWriter
prefixMappings
cycleCheckObjects
VisitDictionaryContents(IDictionary, XmlWriter, IDictionary<string, string>, HashSet<object>)
Declaration
protected virtual void VisitDictionaryContents(IDictionary dictionary, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)
Parameters
dictionary
writer
XmlWriter
prefixMappings
cycleCheckObjects
VisitObject(object, XmlWriter, IDictionary<string, string>, HashSet<object>, bool, object)
Declaration
protected virtual void VisitObject(object obj, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects, bool isRoot = false, object key = null)
Parameters
obj
writer
XmlWriter
prefixMappings
cycleCheckObjects
isRoot
key
VisitProperty(object, object, PropertyInfo, bool, XmlWriter, IDictionary<string, string>, HashSet<object>)
Declaration
protected virtual void VisitProperty(object obj, object propValue, PropertyInfo prop, bool isContentProperty, XmlWriter writer, IDictionary<string, string> prefixMappings, HashSet<object> cycleCheckObjects)
Parameters
obj
propValue
prop
isContentProperty
writer
XmlWriter
prefixMappings
cycleCheckObjects