IDiagramModel

StockSharp.Xaml.Diagram.GXDiagram.Model

All diagram models implement this interface or an interface that inherits from this interface.

Properties

DataFormat
public string DataFormat { get; set; }
value = iDiagramModel.DataFormat
iDiagramModel.DataFormat = value

Gets or sets the format of this model's data.

IsChangingModel
public bool IsChangingModel { get; }
value = iDiagramModel.IsChangingModel

This property is true during a call to Boolean), indicating a change happening due to an undo or a redo.

IsInTransaction
public bool IsInTransaction { get; }
value = iDiagramModel.IsInTransaction

True if there is an UndoManager and a transaction has been started.

IsModified
public bool IsModified { get; set; }
value = iDiagramModel.IsModified
iDiagramModel.IsModified = value

Gets or sets whether this model is considered changed from an earlier state.

Modifiable
public bool Modifiable { get; set; }
value = iDiagramModel.Modifiable
iDiagramModel.Modifiable = value

Gets or sets whether various model-changing methods are enabled.

Name
public string Name { get; set; }
value = iDiagramModel.Name
iDiagramModel.Name = value

A name for this model.

NodesSource
public IEnumerable NodesSource { get; set; }
value = iDiagramModel.NodesSource
iDiagramModel.NodesSource = value

Gets or sets the collection of node data items for the model.

SkipsUndoManager
public bool SkipsUndoManager { get; set; }
value = iDiagramModel.SkipsUndoManager
iDiagramModel.SkipsUndoManager = value

Gets or sets a flag that controls whether the model notifies any UndoManager that a change has occurred.

UndoManager
public UndoManager UndoManager { get; set; }
value = iDiagramModel.UndoManager
iDiagramModel.UndoManager = value

Gets or sets the UndoManager for this model.

Methods

AddCollectionCopy
public ICopyDictionary AddCollectionCopy(IDataCollection coll, ICopyDictionary env)
result = iDiagramModel.AddCollectionCopy(coll, env)

Copy existing data and add to this model.

coll
the collection of data to be copied
env
the ICopyDictionary used to keep track of copied objects; if null, the method will call CreateCopyDictionary, use it, and return it

Returns: the updated copy dictionary

AddNode
public void AddNode(object nodedata)
iDiagramModel.AddNode(nodedata)

Add a node data to NodesSource.

nodedata
AddNodeCopy
public object AddNodeCopy(object nodedata)
result = iDiagramModel.AddNodeCopy(nodedata)

Add a copy of a node data to this model.

nodedata

Returns: the copied node data

ChangeModel
public void ChangeModel(ModelChangedEventArgs e, bool undo)
iDiagramModel.ChangeModel(e, undo)

This is called during an Undo or a Redo to actually make state changes to this model or to this model's data.

e
an edit describing the change to be performed
undo
true if undoing; false if redoing
ClearUnresolvedReferences
public void ClearUnresolvedReferences()
iDiagramModel.ClearUnresolvedReferences()

Forget all unresolved delayed or forward references.

CommitTransaction
public bool CommitTransaction(string tname)
result = iDiagramModel.CommitTransaction(tname)

Call the UndoManager's CommitTransaction method.

tname
a String describing the transaction
CreateCopyDictionary
public ICopyDictionary CreateCopyDictionary()
result = iDiagramModel.CreateCopyDictionary()

Create an ICopyDictionary initialized for this model.

Returns: Normally this will be an empty dictionary.

CreateDataCollection
public IDataCollection CreateDataCollection()
result = iDiagramModel.CreateDataCollection()

Create an empty IDataCollection for this model.

CreateInitializedCopy
public IDiagramModel CreateInitializedCopy(IDataCollection init)
result = iDiagramModel.CreateInitializedCopy(init)

Create a copy of this model initialized with different data.

init
this may be null, meaning no initial data

Returns: a model of the same type as this

DoNodeAdded
public void DoNodeAdded(object nodedata)
iDiagramModel.DoNodeAdded(nodedata)

This should be called when a node data object is added to the NodesSource collection.

nodedata
DoNodeKeyChanged
public void DoNodeKeyChanged(object nodedata)
iDiagramModel.DoNodeKeyChanged(nodedata)

This should be called when a node data's key value may have changed.

