Drawing3d documented Class Library

TaskCtrl Members

TaskCtrl overview

Public Static (Shared) Fields

CommitList Contains items which hold the commits.
MaxCommit Gets and sets the maximum of commits.
RedoCall The UnDo method is called from UnDo and ReDo as well. This field indicates whether the call is done by the method ReDo or not.
RedoList Contains Items which hold the redos.
State_Idle This is the default state which indicates, that the TaskCtrl don`t do anything.

Public Static (Shared) Methods

CommitBegin To combine more than one commit to one Undostep use CommitBegin and CommitEnd
CommitBegin();
    Commit(1,"Delete Text"); // first Commit
    Commit(4,"Delete Line"); // Second Commit
CommitEnd();
        /// 
CommitEnd To combine more than one commit to one Undostep use CommitEnd and CommitBegin
LastCommit Returns the data of the last "commit"-call
ListChanged This method calls the event OnCommitListChanged
ReDoOverloaded. This method can be called from the program easily by TaskCtrl.ReDo(). In this case the first entry in the Redolist will be activated and removed.
UnDoOverloaded. This method can be called from the program simply by TaskCtrl.UnDo(). In this case the first entry in the commitlist will be activated and than removed.

Public Static (Shared) Events

OnCommit This event is fired by Commit
OnCommitListChanged This event is allways called, if the CommitList has been changed.

The sender-parameter is null. You can use this event to list the possible undosteps by using CommitList and its method Text >. If CommitList.Count > 0 an undo is possible.
OnRedoListChanged This event is allways called, if the RedoList has been changed.

The sender-parameter is null. You can use this event to list the possible redosteps by using RedoList and its method Text. If CommitList.Count 0 a redo is possible.
OnUndo This event is fired by UnDo

Public Instance Constructors

TaskCtrl Constructor Initializes a new instance of the TaskCtrl class.

Public Instance Fields

Catchenabled (inherited from Entity) If Catchenabled is false, you cannot hit the entity, otherwise it is a candidate to catch them with the mousepointer. Default is true; Select
Children (inherited from MNComponent)
GenerateNames (inherited from MNComponent) If GenerateNames is true, a Name will be generated, if the parent is set to a component which has no name. With GenerateNames is guaranteed, that every member of a tree (except the root) has a unique name and there is a fullpath, with which the element can be identified.
HoverColor (inherited from DrawCtrl) Holds the color in which a draw element will be drawn, if the cursor passes it.
MouseDownPos (inherited from ActiveCtrl) Holds the mousedown position.
MovedSinceLastUp (inherited from ActiveCtrl) True, if there was moved the mouse since the last mouseup.
UpDateCount (inherited from MNComponent) Sets or gets a counter. It will be incremented by the method UpDating and deremented by UpDated. If it is 0 then UpDate is called.

Public Instance Properties

Base (inherited from Entity) Base is an other aspect of Transformation. She is given from Transformation by the conversion with toBase For some it is easier to work with a base as with a transformation. It is also easier to imagine it as a base. All coordinates, used in the drawmethod of the entity are taken relative to this base.
ClickedPosCount (inherited from ActiveCtrl) An ActiveCtrl stores the posiions, where a mouseclick is done. This property gets the count (max 20) of such stored positions.
Color (inherited from DrawCtrl) Color in which the ActiveCtrl will be drawed.
Count (inherited from MNComponent) Returns the count of children
CurrentHit (inherited from DrawCtrl) Gets the CurrentHit from the HitItemlist. It is null, if the Hititemlist is empty or the first entry doesn`t belong to the DrawCtrl.
Device (inherited from DrawCtrl) The ActiveCtrl belongs to that device +in case, that one ancestor is the field Work. If you set this property, the ActiveCtrl will be added to the children of Work.
ESCEnabled
EventServer (inherited from ActiveCtrl) Get the EventServer, which fires the mouse- and keyevents.
Global (inherited from Entity) Get a transformation to global coordinates. The transformation of all ancestors of an entity will be multiplyed and returned.
Item (inherited from MNComponent) The default indexer retrieves and sets MNComponents
Listening (inherited from ActiveCtrl) By setting Listening to false, you can turn off all mouse- and keyevents.
Name (inherited from MNComponent) Name of the component.
PaintChildren (inherited from Entity) If PaintChildren is true, all children will be drawn. The default value is true.
Parent (inherited from DrawCtrl)
PenStyle (inherited from DrawCtrl)Gets or sets the style of then pen, which is used in painting.
PenWidth (inherited from DrawCtrl) Gets or sets the width of then pen, which is used in painting.
Posxy (inherited from ActiveCtrl) Gets the mouse position in coordinates relatively to the xy-plane of the Base
Posxyz (inherited from ActiveCtrl) Gets the mouse position in coordinates relatively to the Base in the xy-coordinates plane
PreProcess (inherited from ActiveCtrl) If true, the events of the ActiveCtrl are called from the EventServer before the Events of a ActiveCtrl with PreProcess=false.
State This field is for a free use. It would be helpful to define some states not equal to State_Idle. In Terminate the field is reseted to State_Idle. If you override Terminate, you can do something to finish an action.
Tag (inherited from MNComponent) A free programmable property, which is not stored in a file.
Transformation (inherited from Entity) Every Entity has a transformation which is called in the Paint-method. This transformation is also valid for a child and a child's child and so on.
Visible (inherited from Entity) If Visible = true the the entity will be drawn. Default is true

