C# Class Xnlab.SQLMon.Controls.Tree.TreeBuilder

Inheritance: IDisposable
Datei anzeigen Open project: unruledboy/SQLMonitor Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void
GenerateTree ( int width, int height, string startFromNodeId, ImageFormat imageType ) : Stream

Creates the tree

GenerateTree ( string startFromNodeId, ImageFormat imageType ) : Stream

This overloaded method can be used to return the image using it's default calculated size, without resizing

GetRectangleFromNode ( XmlNode oNode ) : Rectangle

the node holds the x,y in attributes use them to calculate the position This is public so it can be used by other classes trying to calculate the cursor/mouse location

TreeBuilder ( Tree data ) : System

ctor

Private Methods

Method Description
BuildTree ( XmlNode oNode, int y ) : void

convert the datatable to an XML document

CalculateImageMapData ( ) : void

After resizing the image, all positions of the rectanlges need to be recalculated too.

DrawChart ( XmlNode oNode ) : void

Draws the actual chart image.

GetMaxXOfDescendants ( XmlNode currentNode ) : int

Get the maximum x of the lowest child on the current tree of nodes Recursion does not work here, so we'll use a loop to climb down the tree Recursion is not a solution because we need to return the value of the last leaf of the tree. That would require managing a global variable.

GetXPosByOwnChildren ( XmlNode currentNode ) : int
GetXPosByParentPreviousSibling ( XmlNode currentNode ) : int
GetXPosByPreviousSibling ( XmlNode currentNode ) : int
GetXmlNode ( string nodeId, string nodeDescription, string nodeNote, Color backColor, Color foreColor ) : XmlNode

create an xml node based on supplied data

OverlapExists ( ) : bool

used for testing purposes, to see if overlap exists between at least 2 boxes.

Method Details

Dispose() public method

public Dispose ( ) : void
return void

GenerateTree() public method

Creates the tree
public GenerateTree ( int width, int height, string startFromNodeId, ImageFormat imageType ) : Stream
width int
height int
startFromNodeId string
imageType System.Drawing.Imaging.ImageFormat
return Stream

GenerateTree() public method

This overloaded method can be used to return the image using it's default calculated size, without resizing
public GenerateTree ( string startFromNodeId, ImageFormat imageType ) : Stream
startFromNodeId string
imageType System.Drawing.Imaging.ImageFormat
return Stream

GetRectangleFromNode() public method

the node holds the x,y in attributes use them to calculate the position This is public so it can be used by other classes trying to calculate the cursor/mouse location
public GetRectangleFromNode ( XmlNode oNode ) : Rectangle
oNode System.Xml.XmlNode
return System.Drawing.Rectangle

TreeBuilder() public method

ctor
public TreeBuilder ( Tree data ) : System
data Tree
return System