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
protected SerializableGraphSourceBase()
Properties
CachedNodes
Dictionary<string, TNode>
Cache for the deserialized nodes.
protected Dictionary<string, TNode> CachedNodes { get; }
Gets the node unique id key. This key is used to save the unique id of the node in the serialization info.
protected virtual string NodeUniqueIdKey { get; }
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.
protected virtual string SourceUniqueIdKey { get; }
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.
protected virtual string TargetUniqueIdKey { get; }
Methods
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.
public void ClearCache()
Deserializes the link. When overridden, this method creates a new instance of the link and restores any saved information from the serialization info.
public virtual TLink DeserializeLink(IConnection connection, SerializationInfo info)
The connection.
infoSerializationInfoThe info.
Returns:TLink
Deserializes the node. When overridden, this method creates a new instance of the node and restores any saved information from the serialization info.
public virtual TNode DeserializeNode(IShape shape, SerializationInfo info)
The shape.
infoSerializationInfoThe info.
Returns:TNode
Gets the node's unique id. This id should be always unique and should not rely on the object's reference.
Serializes the link. When overridden, this method saves important information about the link in the specified serialization info.
public virtual void SerializeLink(TLink link, SerializationInfo info)
The link.
infoSerializationInfoThe info.
Serializes the node. When overridden, this method saves important information about the node in the specified serialization info.
public virtual void SerializeNode(TNode node, SerializationInfo info)
The node.
infoSerializationInfoThe info.