Class
SerializableGraphSourceBase<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:

cs-api-definition
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: IDisposableIGraphSourceINotifyPropertyChangedIObservableGraphSourceISerializableGraphSource

Inherited Members ObservableGraphSourceBase<TNode, TLink>.CreateLink(object, object)ObservableGraphSourceBase<TNode, TLink>.CreateNode(IShape)GraphSourceBase<TNode, TLink>.AddNode(TNode)GraphSourceBase<TNode, TLink>.AddLink(TLink)GraphSourceBase<TNode, TLink>.RemoveLink(TLink)GraphSourceBase<TNode, TLink>.RemoveItem(TNode)GraphSourceBase<TNode, TLink>.Clear()GraphSourceBase<TNode, TLink>.InternalItemsGraphSourceBase<TNode, TLink>.InternalLinksGraphSourceBase<TNode, TLink>.ItemsGraphSourceBase<TNode, TLink>.LinksViewModelBase.VerifyPropertyName(string)ViewModelBase.InvokeOnUIThread(Action)ViewModelBase.Dispose()ViewModelBase.RaisePropertyChanged(string)ViewModelBase.OnPropertyChanged(string)ViewModelBase.OnPropertyChanged<T>(Expression<Func<T>>)ViewModelBase.Dispose(bool)ViewModelBase.PropertyChanged

Constructors

SerializableGraphSourceBase()

Declaration

cs-api-definition
protected SerializableGraphSourceBase()

Properties

CachedNodes

Cache for the deserialized nodes.

Declaration

cs-api-definition
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

cs-api-definition
protected virtual string NodeUniqueIdKey { get; }

Property Value

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

cs-api-definition
protected virtual string SourceUniqueIdKey { get; }

Property Value

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

cs-api-definition
protected virtual string TargetUniqueIdKey { get; }

Property Value

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

cs-api-definition
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.

Declaration

cs-api-definition
public virtual TLink DeserializeLink(IConnection connection, SerializationInfo info)

Parameters

connection

IConnection

The connection.

info

SerializationInfo

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

cs-api-definition
public virtual TNode DeserializeNode(IShape shape, SerializationInfo info)

Parameters

shape

IShape

The shape.

info

SerializationInfo

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

cs-api-definition
public abstract string GetNodeUniqueId(TNode node)

Parameters

node

TNode

The node.

Returns

string

Serializes the link. When overridden, this method saves important information about the link in the specified serialization info.

Declaration

cs-api-definition
public virtual void SerializeLink(TLink link, SerializationInfo info)

Parameters

link

TLink

The link.

info

SerializationInfo

The info.

SerializeNode(TNode, SerializationInfo)

Serializes the node. When overridden, this method saves important information about the node in the specified serialization info.

Declaration

cs-api-definition
public virtual void SerializeNode(TNode node, SerializationInfo info)

Parameters

node

TNode

The node.

info

SerializationInfo

The info.