Public Instance Methods

activateColor (inherited from DrawCtrl) Activates a color in the device, depending on the PolygonMode. If PolygonMode has the value Fill, the ambient part of Material will be set. Otherwise PenColor
Add (inherited from Entity) Adds a Entity E as child.
addChild (inherited from MNComponent) Adds an elment in the list.
Busy Should be true, if the TaskCtrl is in an active rule. The method returns true, if State != State_Idle.
checkuniquename (inherited from MNComponent) If the parent is setted, this method returns a name, consisting of value and a number, so that it is unique in his parent.
ChildByName (inherited from MNComponent) Retrieves the index of child by a name.
ChildByPathName (inherited from MNComponent) You can get a MNComponent by setting a fullpath relative to the given MNComponent. The names are seperated by "/".
MNComponent root = new MNComponent();
MNComponent a = new MNComponent();
MNComponent b = new MNComponent();
MNComponent c = new MNComponent();
a.Name = "Frank";
b.Name = "Joe";
c.Name = "Sam";
c.Parent = b;
b.Parent = a;
a.Parent = root;
MNComponent d = root.ChildByPathName("Frank/Joe/Sam");
// d is then the component c

ClickedPos (inherited from ActiveCtrl) An ActiveCtrl stores the posiions, where a mouseclick is done. This method gets the i-th position, where zero is the last.
CommitOverloaded. Set up an rolluppoint and calls Commit with object = null. For the use of this method you have to override the method GetUndoData.
ctrlCircle (inherited from DrawCtrl)Overloaded. Draws a controlled circle.
ctrlCurve (inherited from DrawCtrl) Draws an active Curve C, which will be highlighted by the HoverColor if the mouse moves over it. With the parameter Tag you can set informations to identify the curve in an other context.
CtrlDisplaylist (inherited from DrawCtrl) Draws a controlled display list
ctrlLine (inherited from DrawCtrl)Overloaded. Draws an active line from A to B, which will be highlighted by the HoverColor if the coursor crosses it. With the parameter Tag you can set informations to identify the line in an other context.
ctrlMarker (inherited from DrawCtrl)Overloaded. Draws an active marker, which will be highlighted by the HoverColor if the mousepcursor passes it. With the parameter Tag you can set informations to identify the marker in an other context.
ctrlPoly (inherited from DrawCtrl)Overloaded. Draws an active polygon a, which will be highlighted by the HoverColor if the cursor moves over it. With the parameter Tag you can set informations to identify the polygon in an other context.
CtrlRect (inherited from DrawCtrl)Overloaded. Draws a rectangle given by two points A and B. Additionally it draws 9 marker at the edgepoints, the midpoints of the lines and the center of the rectangle. For each marker a DrawCtrl.CtrlPointKind is set as Tag. So you can identify the marker with CurrentHit.Tag
CtrlRectMarker (inherited from DrawCtrl) Draws a rectangle given by two points A and B. It draws marker dependig on "MarkerCount". For each marker a DrawCtrl.CtrlPointKind is set as Tag. So you can identify the marker with CurrentHit.Tag
Equals (inherited from Object) 
EventHandled (inherited from ActiveCtrl) A very tough method: if you call EventHandled(), no one of the following ActiveCtrls gets a message from the eventServer of the device.
fullPath (inherited from MNComponent) Gives the full path of the component over all ancestors until a null-parent occurs. This parent is often called the root. To separate the names "/" is used.
GetEnumerator (inherited from MNComponent) Returns the Enumerator of an intern ArrayList
GetHashCode (inherited from Object) 
getName (inherited from MNComponent) Returns the name
getPath (inherited from MNComponent) Returns a path, whose member are separated by "/" beginning with "/"
GetPreprocess (inherited from ActiveCtrl) Setter method of PreProcess
GetRedoData This method calls GetUndoData. If you want to change this, you have to override this method.
getRoot (inherited from MNComponent) Implements the ISerializePath interface. If parent is null then it returns the object itself.
GetType (inherited from Object) 
GetUndoData This empty method has to be overridden.
InsertChild (inherited from MNComponent) Insert a MNComponentobject at position index.
LastPos (inherited from ActiveCtrl) Returns the ClickedPos, but calculated relative to the the plane, which is given by Base.BaseO, Base.BaseX and Base.BaseY.
MoveEventPosTo (inherited from ActiveCtrl) A call moves the EventServer to the determinated position in the Device.Eventserver. If you call for example MoveEventPos(0), you get all events before all the other activeCtrls.
MoveTO (inherited from MNComponent) Moves a children-component to a position
OverrideClickedPos (inherited from ActiveCtrl) Set the last clickedpos to a new value
Paint (inherited from DrawCtrl) Overrides the Paint-method and sets Penwidth, PenStyle and PenColor.
ReDoOverloaded. Calls by default the UnDo-method (!!). To recognize redocalling the propertyRedoCall is true;
RemoveChild (inherited from MNComponent) Removes a component.
setClickedPos (inherited from ActiveCtrl) You set a position, to simulate a ClickedPos.
SetPos (inherited from ActiveCtrl) sets the relative position to the currentposion of the device
SetPreProcess (inherited from ActiveCtrl) Getter method of PreProcess
Terminate Terminates an action of the TaskCtrl. By default State is set to State_Idle.
ToString (inherited from Object) 
Transform (inherited from Entity) Implements ITransform: the transformation will be multiplied by the Matrix T.
UnDoOverloaded. Calls the OnUndo-event
UpDate (inherited from Entity) Overrides the UpDate- method and informs the MNDevice, that the contents have changed.
UpDated (inherited from Entity) Overrides the UpDated-method and informs all devices in which the entity is visible. So a change of an entity arouses changings in all devices.
UpDating (inherited from Entity) Overrides the UpDating-method and informs all devices in which the entity will be drawn by a call of their Updating-method.

