PartManager

StockSharp.Xaml.Diagram.GXDiagram

This class handles the Changed event for the Diagram's Model and is responsible for creating and removing Nodes and Links for the data in the model.

Inherits: FrameworkElement

Constructors

PartManager()

The constructor for the standard part manager that is the initial value of PartManager.

Properties

AddsToLogicalTree : bool

Gets or sets whether Parts are added and removed from the logical tree. [WPF only]

ChecksTransactionLevel : bool

Gets or sets whether this part manager will output warnings to Trace listeners when model changes occur outside of a transaction.

Diagram : Diagram

Gets the Diagram for which this PartManager manages the lifetime of Parts depending on the contents of the Model.

LinksCount : int

Gets the current number of Links in the diagram, including links that are not bound to data.

Nodes : IEnumerable<Node>

Gets an IEnumerable<Node> holding all of the Nodes that are in the diagram, including Groups, including nodes that are not bound to data, but excluding Adornments.

NodesCount : int

Gets the current number of Nodes in the diagram, including nodes that are not bound to data and including Groups, but excluding Adornments.

UpdatesRouteDataPoints : bool

Gets or sets whether this PartManager should call Link) for each Link that has a new list of Points.

Methods

AddLinkForData(object, IDiagramModel) : Link

Make sure a Link exists for some data in the model, added to the LinkLayer specified by its LayerName.

linkdata
the data in the that holds link relationship information
model
the model that the is in, an ILinksModel

Returns: the Link for the , either an existing one or a newly created one, or null if IDiagramModel) returns false or if the diagram is uninitialized

AddLinkForData(object, object, IDiagramModel) : Link

Make sure a Link exists for the link relationship between the given pair of node data, added to the LinkLayer specified by its LayerName.

fromnodedata
the data from which the link relationship comes
tonodedata
the data to which the link relationship goes
model
the model that the node data are in, not an ILinksModel

Returns: the Link for the connecting the two node data, either an existing one or a newly created one, or null if IDiagramModel) returns false or if the diagram is uninitialized

AddNodeForData(object, IDiagramModel) : Node

Make sure a Node exists for some data in the model, added to the NodeLayer specified by its LayerName.

nodedata
the data in the that holds node information
model
the model that the is in

Returns: the Node for the , either an existing one or a newly created one, or null if IDiagramModel) returns false or if the diagram is uninitialized

CopyParts(IEnumerable<Part>, IDiagramModel) : ICopyDictionary

Copy a collection of Parts from this model to a given model.

coll
a collection of Parts that are in this model
destmodel
if null, this creates a model like this one by calling IDataCollection); the new model is available from the returned ICopyDictionary as its DestinationModel property

Returns: an ICopyDictionary that maps original parts to the copied ones

DeleteParts(IEnumerable<Part>)

Remove a collection of Parts from this model.

coll
a collection of Parts that are in this model
DoRebuildLinkElements()

This is called by RebuildLinkElements to construct or reconstruct Links in the diagram.

DoRebuildNodeElements()

Make new Nodes for all of model data and add them to the Diagram.

FilterLinkForData(object, object, IDiagramModel) : bool

Decide whether the link relationship between a particular pair of node data should be represented in the diagram by a Link.

fromnodedata
the data from which the link relationship comes
tonodedata
the data to which the link relationship goes
model
the model that the node data are in, not an ILinksModel

Returns: true only if IDiagramModel) should make and add a Link to the diagram

FilterLinkForData(object, IDiagramModel) : bool

Decide whether a particular should be represented in the diagram by a Link.

linkdata
the data in the that holds link relationship information
model
the model that the is in, an ILinksModel

Returns: true only if IDiagramModel) should make and add a Link to the diagram

FilterNodeForData(object, IDiagramModel) : bool

Decide whether a particular should be represented in the diagram by a Node.

nodedata
the data in the that holds node information
model
the model that the is in

Returns: true only if IDiagramModel) should make and add a Node to the diagram

FindCategoryForNode(object, IDiagramModel, bool, bool) : string

Determine the category for the node, to be able to decide between different templates for the Node.

nodedata
model
isgroup
islinklabel

Returns: the result of calling Object)

FindCommonDataModel(object, object) : IDiagramModel

Find the model for the two data objects representing nodes.

fromnodedata
tonodedata

Returns: normally the Model, but may return the PartsModel if the both and are Nodes, otherwise null.

FindLinkForData(object, object, IDiagramModel) : Link

Given a pair of node data for which there is a link relationship, find the corresponding Link in this diagram.

fromnodedata
the data from which the link relationship comes
tonodedata
the data to which the link relationship goes
model
the model that the node data are in, not an ILinksModel

Returns: a Link, or null if such a link has not been created for that pair of node data