nodedata
DoNodeRemoved
public void DoNodeRemoved(object nodedata)
iDiagramModel.DoNodeRemoved(nodedata)

This should be called when a node data object is removed from the NodesSource collection.

nodedata
FindNodeByKey
public object FindNodeByKey(object key)
result = iDiagramModel.FindNodeByKey(key)

Given a key, find the node data with that key.

key
a value of null for this argument will result in the default value for the node data Type

Returns: a node data with that key, if it is present in the model; the value will be the default for the type if no such node data is known to be in this model

GetCategoryForNode
public string GetCategoryForNode(object nodedata)
result = iDiagramModel.GetCategoryForNode(nodedata)

To help distinguish between different kinds of nodes, each node has a "category" that is just a string.

nodedata

Returns: the default category is the empty string

GetConnectedNodesForNode
public IEnumerable<object> GetConnectedNodesForNode(object nodedata)
result = iDiagramModel.GetConnectedNodesForNode(nodedata)

Return a sequence of node data that are directly connected to a given node, in either direction.

nodedata

Returns: an IEnumerable

GetFromNodesForNode
public IEnumerable<object> GetFromNodesForNode(object nodedata)
result = iDiagramModel.GetFromNodesForNode(nodedata)

Return a sequence of node data that are directly connected by links going into a given node.

nodedata

Returns: an IEnumerable

GetNodeType
public Type GetNodeType()
result = iDiagramModel.GetNodeType()

Return the Type of the node data.

Returns: a Type, not a node data object, nor a string

GetToNodesForNode
public IEnumerable<object> GetToNodesForNode(object nodedata)
result = iDiagramModel.GetToNodesForNode(nodedata)

Return a sequence of node data that are directly connected by links coming out from a given node.

nodedata

Returns: an IEnumerable

IsLinked
public bool IsLinked(object fromdata, object fromparam, object todata, object toparam)
result = iDiagramModel.IsLinked(fromdata, fromparam, todata, toparam)

This predicate is true if there is a link from one node data/port to another one.

fromdata
a node key identifying the node data from which the link comes
fromparam
an optional value identifying which port on the "from" node the link is connected to
todata
a node key identify the node data to which the link goes
toparam
an optional value identifying which port on the "to" node the link is connected to

Returns: true if there are any links

IsLinkValid
public bool IsLinkValid(object fromdata, object fromparam, object todata, object toparam)
result = iDiagramModel.IsLinkValid(fromdata, fromparam, todata, toparam)

This predicate is true if adding a link between two nodes/ports would result in a valid graph.

fromdata
a node key identifying the node data from which the link comes
fromparam
an optional value identifying which port on the "from" node the link is connected to
todata
a node key identify the node data to which the link goes
toparam
an optional value identifying which port on the "to" node the link is connected to
IsNodeData
public bool IsNodeData(object nodedata)
result = iDiagramModel.IsNodeData(nodedata)

This predicate is true if the argument is a node data in this model.

nodedata
the object to be checked to see if it is a known node data in this model

Returns: true if the is in the NodesSource

IsNodeType
public bool IsNodeType(object nodedata)
result = iDiagramModel.IsNodeType(nodedata)

This predicate is true when the argument is an instance of the node data Type.

nodedata
the arbitrary object to be checked for compatibility to be a node data

Returns: true if the can be cast to the the node data Type; false otherwise

RaiseChanged
public void RaiseChanged(ModelChangedEventArgs e)
iDiagramModel.RaiseChanged(e)

Raise a Changed event, given a ModelChangedEventArgs.

e
a ModelChangedEventArgs that describes what changed and how
RemoveNode
public void RemoveNode(object nodedata)
iDiagramModel.RemoveNode(nodedata)

Remove node data from NodesSource.

nodedata
RollbackTransaction
public bool RollbackTransaction()
result = iDiagramModel.RollbackTransaction()

Call the UndoManager's RollbackTransaction method.

StartTransaction
public bool StartTransaction(string tname)
result = iDiagramModel.StartTransaction(tname)

Call the UndoManager's StartTransaction method.

tname
a String describing the transaction

Returns: the value of the call to StartTransaction

Events

Changed
public event EventHandler<ModelChangedEventArgs> Changed
iDiagramModel.Changed += handler

The Changed event is raised whenever the model is modified.