Class SerializableGraphSourceBase<TNode, TLink>
Represents a base class for a serializable graph source.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Controls.Diagrams.Extensions.ViewModels
Assembly: Telerik.Windows.Controls.Diagrams.Extensions.dll
Syntax
public abstract class SerializableGraphSourceBase<TNode, TLink> : ObservableGraphSourceBase<TNode, TLink>, INotifyPropertyChanged, IDisposable, ISerializableGraphSource, IObservableGraphSource, IGraphSource where TLink : ILink
Type Parameters
TNode
The type of the node. |
TLink
The type of the link. |
Constructors
SerializableGraphSourceBase()
Declaration
protected SerializableGraphSourceBase()
Properties
CachedNodes
Cache for the deserialized nodes.
Declaration
protected Dictionary<string, TNode> CachedNodes { get; }
Property Value
System.Collections.Generic.Dictionary<System.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
System.String
|
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
System.String
|
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
System.String
|
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
IConnection
connection
The connection. |
SerializationInfo
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
IShape
shape
The shape. |
SerializationInfo
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
TNode
node
The node. |
Returns
System.String
|
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
TLink
link
The link. |
SerializationInfo
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
TNode
node
The node. |
SerializationInfo
info
The info. |
Explicit Interface Implementations
ISerializableGraphSource.DeserializeLink(IConnection, SerializationInfo)
Declaration
ILink ISerializableGraphSource.DeserializeLink(IConnection connection, SerializationInfo info)
Parameters
IConnection
connection
|
SerializationInfo
info
|
Returns
ILink
|
Implements
ISerializableGraphSource.DeserializeNode(IShape, SerializationInfo)
Declaration
object ISerializableGraphSource.DeserializeNode(IShape shape, SerializationInfo info)
Parameters
IShape
shape
|
SerializationInfo
info
|
Returns
System.Object
|
Implements
ISerializableGraphSource.SerializeLink(ILink, SerializationInfo)
Declaration
void ISerializableGraphSource.SerializeLink(ILink link, SerializationInfo info)
Parameters
ILink
link
|
SerializationInfo
info
|
Implements
ISerializableGraphSource.SerializeNode(Object, SerializationInfo)
Declaration
void ISerializableGraphSource.SerializeNode(object model, SerializationInfo info)
Parameters
System.Object
model
|
SerializationInfo
info
|