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.Windows.DependencyProperty
|
StorageIdProperty
Defines the StorageId dependency property.
Declaration
public static readonly DependencyProperty StorageIdProperty
Field Value
System.Windows.DependencyProperty
|
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.Boolean
|
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.Collections.Generic.ICollection<System.Type>
|
Implements
Deserializer
Gets or sets the deserialized used for deserialization.
Declaration
protected IDeserializer Deserializer { get; set; }
Property Value
IDeserializer
|
Serializer
Gets or sets the Serializer used for serialization.
Declaration
protected ISerializer Serializer { get; set; }
Property Value
ISerializer
|
Methods
add_PersistenceError(PersistenceErrorEventHandler)
Declaration
public void add_PersistenceError(PersistenceErrorEventHandler value)
Parameters
PersistenceErrorEventHandler
value
|
add_PropertyPersisted(PropertyPersistedEventHandler)
Declaration
public void add_PropertyPersisted(PropertyPersistedEventHandler value)
Parameters
PropertyPersistedEventHandler
value
|
add_PropertyPersistenceCompleted(PropertyPersistenceCompletedEventHandler)
Declaration
public void add_PropertyPersistenceCompleted(PropertyPersistenceCompletedEventHandler value)
Parameters
PropertyPersistenceCompletedEventHandler
value
|
add_PropertyPersisting(PropertyPersistingEventHandler)
Declaration
public void add_PropertyPersisting(PropertyPersistingEventHandler value)
Parameters
PropertyPersistingEventHandler
value
|
add_PropertyRestored(PropertyRestoredEventHandler)
Declaration
public void add_PropertyRestored(PropertyRestoredEventHandler value)
Parameters
PropertyRestoredEventHandler
value
|
add_PropertyRestoring(PropertyRestoringEventHandler)
Declaration
public void add_PropertyRestoring(PropertyRestoringEventHandler value)
Parameters
PropertyRestoringEventHandler
value
|
add_PropertyRestoringCompleted(PropertyRestoringCompletedEventHandler)
Declaration
public void add_PropertyRestoringCompleted(PropertyRestoringCompletedEventHandler value)
Parameters
PropertyRestoringCompletedEventHandler
value
|
GetDeserializerOverride()
Gets the deserialization object used for deserialization.
Declaration
protected virtual IDeserializer GetDeserializerOverride()
Returns
IDeserializer
|
GetSerializationOptions(DependencyObject)
Declaration
public static SerializationMetadataCollection GetSerializationOptions(DependencyObject obj)
Parameters
System.Windows.DependencyObject
obj
|
Returns
SerializationMetadataCollection
|
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
ObjectStorage
|
GetStorageId(DependencyObject)
Declaration
public static string GetStorageId(DependencyObject obj)
Parameters
System.Windows.DependencyObject
obj
|
Returns
System.String
|
Load(Stream)
Loads the objects from the specified stream.
Declaration
public virtual void Load(Stream stream)
Parameters
System.IO.Stream
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.
Declaration
public virtual void Load(object obj, Stream stream)
Parameters
System.Object
obj
The object. |
System.IO.Stream
stream
The stream. |
OnPersistenceError(PersistenceErrorEventArgs)
Raises the PersistenceError event.
Declaration
protected virtual void OnPersistenceError(PersistenceErrorEventArgs args)
Parameters
PersistenceErrorEventArgs
args
Event args. |
OnPropertyPersisted(PersistenceEventArgs)
Raises the PropertyPersisted event.
Declaration
protected virtual void OnPropertyPersisted(PersistenceEventArgs args)
Parameters
PersistenceEventArgs
args
Event args. |
OnPropertyPersistenceCompleted(EventArgs)
Raises the PropertyPersistenceCompleted event.
Declaration
protected virtual void OnPropertyPersistenceCompleted(EventArgs args)
Parameters
System.EventArgs
args
Event args. |
OnPropertyPersisting(PersistingPropertyEventArgs)
Raises the PropertyPersisting event.
Declaration
protected virtual bool OnPropertyPersisting(PersistingPropertyEventArgs args)
Parameters
PersistingPropertyEventArgs
args
Event args. |
Returns
System.Boolean
Returns true if the event is to be cancelled. |
OnPropertyRestored(PersistenceEventArgs)
Raises the PropertyRestored event.
Declaration
protected virtual void OnPropertyRestored(PersistenceEventArgs args)
Parameters
PersistenceEventArgs
args
Event args. |
OnPropertyRestoring(RestoringPropertyEventArgs)
Raises the PropertyRestoring event.
Declaration
protected virtual bool OnPropertyRestoring(RestoringPropertyEventArgs args)
Parameters
RestoringPropertyEventArgs
args
Event args. |
Returns
System.Boolean
Returns true if the event is to be cancelled. |
OnPropertyRestoringCompleted(EventArgs)
Raises the PropertyRestoringCompleted event.
Declaration
protected virtual void OnPropertyRestoringCompleted(EventArgs args)
Parameters
System.EventArgs
args
Event args. |
OnTypeRestored(TypeRestoredEventArgs)
Raises the TypeRestored event.
Declaration
protected virtual Type OnTypeRestored(TypeRestoredEventArgs args)
Parameters
TypeRestoredEventArgs
args
The TypeRestoredEventArgs instance containing the event data. |
Returns
System.Type
|
OverrideStorage(ObjectStorage)
Overrides the storage.
Declaration
public static void OverrideStorage(ObjectStorage newStorage)
Parameters
ObjectStorage
newStorage
The new storage. |
remove_PersistenceError(PersistenceErrorEventHandler)
Declaration
public void remove_PersistenceError(PersistenceErrorEventHandler value)
Parameters
PersistenceErrorEventHandler
value
|
remove_PropertyPersisted(PropertyPersistedEventHandler)
Declaration
public void remove_PropertyPersisted(PropertyPersistedEventHandler value)
Parameters
PropertyPersistedEventHandler
value
|
remove_PropertyPersistenceCompleted(PropertyPersistenceCompletedEventHandler)
Declaration
public void remove_PropertyPersistenceCompleted(PropertyPersistenceCompletedEventHandler value)
Parameters
PropertyPersistenceCompletedEventHandler
value
|
remove_PropertyPersisting(PropertyPersistingEventHandler)
Declaration
public void remove_PropertyPersisting(PropertyPersistingEventHandler value)
Parameters
PropertyPersistingEventHandler
value
|
remove_PropertyRestored(PropertyRestoredEventHandler)
Declaration
public void remove_PropertyRestored(PropertyRestoredEventHandler value)
Parameters
PropertyRestoredEventHandler
value
|
remove_PropertyRestoring(PropertyRestoringEventHandler)
Declaration
public void remove_PropertyRestoring(PropertyRestoringEventHandler value)
Parameters
PropertyRestoringEventHandler
value
|
remove_PropertyRestoringCompleted(PropertyRestoringCompletedEventHandler)
Declaration
public void remove_PropertyRestoringCompleted(PropertyRestoringCompletedEventHandler value)
Parameters
PropertyRestoringCompletedEventHandler
value
|
Save()
Saves the specified object.
Declaration
public virtual Stream Save()
Returns
System.IO.Stream
Returns the serialized stream. |
Remarks
This method will serialize the objects, which have StorageIdProperty property set.
Save(Object)
Saves the specified object.
Declaration
public virtual Stream Save(object obj)
Parameters
System.Object
obj
The object. |
Returns
System.IO.Stream
Returns the serialized stream. |
SetSerializationOptions(DependencyObject, SerializationMetadataCollection)
Declaration
public static void SetSerializationOptions(DependencyObject obj, SerializationMetadataCollection value)
Parameters
System.Windows.DependencyObject
obj
|
SerializationMetadataCollection
value
|
SetStorageId(DependencyObject, String)
Declaration
public static void SetStorageId(DependencyObject obj, string value)
Parameters
System.Windows.DependencyObject
obj
|
System.String
value
|
Events
PersistenceError
Raised when an error occurs while persisting or restoring.
Declaration
public event PersistenceErrorEventHandler PersistenceError
Event Type
PersistenceErrorEventHandler
|
PropertyPersisted
Raised when a property has been persisted.
Declaration
public event PropertyPersistedEventHandler PropertyPersisted
Event Type
PropertyPersistedEventHandler
|
PropertyPersistenceCompleted
Raised when all properties have been persisted.
Declaration
public event PropertyPersistenceCompletedEventHandler PropertyPersistenceCompleted
Event Type
PropertyPersistenceCompletedEventHandler
|
PropertyPersisting
Raised when a property is being persisted.
Declaration
public event PropertyPersistingEventHandler PropertyPersisting
Event Type
PropertyPersistingEventHandler
|
PropertyRestored
Raised when a property has been restored.
Declaration
public event PropertyRestoredEventHandler PropertyRestored
Event Type
PropertyRestoredEventHandler
|
PropertyRestoring
Raised when a property is being restored.
Declaration
public event PropertyRestoringEventHandler PropertyRestoring
Event Type
PropertyRestoringEventHandler
|
PropertyRestoringCompleted
Raised when all properties has been restored.
Declaration
public event PropertyRestoringCompletedEventHandler PropertyRestoringCompleted
Event Type
PropertyRestoringCompletedEventHandler
|
TypeRestored
Occurs when type is restored.
Declaration
public event EventHandler<TypeRestoredEventArgs> TypeRestored
Event Type
System.EventHandler<TypeRestoredEventArgs>
|