Public Instance Events

OnDisposed (inherited from MNComponent)
OnDraw (inherited from Entity) From draw a OnDraw-event is fired. You can use them. So you don`t have to derive a component.
OnDrawFloat (inherited from DrawCtrl) This event is called from DrawFloat
OnKeyDown (inherited from ActiveCtrl) Called from KeyDown
OnKeyPress (inherited from ActiveCtrl) Called from KeyPress
OnKeyUp (inherited from ActiveCtrl) Called from KeyUp
OnMouseDown (inherited from ActiveCtrl) The event is called from the method MouseDown
OnMouseMove (inherited from ActiveCtrl) The event is called from the method MouseMove
OnMouseUp (inherited from ActiveCtrl) The event is called from the method MouseUp
OnPaint (inherited from Entity) Event called by Paint
OnTerminate Is call by Terminate
OnUpdate (inherited from MNComponent) This event is called by UpDate
OnUpdating (inherited from MNComponent) This event is called by UpDating

Protected Instance Methods

Disposed (inherited from MNComponent) Setzt den Parent auf null.
draw (inherited from Entity) From the Paint-method a 'draw' is called. It is better to override drawmetod than the Paintmethod, because in the Paintmethod some calls enclose the drawmethod ( for example the transformation will be setted ).
DrawFloat (inherited from DrawCtrl) Call the drawingmethods of those parts of a sketch, which should be fast changed (For example in a mouse move ). .
Finalize (inherited from Object) 
GetColor (inherited from DrawCtrl) Virutal getmethod of the Color-property
GetPosxy (inherited from ActiveCtrl) Protected get-method of the propertyPosxy
GetPosxyz (inherited from ActiveCtrl) Protected get-method of the propertyPosxyz
GetTransformation (inherited from Entity) GetMethod of the property Transformation
KeyDown
KeyPress (inherited from ActiveCtrl) Method is call when key is pressed.
KeyUp (inherited from ActiveCtrl) Method is call when a user loose a keybutton.
MemberwiseClone (inherited from Object) 
MouseDown (inherited from ActiveCtrl) A MouseDown event is invoked.
MouseMove (inherited from ActiveCtrl) A MouseMove event is invoked.
MouseUp (inherited from ActiveCtrl) A MouseUp event is invoked. MouseEventArgs
SetColor (inherited from DrawCtrl) Virutal setmethod of the Color-property
setDevice (inherited from ActiveCtrl) Setmethod of the Device-property
setParent (inherited from ActiveCtrl) Overrides the setParent-method and sets the MNDevice-property to all children, which are of type ActiveCtrl.
SetTransformation (inherited from Entity) Setmethod of the property Transformation
SetVisible (inherited from Entity) Virtual setmethod of the Visible-property.

See Also

TaskCtrl Class | Drawing3d Namespace