ClassPersistenceManager
Manager class for serialization and deserialization.
Definition
Namespace:Telerik.Windows.Persistence
Assembly:Telerik.Windows.PersistenceFramework.dll
Syntax:
public class PersistenceManager : DependencyObject, IAllowedTypesSupport
Inheritance: objectPersistenceManager
Implements:
Constructors
PersistenceManager()
Initializes a new instance of the PersistenceManager class.
Declaration
public PersistenceManager()
Fields
SerializationOptionsProperty
Defines the SerializationOptions dependency property.
Declaration
public static readonly DependencyProperty SerializationOptionsProperty
Field Value
DependencyProperty
StorageIdProperty
Defines the StorageId dependency property.
Declaration
public static readonly DependencyProperty StorageIdProperty
Field Value
DependencyProperty
Properties
AllowCrossVersion
Gets or sets a value indicating whether you can deserialize Telerik controls with different version.
AllowedTypes
Gets or sets a collection of types, which are allowed to be instantiated by the deserialization mechanism.
Declaration
public ICollection<Type> AllowedTypes { get; set; }
Property Value
Implements
Deserializer
Gets or sets the deserialized used for deserialization.
Declaration
protected IDeserializer Deserializer { get; set; }
Property Value
Serializer
Gets or sets the Serializer used for serialization.
Declaration
protected ISerializer Serializer { get; set; }
Property Value
Methods
GetDeserializerOverride()
Gets the deserialization object used for deserialization.
Declaration
protected virtual IDeserializer GetDeserializerOverride()
Returns
GetSerializationOptions(DependencyObject)
Declaration
public static SerializationMetadataCollection GetSerializationOptions(DependencyObject obj)
Parameters
obj
DependencyObject
Returns
GetSerializerOverride()
Gets the serialized used for serialization.
Declaration
protected virtual ISerializer GetSerializerOverride()
Returns
Returns the serializer.
GetStorage()
Gets the current storage with the serialization objects.
GetStorageId(DependencyObject)
Declaration
public static string GetStorageId(DependencyObject obj)
Parameters
obj
DependencyObject
Returns
Load(Stream)
Loads the objects from the specified stream.
Declaration
public virtual void Load(Stream stream)
Parameters
stream
The stream.
Remarks
The persisted data will be restored on the objects, that have StorageIdProperty property set.
Load(object, Stream)
Loads the specified object.
OnPersistenceError(PersistenceErrorEventArgs)
Raises the PersistenceError event.
Declaration
protected virtual void OnPersistenceError(PersistenceErrorEventArgs args)
Parameters
args
Event args.
OnPropertyPersisted(PersistenceEventArgs)
Raises the PropertyPersisted event.
Declaration
protected virtual void OnPropertyPersisted(PersistenceEventArgs args)
Parameters
args
Event args.
OnPropertyPersistenceCompleted(EventArgs)
Raises the PropertyPersistenceCompleted event.
Declaration
protected virtual void OnPropertyPersistenceCompleted(EventArgs args)
Parameters
args
Event args.
OnPropertyPersisting(PersistingPropertyEventArgs)
Raises the PropertyPersisting event.
Declaration
protected virtual bool OnPropertyPersisting(PersistingPropertyEventArgs args)
Parameters
args
Event args.
Returns
Returns true if the event is to be cancelled.
OnPropertyRestored(PersistenceEventArgs)
Raises the PropertyRestored event.
Declaration
protected virtual void OnPropertyRestored(PersistenceEventArgs args)
Parameters
args
Event args.
OnPropertyRestoring(RestoringPropertyEventArgs)
Raises the PropertyRestoring event.
Declaration
protected virtual bool OnPropertyRestoring(RestoringPropertyEventArgs args)
Parameters
args
Event args.
Returns
Returns true if the event is to be cancelled.
OnPropertyRestoringCompleted(EventArgs)
Raises the PropertyRestoringCompleted event.
Declaration
protected virtual void OnPropertyRestoringCompleted(EventArgs args)
Parameters
args
Event args.
OnTypeRestored(TypeRestoredEventArgs)
Raises the event.
Declaration
protected virtual Type OnTypeRestored(TypeRestoredEventArgs args)
Parameters
args
The TypeRestoredEventArgs instance containing the event data.
Returns
OverrideStorage(ObjectStorage)
Overrides the storage.
Declaration
public static void OverrideStorage(ObjectStorage newStorage)
Parameters
newStorage
The new storage.
Save()
Saves the specified object.
Declaration
public virtual Stream Save()
Returns
Returns the serialized stream.
Remarks
This method will serialize the objects, which have StorageIdProperty property set.
Save(object)
Saves the specified object.
SetSerializationOptions(DependencyObject, SerializationMetadataCollection)
Declaration
public static void SetSerializationOptions(DependencyObject obj, SerializationMetadataCollection value)
Parameters
obj
DependencyObject
value
SetStorageId(DependencyObject, string)
Declaration
public static void SetStorageId(DependencyObject obj, string value)
Parameters
obj
DependencyObject
value
Events
PersistenceError
Raised when an error occurs while persisting or restoring.
Declaration
public event PersistenceErrorEventHandler PersistenceError
Event Value
PropertyPersisted
Raised when a property has been persisted.
Declaration
public event PropertyPersistedEventHandler PropertyPersisted
Event Value
PropertyPersistenceCompleted
Raised when all properties have been persisted.
Declaration
public event PropertyPersistenceCompletedEventHandler PropertyPersistenceCompleted
Event Value
PropertyPersisting
Raised when a property is being persisted.
Declaration
public event PropertyPersistingEventHandler PropertyPersisting
Event Value
PropertyRestored
Raised when a property has been restored.
Declaration
public event PropertyRestoredEventHandler PropertyRestored
Event Value
PropertyRestoring
Raised when a property is being restored.
Declaration
public event PropertyRestoringEventHandler PropertyRestoring
Event Value
PropertyRestoringCompleted
Raised when all properties has been restored.
Declaration
public event PropertyRestoringCompletedEventHandler PropertyRestoringCompleted
Event Value
TypeRestored
Occurs when type is restored.
Declaration
public event EventHandler<TypeRestoredEventArgs> TypeRestored
Event Value