IDiagramModel
All diagram models implement this interface or an interface that inherits from this interface.
Свойства
DataFormat : string
Gets or sets the format of this model's data.
IsChangingModel : bool
This property is true during a call to Boolean), indicating a change happening due to an undo or a redo.
IsInTransaction : bool
True if there is an UndoManager and a transaction has been started.
IsModified : bool
Gets or sets whether this model is considered changed from an earlier state.
Modifiable : bool
Gets or sets whether various model-changing methods are enabled.
NodesSource : IEnumerable
Gets or sets the collection of node data items for the model.
SkipsUndoManager : bool
Gets or sets a flag that controls whether the model notifies any UndoManager that a change has occurred.
UndoManager : UndoManager
Gets or sets the UndoManager for this model.
Методы
AddCollectionCopy(IDataCollection, ICopyDictionary) : ICopyDictionary
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
Возвращает: the updated copy dictionary
AddLink(object, object, object, object) : object
Add a link between one node/port and another node/port.
- 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
AddNodeCopy(object) : object
Add a copy of a node data to this model.
- nodedata
Возвращает: the copied node data
ChangeModel(ModelChangedEventArgs, bool)
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()
Forget all unresolved delayed or forward references.
CommitTransaction(string) : bool
Call the UndoManager's CommitTransaction method.
- tname
- a String describing the transaction
CreateCopyDictionary() : ICopyDictionary
Create an ICopyDictionary initialized for this model.
Возвращает: Normally this will be an empty dictionary.
CreateDataCollection() : IDataCollection
Create an empty IDataCollection for this model.
CreateInitializedCopy(IDataCollection) : IDiagramModel
Create a copy of this model initialized with different data.
- init
- this may be null, meaning no initial data
Возвращает: a model of the same type as this
DoNodeAdded(object)
This should be called when a node data object is added to the NodesSource collection.
- nodedata
DoNodeKeyChanged(object)
This should be called when a node data's key value may have changed.
- nodedata
DoNodeRemoved(object)
This should be called when a node data object is removed from the NodesSource collection.
- nodedata
FindNodeByKey(object) : object
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
Возвращает: 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(object) : string
To help distinguish between different kinds of nodes, each node has a "category" that is just a string.
- nodedata
Возвращает: the default category is the empty string
GetConnectedNodesForNode(object) : IEnumerable<object>
Return a sequence of node data that are directly connected to a given node, in either direction.
- nodedata
Возвращает: an IEnumerable
GetFromNodesForNode(object) : IEnumerable<object>
Return a sequence of node data that are directly connected by links going into a given node.
- nodedata
Возвращает: an IEnumerable
GetNodeType() : Type
Return the Type of the node data.
Возвращает: a Type, not a node data object, nor a string
GetToNodesForNode(object) : IEnumerable<object>
Return a sequence of node data that are directly connected by links coming out from a given node.
- nodedata
Возвращает: an IEnumerable
IsLinked(object, object, object, object) : bool
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
Возвращает: true if there are any links
IsLinkValid(object, object, object, object) : bool
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(object) : bool
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
Возвращает: true if the is in the NodesSource
IsNodeType(object) : bool
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
Возвращает: true if the can be cast to the the node data Type; false otherwise
RaiseChanged(ModelChangedEventArgs)
Raise a Changed event, given a ModelChangedEventArgs.
- e
- a ModelChangedEventArgs that describes what changed and how
RemoveLink(object, object, object, object)
Remove all links connecting the two nodes/ports in the one direction.
- 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
RollbackTransaction() : bool
Call the UndoManager's RollbackTransaction method.
StartTransaction(string) : bool
Call the UndoManager's StartTransaction method.
- tname
- a String describing the transaction
Возвращает: the value of the call to StartTransaction
События
Changed : EventHandler<ModelChangedEventArgs>
The Changed event is raised whenever the model is modified.