FindLinkForData(object, IDiagramModel) : Link

Given some in a , find the corresponding Link in this diagram.

linkdata
the data in the that holds link relationship information
model
the model that the is in, an ILinksModel

Returns: a Link, or null if such a link has not been created for that data

FindLinksForData(IDataCollection) : IEnumerable<Link>

Return a collection of Links in this diagram corresponding to some model data.

datacoll
an IDataCollection

Returns: If this model is an ILinksModel, this just calls IDiagramModel) and collects the Links that are found. Otherwise it looks for Links that are connected to the nodes in the data collection.

FindNodeDataModel(object) : IDiagramModel

Find the model for some data.

nodedata

Returns: normally the Model, but may return the PartsModel if the is a Part.

FindNodeForData(object, IDiagramModel) : Node

Given some in a , find the corresponding Node in this diagram.

nodedata
the data in the that holds node information
model
the model that the is in

Returns: a Node, or null if such a node has not been created for that data

FindNodesForData(IDataCollection) : IEnumerable<Node>

Return a collection of Nodes in this diagram corresponding to some model data.

datacoll
an IDataCollection
FindPartsForData(IDataCollection) : IEnumerable<Part>

Return a collection of Parts in this diagram corresponding to some model data.

datacoll

Returns: a sequence of both Nodes and Links

FindTemplateForNode(object, IDiagramModel, bool, bool, string) : DataTemplate

Given a category and the node data, find a DataTemplate to use in making the Node or Group.

nodedata
model
isgroup
islinklabel
category

Returns: a DataTemplate taken from either NodeTemplate or NodeTemplateDictionary (or if is true, from either GroupTemplate or GroupTemplateDictionary), or null if no template is found

MakeLinkForData(object, IDiagramModel, DataTemplate, string) : Link

Construct a new Link, setting its Content and ContentTemplate properties.

linkdata
the data that this link is bound to; must not be a Link or any UIElement
model
the model that the is in
templ
the DataTemplate for the ContentTemplate property
category
the category for the link

Returns: a newly created Link

MakeNodeForData(object, IDiagramModel, bool, bool, string, DataTemplate) : Node

Construct a new Node, setting its Content and ContentTemplate properties.

nodedata
the data that this node is bound to; must not be a Node or any UIElement
model
the model that the is in
isgroup
whether the node should be a Group instead of a Node
islinklabel
whether the node acts as the label node for a link
category
the category of the node
templ
the DataTemplate for the ContentTemplate property

Returns: a newly created Node or Group, bound to via a PartBinding

OnMemberAdded(Node, Part)

Called after a part is added to a group node's members.

group
a Group
part
a Part that has been added to the
OnMemberRemoved(Node, Part)

Called after a part is removed from a group node's members.

group
a Group
part
a Part that has been removed from the
OnModelChanged(ModelChangedEventArgs)

This is called for each Changed event of the Model.

e
the Change property gives a basic description of the change to the model
OnNodeAdded(Node)

Called after a is added to the diagram.

node
a Node
OnNodeRemoved(Node, NodeLayer)

Called after a is removed from the diagram.

node
a Node
layer
the NodeLayer that the was removed from
OnNodeRemoving(Node)

Called before a is removed from the diagram.

node
a Node
RealizeSubGraphMembers(Group)

This is called by ExpandSubGraph to make sure the group's member Nodes and Links all exist in the diagram.

sg
a Group
RealizeTreeChildren(Node)

This is called by ExpandTree to make sure all of the node's connected Nodes exist in the diagram.

parent
RebuildLinkElements()

Discard all existing Links and then make new ones for all of model data and add them to the Diagram.

RebuildNodeElements()

Discard all existing Nodes and Links and then make new ones for all of model data and add them to the Diagram.

ReleaseSubGraphMembers(Group)

This is called by CollapseSubGraph to allow the member Nodes and Links to be removed from the diagram.

sg
a Group
ReleaseTreeChildren(Node)

This is called by CollapseTree to allow all of the child nodes and links for a particular Node to be removed from the diagram.

parent
RemoveLinkForData(object, object, IDiagramModel)

Remove any Link that exists for a pair of given node data.

fromnodedata
the data from which the link relationship comes
tonodedata
the data to which the link relationship goes
model
the model that the node data are in, not an ILinksModel
RemoveLinkForData(object, IDiagramModel)

Remove any Link that exists in the diagram for the .

linkdata
the data in the that holds link relationship information
model
the model that the is in, an ILinksModel
RemoveNodeForData(object, IDiagramModel)

Remove any Node in this diagram that exists for the .

nodedata
model
SelectData(IDataCollection)

Select the Parts in this diagram corresponding to a collection of model data.

datacoll
an IDataCollection