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
public PartManager()
partManager = PartManager()

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

Properties

AddsToLogicalTree
public bool AddsToLogicalTree { get; set; }
value = partManager.AddsToLogicalTree
partManager.AddsToLogicalTree = value

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

ChecksTransactionLevel
public bool ChecksTransactionLevel { get; set; }
value = partManager.ChecksTransactionLevel
partManager.ChecksTransactionLevel = value

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

Diagram
public Diagram Diagram { get; internal set; }
value = partManager.Diagram
partManager.Diagram = value

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

LinksCount
public int LinksCount { get; }
value = partManager.LinksCount

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

Nodes
public IEnumerable<Node> Nodes { get; }
value = partManager.Nodes

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
public int NodesCount { get; }
value = partManager.NodesCount

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

UpdatesRouteDataPoints
public bool UpdatesRouteDataPoints { get; set; }
value = partManager.UpdatesRouteDataPoints
partManager.UpdatesRouteDataPoints = value

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

Methods

AddLinkForData
public Link AddLinkForData(object linkdata, IDiagramModel model)
result = partManager.AddLinkForData(linkdata, model)

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
public Link AddLinkForData(object fromnodedata, object tonodedata, IDiagramModel model)
result = partManager.AddLinkForData(fromnodedata, tonodedata, model)

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
public Node AddNodeForData(object nodedata, IDiagramModel model)
result = partManager.AddNodeForData(nodedata, model)

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
public virtual ICopyDictionary CopyParts(IEnumerable<Part> coll, IDiagramModel destmodel)
result = partManager.CopyParts(coll, destmodel)

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
public virtual void DeleteParts(IEnumerable<Part> coll)
partManager.DeleteParts(coll)

Remove a collection of Parts from this model.

coll
a collection of Parts that are in this model
DoRebuildLinkElements
protected virtual void DoRebuildLinkElements()
partManager.DoRebuildLinkElements()

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

DoRebuildNodeElements
protected virtual void DoRebuildNodeElements()
partManager.DoRebuildNodeElements()

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

FilterLinkForData
protected virtual bool FilterLinkForData(object fromnodedata, object tonodedata, IDiagramModel model)
result = partManager.FilterLinkForData(fromnodedata, tonodedata, model)

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
protected virtual bool FilterLinkForData(object linkdata, IDiagramModel model)
result = partManager.FilterLinkForData(linkdata, model)

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
protected virtual bool FilterNodeForData(object nodedata, IDiagramModel model)
result = partManager.FilterNodeForData(nodedata, model)

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
protected virtual string FindCategoryForNode(object nodedata, IDiagramModel model, bool isgroup, bool islinklabel)
result = partManager.FindCategoryForNode(nodedata, model, isgroup, islinklabel)

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
public virtual IDiagramModel FindCommonDataModel(object fromnodedata, object tonodedata)
result = partManager.FindCommonDataModel(fromnodedata, tonodedata)

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
public Link FindLinkForData(object fromnodedata, object tonodedata, IDiagramModel model)
result = partManager.FindLinkForData(fromnodedata, tonodedata, model)

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
public Link FindLinkForData(object linkdata, IDiagramModel model)
result = partManager.FindLinkForData(linkdata, model)

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
public virtual IEnumerable<Link> FindLinksForData(IDataCollection datacoll)
result = partManager.FindLinksForData(datacoll)

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
public virtual IDiagramModel FindNodeDataModel(object nodedata)
result = partManager.FindNodeDataModel(nodedata)

Find the model for some data.

nodedata

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

FindNodeForData
public Node FindNodeForData(object nodedata, IDiagramModel model)
result = partManager.FindNodeForData(nodedata, model)

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
public virtual IEnumerable<Node> FindNodesForData(IDataCollection datacoll)
result = partManager.FindNodesForData(datacoll)

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

datacoll
an IDataCollection
FindPartsForData
public virtual IEnumerable<Part> FindPartsForData(IDataCollection datacoll)
result = partManager.FindPartsForData(datacoll)

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

datacoll

Returns: a sequence of both Nodes and Links

FindTemplateForNode
protected virtual DataTemplate FindTemplateForNode(object nodedata, IDiagramModel model, bool isgroup, bool islinklabel, string category)
result = partManager.FindTemplateForNode(nodedata, model, isgroup, islinklabel, category)

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
protected virtual Link MakeLinkForData(object linkdata, IDiagramModel model, DataTemplate templ, string category)
result = partManager.MakeLinkForData(linkdata, model, templ, category)

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
protected virtual Node MakeNodeForData(object nodedata, IDiagramModel model, bool isgroup, bool islinklabel, string category, DataTemplate templ)
result = partManager.MakeNodeForData(nodedata, model, isgroup, islinklabel, category, templ)

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
protected virtual void OnMemberAdded(Node group, Part part)
partManager.OnMemberAdded(group, 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
protected virtual void OnMemberRemoved(Node group, Part part)
partManager.OnMemberRemoved(group, 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
public virtual void OnModelChanged(ModelChangedEventArgs e)
partManager.OnModelChanged(e)

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
protected virtual void OnNodeAdded(Node node)
partManager.OnNodeAdded(node)

Called after a is added to the diagram.

node
a Node
OnNodeRemoved
protected virtual void OnNodeRemoved(Node node, NodeLayer layer)
partManager.OnNodeRemoved(node, layer)

Called after a is removed from the diagram.

node
a Node
layer
the NodeLayer that the was removed from
OnNodeRemoving
protected virtual void OnNodeRemoving(Node node)
partManager.OnNodeRemoving(node)

Called before a is removed from the diagram.

node
a Node
RealizeSubGraphMembers
public virtual void RealizeSubGraphMembers(Group sg)
partManager.RealizeSubGraphMembers(sg)

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

sg
a Group
RealizeTreeChildren
public virtual void RealizeTreeChildren(Node parent)
partManager.RealizeTreeChildren(parent)

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

parent
RebuildLinkElements
public void RebuildLinkElements()
partManager.RebuildLinkElements()

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

RebuildNodeElements
public void RebuildNodeElements()
partManager.RebuildNodeElements()

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

ReleaseSubGraphMembers
public virtual void ReleaseSubGraphMembers(Group sg)
partManager.ReleaseSubGraphMembers(sg)

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

sg
a Group
ReleaseTreeChildren
public virtual void ReleaseTreeChildren(Node parent)
partManager.ReleaseTreeChildren(parent)

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
public void RemoveLinkForData(object fromnodedata, object tonodedata, IDiagramModel model)
partManager.RemoveLinkForData(fromnodedata, tonodedata, model)

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
public void RemoveLinkForData(object linkdata, IDiagramModel model)
partManager.RemoveLinkForData(linkdata, model)

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
public void RemoveNodeForData(object nodedata, IDiagramModel model)
partManager.RemoveNodeForData(nodedata, model)

Remove any Node in this diagram that exists for the .

nodedata
model
SelectData
public virtual void SelectData(IDataCollection datacoll)
partManager.SelectData(datacoll)

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

datacoll
an IDataCollection