Class PersistenceManager
Manager class for serialization and deserialization.
Inheritance
Namespace: Telerik.Windows.Persistence
Assembly: Telerik.Windows.PersistenceFramework.dll
Syntax
public class PersistenceManager : DependencyObject, IAllowedTypesSupport
Constructors
PersistenceManager()
Fields
SerializationOptionsProperty
Defines the SerializationOptions dependency property.
Declaration
public static readonly DependencyProperty SerializationOptionsProperty
Field Value
System.
|
StorageIdProperty
Defines the StorageId dependency property.
Declaration
public static readonly DependencyProperty StorageIdProperty
Field Value
System.
|
Properties
AllowCrossVersion
Gets or sets a value indicating whether you can deserialize Telerik controls with different version.
Declaration
public bool AllowCrossVersion { get; set; }
Property Value
System.
|
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
System.
|
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
add_PersistenceError(PersistenceErrorEventHandler)
Declaration
public void add_PersistenceError(PersistenceErrorEventHandler value)
Parameters
add_PropertyPersisted(PropertyPersistedEventHandler)
Declaration
public void add_PropertyPersisted(PropertyPersistedEventHandler value)
Parameters
add_PropertyPersistenceCompleted(PropertyPersistenceCompletedEventHandler)
Declaration
public void add_PropertyPersistenceCompleted(PropertyPersistenceCompletedEventHandler value)
Parameters
add_PropertyPersisting(PropertyPersistingEventHandler)
Declaration
public void add_PropertyPersisting(PropertyPersistingEventHandler value)
Parameters
add_PropertyRestored(PropertyRestoredEventHandler)
Declaration
public void add_PropertyRestored(PropertyRestoredEventHandler value)
Parameters
add_PropertyRestoring(PropertyRestoringEventHandler)
Declaration
public void add_PropertyRestoring(PropertyRestoringEventHandler value)
Parameters
add_PropertyRestoringCompleted(PropertyRestoringCompletedEventHandler)
Declaration
public void add_PropertyRestoringCompleted(PropertyRestoringCompletedEventHandler value)
Parameters
GetDeserializerOverride()
Gets the deserialization object used for deserialization.
Declaration
protected virtual IDeserializer GetDeserializerOverride()
Returns
GetSerializationOptions(DependencyObject)
Declaration
public static SerializationMetadataCollection GetSerializationOptions(DependencyObject obj)
Parameters
System.
|
Returns
GetSerializerOverride()
Gets the serialized used for serialization.
Declaration
protected virtual ISerializer GetSerializerOverride()
Returns
ISerializer
Returns the serializer. |
GetStorage()
Gets the current storage with the serialization objects.
Declaration
public static ObjectStorage GetStorage()
Returns
GetStorageId(DependencyObject)
Declaration
public static string GetStorageId(DependencyObject obj)
Parameters
System.
|
Returns
System.
|
Load(Stream)
Loads the objects from the specified stream.
Declaration
public virtual void Load(Stream stream)
Parameters
System. The stream. |
Remarks
The persisted data will be restored on the objects, that have Storage
Load(Object, Stream)
Loads the specified object.
Declaration
public virtual void Load(object obj, Stream stream)
Parameters
System. The object. |
System. The stream. |
OnPersistenceError(PersistenceErrorEventArgs)
Raises the PersistenceError event.
Declaration
protected virtual void OnPersistenceError(PersistenceErrorEventArgs args)
Parameters
Persistence Event args. |
OnPropertyPersisted(PersistenceEventArgs)
Raises the PropertyPersisted event.
Declaration
protected virtual void OnPropertyPersisted(PersistenceEventArgs args)
Parameters
Persistence Event args. |
OnPropertyPersistenceCompleted(EventArgs)
Raises the PropertyPersistenceCompleted event.
Declaration
protected virtual void OnPropertyPersistenceCompleted(EventArgs args)
Parameters
System. Event args. |
OnPropertyPersisting(PersistingPropertyEventArgs)
Raises the PropertyPersisting event.
Declaration
protected virtual bool OnPropertyPersisting(PersistingPropertyEventArgs args)
Parameters
Persisting Event args. |
Returns
System. Returns true if the event is to be cancelled. |
OnPropertyRestored(PersistenceEventArgs)
Raises the PropertyRestored event.
Declaration
protected virtual void OnPropertyRestored(PersistenceEventArgs args)
Parameters
Persistence Event args. |
OnPropertyRestoring(RestoringPropertyEventArgs)
Raises the PropertyRestoring event.
Declaration
protected virtual bool OnPropertyRestoring(RestoringPropertyEventArgs args)
Parameters
Restoring Event args. |
Returns
System. Returns true if the event is to be cancelled. |
OnPropertyRestoringCompleted(EventArgs)
Raises the PropertyRestoringCompleted event.
Declaration
protected virtual void OnPropertyRestoringCompleted(EventArgs args)
Parameters
System. Event args. |
OnTypeRestored(TypeRestoredEventArgs)
Raises the Type
Declaration
protected virtual Type OnTypeRestored(TypeRestoredEventArgs args)
Parameters
Type The Type |
Returns
System.
|
OverrideStorage(ObjectStorage)
Overrides the storage.
Declaration
public static void OverrideStorage(ObjectStorage newStorage)
Parameters
Object The new storage. |
remove_PersistenceError(PersistenceErrorEventHandler)
Declaration
public void remove_PersistenceError(PersistenceErrorEventHandler value)
Parameters
remove_PropertyPersisted(PropertyPersistedEventHandler)
Declaration
public void remove_PropertyPersisted(PropertyPersistedEventHandler value)
Parameters
remove_PropertyPersistenceCompleted(PropertyPersistenceCompletedEventHandler)
Declaration
public void remove_PropertyPersistenceCompleted(PropertyPersistenceCompletedEventHandler value)
Parameters
remove_PropertyPersisting(PropertyPersistingEventHandler)
Declaration
public void remove_PropertyPersisting(PropertyPersistingEventHandler value)
Parameters
remove_PropertyRestored(PropertyRestoredEventHandler)
Declaration
public void remove_PropertyRestored(PropertyRestoredEventHandler value)
Parameters
remove_PropertyRestoring(PropertyRestoringEventHandler)
Declaration
public void remove_PropertyRestoring(PropertyRestoringEventHandler value)
Parameters
remove_PropertyRestoringCompleted(PropertyRestoringCompletedEventHandler)
Declaration
public void remove_PropertyRestoringCompleted(PropertyRestoringCompletedEventHandler value)
Parameters
Save()
Saves the specified object.
Declaration
public virtual Stream Save()
Returns
System. Returns the serialized stream. |
Remarks
This method will serialize the objects, which have Storage
Save(Object)
Saves the specified object.
Declaration
public virtual Stream Save(object obj)
Parameters
System. The object. |
Returns
System. Returns the serialized stream. |
SetSerializationOptions(DependencyObject, SerializationMetadataCollection)
Declaration
public static void SetSerializationOptions(DependencyObject obj, SerializationMetadataCollection value)
Parameters
System.
|
Serialization
|
SetStorageId(DependencyObject, String)
Declaration
public static void SetStorageId(DependencyObject obj, string value)
Parameters
System.
|
System.
|
Events
PersistenceError
Raised when an error occurs while persisting or restoring.
Declaration
public event PersistenceErrorEventHandler PersistenceError
Event Type
PropertyPersisted
Raised when a property has been persisted.
Declaration
public event PropertyPersistedEventHandler PropertyPersisted
Event Type
PropertyPersistenceCompleted
Raised when all properties have been persisted.
Declaration
public event PropertyPersistenceCompletedEventHandler PropertyPersistenceCompleted
Event Type
PropertyPersisting
Raised when a property is being persisted.
Declaration
public event PropertyPersistingEventHandler PropertyPersisting
Event Type
PropertyRestored
Raised when a property has been restored.
Declaration
public event PropertyRestoredEventHandler PropertyRestored
Event Type
PropertyRestoring
Raised when a property is being restored.
Declaration
public event PropertyRestoringEventHandler PropertyRestoring
Event Type
PropertyRestoringCompleted
Raised when all properties has been restored.
Declaration
public event PropertyRestoringCompletedEventHandler PropertyRestoringCompleted
Event Type
TypeRestored
Occurs when type is restored.
Declaration
public event EventHandler<TypeRestoredEventArgs> TypeRestored
Event Type
System.
|