Class Model
A model is a collection of nodes that are rendered onto a view and manipulated by a controller.
Inheritance
Implements
Namespace: Syncfusion.Windows.Forms.Diagram
Assembly: Syncfusion.Diagram.Base.dll
Syntax
public class Model : Component, INode, IServiceProvider, ICloneable, ICompositeNode, IZOrderContainer, ISerializable, IDeserializationCallback, ISupportInitialize, IServiceReferenceProvider, IPropertyObserver, IPropertyContainer, ILayerContainer
Remarks
A model is the data portion of a diagram. It is the root node in a hierarchy that is rendered onto a view. This class implements the ICompositeNode interface, provides methods for accessing, adding, and removing child nodes. This includes the following methods: ChildCount, GetChild(Int32), AppendChild(Node), InsertChild(Node, Int32), RemoveChild(Int32). Child nodes in the model can also be accessed through the Nodes property.
A model maintains a collection of layers in the Layers property. A Layer is a collection of nodes that share a common set of default properties and the same Z-order relative to other layers. A model always contains at least one layer. Each node in the model belongs to one and only one layer. The model renders itself onto the view by iterating through the layers and rendering each one. Each layer is responsible for rendering the nodes belonging to it. The PropertyContainer of the Layers collection is a reference back to the model, which allows the layers to inherit properties from the model.
A model contains document-level settings such as: MeasurementUnits
ICompositeNode IPropertyContainer IPrint IDispatchNodeEvents ViewConstructors
Model()
Initializes a new instance of the Model class.
Declaration
public Model()
Model(Model)
Initializes a new instance of the Model class.
Declaration
public Model(Model src)
Parameters
| Type | Name | Description |
|---|---|---|
| Model | src | Source model to copy. |
Model(IContainer)
Initializes a new instance of the Model class.
Declaration
public Model(IContainer container)
Parameters
| Type | Name | Description |
|---|---|---|
| System.ComponentModel.IContainer | container | The container. |
Model(SerializationInfo, StreamingContext)
Initializes a new instance of the Model class.
Declaration
protected Model(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | Serialization state information. |
| System.Runtime.Serialization.StreamingContext | context | Streaming context information. |
Fields
m_bInUpdate
Temporarily freezes redrawing of the model.
Declaration
protected bool m_bInUpdate
Field Value
| Type |
|---|
| System.Boolean |
Properties
ActiveLayers
Gets collection of active layers.
Declaration
public LayerCollection ActiveLayers { get; }
Property Value
| Type |
|---|
| LayerCollection |
AlignmentType
Declaration
public AlignmentType AlignmentType { get; set; }
Property Value
| Type |
|---|
| AlignmentType |
BackgroundImage
Gets or sets the background image for this model.
Declaration
public Image BackgroundImage { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Image |
BackgroundImageLayout
Gets or sets the Background Image Layout for this model.
Declaration
public ImageLayout BackgroundImageLayout { get; set; }
Property Value
| Type |
|---|
| ImageLayout |
BackgroundStyle
Gets or sets properties used to fill the interior of document.
Declaration
public FillStyle BackgroundStyle { get; set; }
Property Value
| Type |
|---|
| FillStyle |
Remarks
The fill style is used to create brushes for painting interior of document.
The fill style properties in the model are inherited by child nodes. If a child node does not have a value assigned to a given fill style property, then the value assigned to the model is used.
FillStyle IPropertyContainer LineStyleBottomMargin
Gets and Sets the Bottom Margin for the Model.
Declaration
public float BottomMargin { get; set; }
Property Value
| Type |
|---|
| System.Single |
BoundaryConstraintsEnabled
Gets or sets a value indicating whether boundary constraints are enabled or not.
Declaration
public bool BoundaryConstraintsEnabled { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
This property is True by default. If this property is True, then all nodes in the model are constrained to the bounds of the model. In other words, child nodes cannot move, resize, or rotate to a position that leaves the bounds of the model.
Bounds
Gets the model bounds.
Declaration
public RectangleF Bounds { get; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.RectangleF | The bounds. |
Remarks
Location always equal PointF.Empty.
BridgeManager
Gets the reference to bridge manager.
Declaration
public BridgeManager BridgeManager { get; }
Property Value
| Type | Description |
|---|---|
| BridgeManager | The bridge manager. |
BridgeStyle
Gets or sets bridge style.
Declaration
public BridgeStyle BridgeStyle { get; set; }
Property Value
| Type |
|---|
| BridgeStyle |
CanUngroup
Gets or sets a value indicating whether composite node can be ungrouped.
Declaration
public bool CanUngroup { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ChildCount
Gets the number of child nodes contained by this model.
Declaration
public int ChildCount { get; }
Property Value
| Type |
|---|
| System.Int32 |
Children
Gets the children to model children collection.
Declaration
protected NodeCollection Children { get; }
Property Value
| Type | Description |
|---|---|
| NodeCollection | The children. |
CustomUnitValue
Declaration
public float CustomUnitValue { get; set; }
Property Value
| Type |
|---|
| System.Single |
DefaultDocumentSize
Gets the default document size.
Declaration
protected SizeF DefaultDocumentSize { get; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.SizeF | The size of the default document. |
DefaultMinimumSize
Gets the default minimum size.
Declaration
protected SizeF DefaultMinimumSize { get; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.SizeF | The minimum size of the default. |
DocumentScale
Gets or sets the document scale.
Declaration
public PageScale DocumentScale { get; set; }
Property Value
| Type | Description |
|---|---|
| PageScale | The document scale. |
DocumentSize
Gets or sets the size of the document.
Declaration
public PageSize DocumentSize { get; set; }
Property Value
| Type | Description |
|---|---|
| PageSize | The size of the document. |
EnableSelectionListSubstitute
Gets or sets a value indicating whether line routing is enabled for the model.
Declaration
public bool EnableSelectionListSubstitute { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
EventSink
Gets the reference to event sink .
Declaration
public DocumentEventSink EventSink { get; }
Property Value
| Type | Description |
|---|---|
| DocumentEventSink | The event sink. |
FullContainerName
Gets the full name of the container.
Declaration
public string FullContainerName { get; }
Property Value
| Type | Description |
|---|---|
| System.String | The full name of the container. |
FullName
Gets or sets fully qualified name of the node.
Declaration
public string FullName { get; set; }
Property Value
| Type |
|---|
| System.String |
Remarks
The full name is the name of the node concatenated with the names of all parent nodes.
HeaderFooterData
Gets the HeaderFooterData instance containing the header and footer settings.
Declaration
public HeaderFooterData HeaderFooterData { get; }
Property Value
| Type |
|---|
| HeaderFooterData |
HistoryManager
Gets the reference to history manager.
Declaration
public HistoryManager HistoryManager { get; set; }
Property Value
| Type | Description |
|---|---|
| HistoryManager | The history manager. |
InUpdate
Gets a value indicating whether the model redrawing is enabled. BeginUpdate() EndUpdate()
Declaration
public bool InUpdate { get; }
Property Value
| Type |
|---|
| System.Boolean |
Layers
Gets collection of layers in the model.
Declaration
public LayerCollection Layers { get; }
Property Value
| Type | Description |
|---|---|
| LayerCollection | The layer collection. |
Remarks
LineBridgeSize
Gets or sets the size of bridges added to the line to jump over other lines.
Declaration
public float LineBridgeSize { get; set; }
Property Value
| Type |
|---|
| System.Single |
LineBridgingEnabled
Gets or sets a value indicating whether line bridging is enabled for the model.
Declaration
public bool LineBridgingEnabled { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
LineRouter
Gets or sets the line router manager.
Declaration
public LineRouter LineRouter { get; set; }
Property Value
| Type | Description |
|---|---|
| LineRouter | The line router. |
LineRoutingEnabled
Gets or sets a value indicating whether line routing is enabled for the model.
Declaration
public bool LineRoutingEnabled { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
LineStyle
Gets properties used for document border.
Declaration
public LineStyle LineStyle { get; }
Property Value
| Type |
|---|
| LineStyle |
Remarks
The line style is used to create pen for document border.
The line style properties in the model are inherited by child nodes. If a child node does not have a value assigned to a given line style property, then the value assigned to the model is used.
LineStyle IPropertyContainerLinkManager
Gets the reference to link manager.
Declaration
public LinkManager LinkManager { get; }
Property Value
| Type | Description |
|---|---|
| LinkManager | The link manager. |
LogicalSize
Gets or sets the logical model size in current measurement units.
Declaration
public SizeF LogicalSize { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Drawing.SizeF | The logical size in current measurement units. |
MeasurementUnits
Gets or sets unit of measure used for world coordinates.
Declaration
public MeasureUnits MeasurementUnits { get; set; }
Property Value
| Type |
|---|
| MeasureUnits |
MinimumSize
Gets or sets minimum model auto size for content.
Declaration
public SizeF MinimumSize { get; set; }
Property Value
| Type |
|---|
| System.Drawing.SizeF |
Modified
Gets or sets a value indicating whether this Model is modified.
Declaration
public bool Modified { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
Name
Gets or sets name of the node.
Declaration
public string Name { get; set; }
Property Value
| Type |
|---|
| System.String |
Remarks
Must be unique within the scope of the parent node.
NameTable
Gets names hash where key - node name, value - available node index. Using for generate unique name with indexing.
Declaration
protected Hashtable NameTable { get; }
Property Value
| Type |
|---|
| System.Collections.Hashtable |
Nodes
Gets the model node collection property to add/remove/clear the children count in the diagram�s Model.
Declaration
public NodeCollection Nodes { get; }
Property Value
| Type | Description |
|---|---|
| NodeCollection | The nodes. |
OptimizeLineBridging
Gets or sets a value indicating whether the performance will be improved while dragging nodes.
Declaration
public bool OptimizeLineBridging { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Padding
Get/Set the Diagram Padding
Declaration
public Padding Padding { get; set; }
Property Value
| Type |
|---|
| System.Windows.Forms.Padding |
Parent
Gets or sets reference to the composite node this node is a child of.
Declaration
public ICompositeNode Parent { get; set; }
Property Value
| Type |
|---|
| ICompositeNode |
RenderingStyle
Gets the diagram rendering style.
Declaration
public RenderingStyle RenderingStyle { get; }
Property Value
| Type | Description |
|---|---|
| RenderingStyle | The rendering style. |
Remarks
The rendering style is used to configure graphics.
RightMargin
Gets and Sets the Right Margin for the Model.
Declaration
public float RightMargin { get; set; }
Property Value
| Type |
|---|
| System.Single |
Root
Gets the root node in the node hierarchy.
Declaration
public INode Root { get; }
Property Value
| Type |
|---|
| INode |
Remarks
The root node is found by following the chain of parent nodes until a node is found that has a NULL parent.
ShadowStyle
Gets or sets properties used to draw document shadow.
Declaration
public ShadowStyle ShadowStyle { get; set; }
Property Value
| Type |
|---|
| ShadowStyle |
Remarks
Size
Gets or sets the Document size.
Declaration
[Obsolete("This property will be no more supported since next version. Use DocumentSize instead.")]
public SizeF Size { get; set; }
Property Value
| Type |
|---|
| System.Drawing.SizeF |
Remarks
Specified in current measure units.
SizeToContent
Gets or sets a value indicating whether autoresizing model size when nodes go out of bounds on model.
Declaration
public bool SizeToContent { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ZOrderDepth
Gets number of items in the Z-order for this container.
Declaration
public int ZOrderDepth { get; }
Property Value
| Type |
|---|
| System.Int32 |
Methods
AddToActiveLayers(NodeCollection)
Adds given node collection to active layers.
Declaration
protected void AddToActiveLayers(NodeCollection nodesToAdd)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeCollection | nodesToAdd | The nodes to add. |
AppendChild(Node)
Appends the given node to the model.
Declaration
public int AppendChild(Node child)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | child | Node to append. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Zero-based index at which the node was added to the collection or -1 for failure. |
AppendChildren(NodeCollection, out Int32)
Appends the given collection of nodes as child nodes.
Declaration
public int AppendChildren(NodeCollection children, out int startIdx)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeCollection | children | Nodes to append. |
| System.Int32 | startIdx | Zero-based index at which the first node was added to the collection of child nodes. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Number of child nodes appended. |
BeginInit()
Signals the object that initialization is starting.
Declaration
public void BeginInit()
BeginUpdate()
Disables any redrawing of the Model. EndUpdate() InUpdate
Declaration
public void BeginUpdate()
BringForward(Node)
Visually brings the selected shapes one step forward over the nearest overlapping shape based on z-order value.
Declaration
public int BringForward(Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to move forward. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Previous Z-order position. |
BringToFront(Node)
Visually brings the selected shapes front over all the other overlapped shapes based on z-order value.
Declaration
public int BringToFront(Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to bring to the front. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Previous Z-order position. |
CheckBoundaryConstrains(Node)
Tests to see if the given node falls within the constraining region of the composite node.
Declaration
public bool CheckBoundaryConstrains(Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to test. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if node falls within the constraining region; False if it does not. |
CheckConstrainingRegion(Node)
Tests to see if the given node falls within the constraining region of the composite node.
Declaration
public virtual bool CheckConstrainingRegion(Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to test. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if node falls within the constraining region; False if it does not. |
CheckUseBitmap(ICompositeNode, Hashtable)
Checks the to cache group bitmap.
Declaration
public void CheckUseBitmap(ICompositeNode group, Hashtable hash)
Parameters
| Type | Name | Description |
|---|---|---|
| ICompositeNode | group | The group. |
| System.Collections.Hashtable | hash | The hash. |
Children_ChangeComplete(CollectionExEventArgs)
Called when children collection change complete.
Declaration
[EventHandlerPriority(true)]
protected void Children_ChangeComplete(CollectionExEventArgs evtArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectionExEventArgs | evtArgs | The CollectionExEventArgs instance containing the event data. |
Children_PropertyChanged(PropertyChangedEventArgs)
Called when children property is changed.
Declaration
[EventHandlerPriority(true)]
protected void Children_PropertyChanged(PropertyChangedEventArgs evtArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyChangedEventArgs | evtArgs | The PropertyChangedEventArgs instance containing the event data. |
Children_PropertyChanging(PropertyChangingEventArgs)
Called when children property is changing.
Declaration
[EventHandlerPriority(true)]
protected void Children_PropertyChanging(PropertyChangingEventArgs evtArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyChangingEventArgs | evtArgs | The PropertyChangingEventArgs instance containing the event data. |
Clear()
Removes all nodes from the model and resets its state values.
Declaration
public void Clear()
Clone()
Creates a new object that is a copy of the current instance.
Declaration
public virtual object Clone()
Returns
| Type | Description |
|---|---|
| System.Object | Copy of the object this method is invoked against. |
CompareZOrder(INode, INode)
Compares the Z-order of the two given nodes.
Declaration
public int CompareZOrder(INode node1, INode node2)
Parameters
| Type | Name | Description |
|---|---|---|
| INode | node1 | First node to compare |
| INode | node2 | Second node to compare |
Returns
| Type | Description |
|---|---|
| System.Int32 | -1 if the node1 is lower in the Z-order than node2 1 if the node1 is higher in the Z-order than node2 0 if the node1 and node2 are equal in Z-order |
Remarks
The nodes must belong to the same layer in order to compare their Z-order. An ArgumentException is thrown if the nodes do not belong to the same layer.
ContainsPoint(PointF)
Tests to see if the given point lies within the bounds of the model.
Declaration
public bool ContainsPoint(PointF ptTesting)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.PointF | ptTesting | Point to test. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the model contains the point; otherwise false |
ContainsPoints(PointF[])
Tests to see if the model contains all of the points in the given array.
Declaration
public bool ContainsPoints(PointF[] pts)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.PointF[] | pts | Array of points to test. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if all of the points fall within the bounds of the model; otherwise false |
ConvertLogicalUnits(MeasureUnits, MeasureUnits)
Converts the logical values contained by the object from one unit of measure to another.
Declaration
protected void ConvertLogicalUnits(MeasureUnits fromUnits, MeasureUnits toUnits)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasureUnits | fromUnits | Units to convert from. |
| MeasureUnits | toUnits | Units to convert to. |
Remarks
This method converts all logical unit values contained by the object from one unit of measure to another.
CreateHeaderFooter()
Creates a HeaderFooterData instance for the model.
Declaration
protected virtual HeaderFooterData CreateHeaderFooter()
Returns
| Type | Description |
|---|---|
| HeaderFooterData | The HeaderFooterData object. |
Dispose(Boolean)
Called to release resources held by the model.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing | Indicates if this method is being called explicitly by a call to Dispose() or by the destructor through the garbage collector. |
Draw(Graphics)
Renders the model onto the given System.Drawing.Graphics object.
Declaration
public virtual void Draw(Graphics grfx)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | grfx | Graphics context object to render onto. |
Remarks
The model initializes the given System.Drawing.Graphics object with the its: MeasurementUnits, and Then it iterates through each layer in its Layers collections and draws each one.
Draw(Graphics, RectangleF)
Renders the specified area of the model to a graphics context.
Declaration
public virtual void Draw(Graphics grfx, RectangleF rcArea)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | grfx | Graphics context to render onto. |
| System.Drawing.RectangleF | rcArea | Area to render. |
Remarks
Only objects that intersect the specified rectangular area are rendered.
EndInit()
Signals the object that initialization is complete.
Declaration
public void EndInit()
EndUpdate()
Enables the redrawing of the Model. BeginUpdate() InUpdate
Declaration
public void EndUpdate()
GenerateUniqueNodeName(Node, out String, Regex)
Called to generate a unique name when inserting a new node.
Declaration
protected virtual bool GenerateUniqueNodeName(Node obj, out string nodeName, Regex regex)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | obj | Node to generate unique name for. |
| System.String | nodeName | Node name generated. |
| System.Text.RegularExpressions.Regex | regex | Regex used to split node name. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if a new name was generated; False if the name is already unique. |
Remarks
The implementation of this method first checks to see if the name is already unique. If it is, then it returns False to the caller and the nodeName parameter contains the original name. If the node's name is not unique within the model, then this method adds a numeric suffix to the name and continues to increment it in a loop until the name is unique. If the nodeName output parameter contains a value other than the original node name, then this method returns True.
This method can be overriden in derived classes in order to customize or replace the algorithm for generating unique names.
GetBoundingRect()
Gets Model bounding rectangle.
Declaration
public RectangleF GetBoundingRect()
Returns
| Type | Description |
|---|---|
| System.Drawing.RectangleF | bounding Rectangle |
GetChild(Int32)
Returns the child node at the given index position.
Declaration
public Node GetChild(int childIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | childIndex | Zero-based index into the collection of child nodes. |
Returns
| Type | Description |
|---|---|
| Node | Child node at the given position or NULL if the index is out of range. |
GetChildByFullName(ICompositeNode, String)
Returns the child node matching the given full name.
Declaration
public Node GetChildByFullName(ICompositeNode composite, string childFullName)
Parameters
| Type | Name | Description |
|---|---|---|
| ICompositeNode | composite | The composite node. |
| System.String | childFullName | Full name of the child. |
Returns
| Type | Description |
|---|---|
| Node | Node matching the given full name. |
GetChildByName(String)
Returns the child node matching the given name.
Declaration
public Node GetChildByName(string childName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | childName | Name of node to return. |
Returns
| Type | Description |
|---|---|
| Node | Node matching the given name. |
GetChildIndex(Node)
Returns the index position of the given child node.
Declaration
public int GetChildIndex(Node child)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | child | Child node to query. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Zero-based index into the collection of child nodes. |
GetChildrenAtPoint(NodeCollection, PointF)
Returns all children that are intersected by the given point.
Declaration
public virtual int GetChildrenAtPoint(NodeCollection childNodes, PointF ptModel)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeCollection | childNodes | Collection in which to add the children hit by the given point. |
| System.Drawing.PointF | ptModel | Point to test. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The number of child nodes that intersect the given point. |
GetChildrenContainedBy(NodeCollection, RectangleF)
Returns all children inside the given rectangle.
Declaration
public virtual int GetChildrenContainedBy(NodeCollection childNodes, RectangleF rcModel)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeCollection | childNodes | Collection in which to add the children inside the specified rectangle. |
| System.Drawing.RectangleF | rcModel | Rectangle to test. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The number of child nodes added to the collection. |
GetChildrenIntersecting(NodeCollection, RectangleF)
Returns all children that intersect the given rectangle.
Declaration
public virtual int GetChildrenIntersecting(NodeCollection childNodes, RectangleF rcModel)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeCollection | childNodes | Collection in which to add the children hit by the given point. |
| System.Drawing.RectangleF | rcModel | Rectangle to test. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The number of child nodes that intersect the given rectangle. |
GetObjectData(SerializationInfo, StreamingContext)
Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
Declaration
protected virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | The System.Runtime.Serialization.SerializationInfo to populate with data. |
| System.Runtime.Serialization.StreamingContext | context | The destination (see System.Runtime.Serialization.StreamingContext) for this serialization. |
Exceptions
| Type | Condition |
|---|---|
| System.Security.SecurityException | The caller does not have the required permission. |
GetPropertyContainer(String)
Gets the property container.
Declaration
protected virtual object GetPropertyContainer(string strPropertyContainerName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | strPropertyContainerName | Name of the property container. |
Returns
| Type | Description |
|---|---|
| System.Object | The object. |
GetPropertyContainerByName(String)
Gets the name of the property container by.
Declaration
public object GetPropertyContainerByName(string strPropertyContainerName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | strPropertyContainerName | Name of the property container. |
Returns
| Type | Description |
|---|---|
| System.Object | The container object |
GetService(Type)
Returns the specified type of service object the caller.
Declaration
protected override object GetService(Type svcType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | svcType | Type of service requested. |
Returns
| Type | Description |
|---|---|
| System.Object | The object matching the service type requested or NULL if the service is not supported. |
Remarks
This method is similar to COM's IUnknown::QueryInterface method, although more generic. Instead of just returning interfaces, this method can return any type of object.
The following services are supported: IDispatchNodeEvents, IPropertyContainer, LineStyle, FillStyle, BackgroundStyle
GetZOrder(Node)
Returns the Z-order value of the given node.
Declaration
public int GetZOrder(Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to get Z-order for. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Zero-based Z-order value of the node or -1 if the node does not exist. |
InsertChild(Node, Int32)
Insert the given node into the model at a specific position.
Declaration
public void InsertChild(Node child, int childIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | child | Node to insert. |
| System.Int32 | childIndex | Zero-based index at which to insert the node. |
Merge(Model, Boolean)
Copy document properties to current model container.
Declaration
public void Merge(Model document, bool bCollectionOnly)
Parameters
| Type | Name | Description |
|---|---|---|
| Model | document | The source document. |
| System.Boolean | bCollectionOnly | merge the collection only, if set to |
OnDeserialization(Object)
Called when deserialization is complete.
Declaration
protected virtual void OnDeserialization(object sender)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | Object performing the deserialization. |
OnPropertyChanged(String)
Called when property changed.
Declaration
protected virtual void OnPropertyChanged(string strPropertyName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | strPropertyName | Name of the property. |
OnPropertyChanged(String, String)
Called when model property changed.
Declaration
public void OnPropertyChanged(string strPropertyFullPath, string strPropertyName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | strPropertyFullPath | The property full path. |
| System.String | strPropertyName | Name of the property. |
OnPropertyChanging(String, Object)
Called when property changing.
Declaration
protected virtual bool OnPropertyChanging(string strPropertyName, object newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | strPropertyName | Name of the property. |
| System.Object | newValue | The new value. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if property is changing. |
OnPropertyChanging(String, String, Object)
Called when model property changing.
Declaration
public bool OnPropertyChanging(string strPropertyFullPath, string strPropertyName, object oldValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | strPropertyFullPath | The property full path. |
| System.String | strPropertyName | Name of the property. |
| System.Object | oldValue | The old value. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if property changing. |
OnSizeChanged(Single, Single)
Called when model size changed.
Declaration
public void OnSizeChanged(float fOffsetX, float fOffsetY)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | fOffsetX | The offset by X axis. |
| System.Single | fOffsetY | The offset by Y axis. |
OnZOrderChanged(Node, ZOrderUpdate, Int32)
Called when Z order changed.
Declaration
protected virtual void OnZOrderChanged(Node node, ZOrderUpdate changeType, int nNewZOrder)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | The node. |
| ZOrderUpdate | changeType | Type of the change. |
| System.Int32 | nNewZOrder | The new Z order value. |
OnZOrderChanging(Node, ZOrderUpdate, Int32)
Called when Z order changing.
Declaration
protected virtual bool OnZOrderChanging(Node node, ZOrderUpdate changeType, int nNewZOrder)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | The node. |
| ZOrderUpdate | changeType | Type of the change. |
| System.Int32 | nNewZOrder | The new Z order value. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if Z order changing. |
ProvideServiceReference(RuntimeTypeHandle)
Get the service reference from provider.
Declaration
public object ProvideServiceReference(RuntimeTypeHandle typeHandle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.RuntimeTypeHandle | typeHandle | The type handle. |
Returns
| Type | Description |
|---|---|
| System.Object | The object. |
RecordPropertyChanged(String)
Records the property changed.
Declaration
protected void RecordPropertyChanged(string strPropertyName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | strPropertyName | Name of the property. |
RecordZOrderChanged(Node, ZOrderUpdate)
Records the Z order changed.
Declaration
protected void RecordZOrderChanged(Node node, ZOrderUpdate changeType)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | The node. |
| ZOrderUpdate | changeType | Type of the change. |
RegenerateUniqueNames()
Special method for proper rendering DiagramWebControl Nodes. Don't use this method!
Declaration
public bool RegenerateUniqueNames()
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if regnerate unique names. |
RemoveAllChildren()
Removes all child nodes from the node.
Declaration
public void RemoveAllChildren()
RemoveChild(Node)
Removes specified child node.
Declaration
public bool RemoveChild(Node nodeToRemove)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | nodeToRemove | The node to remove. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the node was successfully removed; otherwise False. |
RemoveChild(Int32)
Removes the child node at the given position.
Declaration
public bool RemoveChild(int childIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | childIndex | Zero-based index into the collection of child nodes. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the node was successfully removed; otherwise False. |
RemoveFromContainingLayers(Node)
Removes from containing layers.
Declaration
protected void RemoveFromContainingLayers(Node nodeRemoving)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | nodeRemoving | The node removing. |
RemoveRange(NodeCollection)
Removes the range nodes.
Declaration
public bool RemoveRange(NodeCollection nodesToRemove)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeCollection | nodesToRemove | The nodes to remove. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if remove the nodes. |
SendBackward(Node)
Visually brings the selected shapes one step backward over the nearest overlapping shape based on z-order value.
Declaration
public int SendBackward(Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to move backward. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Previous Z-order position. |
SendToBack(Node)
Visually brings the selected shapes back over all the other overlapped shapes based on z-order value.
Declaration
public int SendToBack(Node node)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to send to the back. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Previous Z-order position. |
SetZOrder(Node, Int32)
Sets the Z-order of the given node.
Declaration
public int SetZOrder(Node node, int zOrder)
Parameters
| Type | Name | Description |
|---|---|---|
| Node | node | Node to set Z-order for. |
| System.Int32 | zOrder | Zero-based Z-order value. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Previous Z-order position. |
ShouldSerializeMinimumSize()
Should serialize the minimum size of the model.
Declaration
protected bool ShouldSerializeMinimumSize()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if serialize minimum size. |
ShouldSerializeSize()
Should serialize the size of the model.
Declaration
protected bool ShouldSerializeSize()
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if serialize size. |
UnCheckUseBitmap(ICompositeNode, Hashtable)
Uncheck the use bitmap cache.
Declaration
public void UnCheckUseBitmap(ICompositeNode group, Hashtable hash)
Parameters
| Type | Name | Description |
|---|---|---|
| ICompositeNode | group | The group. |
| System.Collections.Hashtable | hash | The hashtable with flags. |
UpdateCompositeBounds()
Update bounds size to content size.
Declaration
public void UpdateCompositeBounds()
Explicit Interface Implementations
IServiceProvider.GetService(Type)
Returns the specified type of service object to the caller.
Declaration
object IServiceProvider.GetService(Type svcType)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | svcType | Type of service requested. |
Returns
| Type | Description |
|---|---|
| System.Object | The object matching the service type requested or NULL if the service is not supported. |
IDeserializationCallback.OnDeserialization(Object)
Called when deserialization is complete.
Declaration
void IDeserializationCallback.OnDeserialization(object sender)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | Object performing the deserialization. |
ISerializable.GetObjectData(SerializationInfo, StreamingContext)
Populates a SerializationInfo with the data needed to serialize the target object.
Declaration
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | SerializationInfo object to populate. |
| System.Runtime.Serialization.StreamingContext | context | Destination streaming context. |