ClassSerializableGraphSourceBase<TNode, TLink>
Represents a base class for a serializable graph source.
Definition
Namespace:Telerik.Windows.Controls.Diagrams.Extensions.ViewModels
Assembly:Telerik.Windows.Controls.Diagrams.Extensions.dll
Type Parameters:
TNode
The type of the node.
TLink
The type of the link.
Syntax:
public abstract class SerializableGraphSourceBase<TNode, TLink> : ObservableGraphSourceBase<TNode, TLink>, INotifyPropertyChanged, IDisposable, ISerializableGraphSource, IObservableGraphSource, IGraphSource where TLink : ILink
Inheritance: objectViewModelBaseGraphSourceBase<TNode, TLink>ObservableGraphSourceBase<TNode, TLink>SerializableGraphSourceBase<TNode, TLink>
Implements:
Inherited Members
Constructors
SerializableGraphSourceBase()
Declaration
protected SerializableGraphSourceBase()
Properties
CachedNodes
Cache for the deserialized nodes.
Declaration
protected Dictionary<string, TNode> CachedNodes { get; }
Property Value
Dictionary<string, TNode>
NodeUniqueIdKey
Gets the node unique id key. This key is used to save the unique id of the node in the serialization info.
Declaration
protected virtual string NodeUniqueIdKey { get; }
Property Value
SourceUniqueIdKey
Gets the source unique id key. This key is used to save the unique id of the source of the link in the serialization info.
Declaration
protected virtual string SourceUniqueIdKey { get; }
Property Value
TargetUniqueIdKey
Gets the target unique id key. This key is used to save the unique id of the target of the link in the serialization info.
Declaration
protected virtual string TargetUniqueIdKey { get; }
Property Value
Methods
ClearCache()
Clears the deserialization cache. The cache contains the generated items when deserializing the saved data. The cache should be cleared either before or after the deserialization of the graph source.
Declaration
public void ClearCache()
DeserializeLink(IConnection, SerializationInfo)
Deserializes the link. When overridden, this method creates a new instance of the link and restores any saved information from the serialization info.
Declaration
public virtual TLink DeserializeLink(IConnection connection, SerializationInfo info)
Parameters
connection
The connection.
info
The info.
Returns
TLink
DeserializeNode(IShape, SerializationInfo)
Deserializes the node. When overridden, this method creates a new instance of the node and restores any saved information from the serialization info.
Declaration
public virtual TNode DeserializeNode(IShape shape, SerializationInfo info)
Parameters
shape
The shape.
info
The info.
Returns
TNode
GetNodeUniqueId(TNode)
Gets the node's unique id. This id should be always unique and should not rely on the object's reference.
Declaration
public abstract string GetNodeUniqueId(TNode node)
Parameters
node
TNode
The node.
Returns
SerializeLink(TLink, SerializationInfo)
Serializes the link. When overridden, this method saves important information about the link in the specified serialization info.
Declaration
public virtual void SerializeLink(TLink link, SerializationInfo info)
Parameters
link
TLink
The link.
info
The info.
SerializeNode(TNode, SerializationInfo)
Serializes the node. When overridden, this method saves important information about the node in the specified serialization info.
Declaration
public virtual void SerializeNode(TNode node, SerializationInfo info)
Parameters
node
TNode
The node.
info
The info.