C# Class Canguro.Controller.CommandServices

Inheritance: IDisposable
Exibir arquivo Open project: rforsbach/Treu-Structure Class Usage Examples

Public Methods

Method Description
CommandServices ( Controller controller ) : System
Dispose ( ) : void
GetItem ( ) : Canguro.Model.Item

Method to get any Item from the user by any means available (i.e. picking, text input, etc.)

GetItem ( string prompt ) : Canguro.Model.Item

Method to get any Item from the user by any means available (i.e. picking, text input, etc.)

GetJoint ( ) : Canguro.Model.Joint

Method to get a Joint from the user by any means available (i.e. picking, text input, etc.)

GetJoint ( string prompt ) : Canguro.Model.Joint

Method to get a Joint from the user by any means available (i.e. picking, text input, etc.)

GetJoint ( IList newLines ) : Model.Joint

This method requests a point and returns a joint. If a joint is found, the method gets it. If not, then creates one and if the created joint lies on a line, then the command splits the line and adds the new line to the newLines list.

GetLine ( ) : Canguro.Model.LineElement

Method to get a Line element from the user by any means available (i.e. picking, text input, etc.)

GetLine ( string prompt ) : Canguro.Model.LineElement

Method to get a Line element from the user by any means available (i.e. picking, text input, etc.)

GetMany ( ) : void

Method to get many Items from the user by any means available (i.e. picking, text input, etc.)

GetMany ( string prompt ) : void

Method to get many Items from the user by any means available (i.e. picking, text input, etc.)

GetPoint ( ) : Magnet

This method returns a Magnet whose SnapPoint property has the point obtained either typed or clicked.

GetPoint ( string prompt ) : Magnet

This method returns a Magnet whose SnapPoint property has the point obtained either typed or clicked.

GetProperties ( object obj ) : void

Method to present the user with an option to view and change an object properties. It shows a PropertyGrid with which the user is allowed to interact. Properties are changed in the object immediately after the user changes them in the PropertyGrid.

GetProperties ( string title, object obj ) : void

Method to present the user with an option to view and change an object properties. It shows a PropertyGrid with which the user is allowed to interact. Properties are changed in the object immediately after the user changes them in the PropertyGrid.

GetProperties ( string title, object obj, bool runAsync ) : void

Method to present the user with an option to view and change an object properties. It shows a PropertyGrid with which the user is allowed to interact. Properties are changed in the object immediately after the user changes them in the PropertyGrid.

GetProperties ( string title, object obj, bool runAsync, string listItems ) : void

Method to present the user with an option to view and change an object properties. It shows a PropertyGrid with which the user is allowed to interact. Properties are changed in the object immediately after the user changes them in the PropertyGrid.

GetSelection ( ) : List

If the Model has selected Items, they are put in one list and returned. Otherwise, the user is asked to select items. Returns a List of selected Items with at least one element.

GetSelection ( Model.Joint>.Dictionary joints, List lines, List areas ) : bool

If the Model has selected Items, they are put in one list and returned. Otherwise, the user is asked to select items. Returns a List of selected Items with at least one element.

GetSingle ( string prompt ) : float

Method to get a float value from the user

GetString ( string prompt ) : string

Method to get a text string from the user

GetVector ( Microsoft &v ) : bool

This method returns a vector (displacement) obtained by user input, either from clicking or typing. The input works by asking for a basepoint and then for a second point, which can be typed with absolute or relative coordinates. The difference between the 2 points is returned.

Print ( string message ) : void

Method to allow commands to print messages on the DirectX panel to inform the user in a not-so-invasive way.

ReportProgress ( uint mainProgress ) : void

Method to allow commands to display their progress. If a command takes some time to complete without user intervention, it should call this method.

ReportProgress ( uint mainProgress, string subtaskText, uint subtaskProgress ) : void

Method to allow commands to display their progress. If a command takes some time to complete without user intervention, it should call this method.

RestoreSelection ( ) : void
Run ( Commands command ) : void

Executes a command from another command's thread

SelectionDone ( object pickedObj ) : void

Method that responds to a click on an Item. It releases any waiting locks, i.e.sets waitingObj to pickedObj and the selectionFilter to None.

ShowDialog ( System form ) : System.Windows.Forms.DialogResult
StoreSelection ( ) : bool

Private Methods

Method Description
getSelection ( Canguro model, List selection ) : bool

Adds all the selected Items to the provided selection list.

onEnterData ( object sender, Canguro e ) : void

Method that responds to the EnterData event of SmallPanel. The text input by the user on the SmallPanel's TextBox (data) is parsed here. If the input is successfull locks are released and execution continues normally, i.e.: waitingObj is assigned to the refered object and the selectionFilter is set to None. Otherwise, the input is rejected.

parseItem ( string parseStr, System list, string dataStr ) : void

Method that tries to assign waitingObj by parsing a string containing an Item index and a list containing the actual objects being refered to. If successful, it assigns waitingObj, selects the Item and sets the selectionFilter to None. If the string cannot be parsed or the index does not exist in the given list, it displays an error to the user and returns without changing anything.

wait ( WaitingFor waitingFor, bool startSelection ) : void

Method that locks commands when waiting for user interaction, until the requested action has been performed. For example, if a command requests for a Joint, then it gets locked until the user picks one by any means available.

Method Details

CommandServices() public method

public CommandServices ( Controller controller ) : System
controller Controller
return System

Dispose() public method

public Dispose ( ) : void
return void

GetItem() public method

Method to get any Item from the user by any means available (i.e. picking, text input, etc.)
public GetItem ( ) : Canguro.Model.Item
return Canguro.Model.Item

GetItem() public method

Method to get any Item from the user by any means available (i.e. picking, text input, etc.)
public GetItem ( string prompt ) : Canguro.Model.Item
prompt string Text displayed on the SmallPanel, as instructions to the user
return Canguro.Model.Item

GetJoint() public method

Method to get a Joint from the user by any means available (i.e. picking, text input, etc.)
public GetJoint ( ) : Canguro.Model.Joint
return Canguro.Model.Joint

GetJoint() public method

Method to get a Joint from the user by any means available (i.e. picking, text input, etc.)
public GetJoint ( string prompt ) : Canguro.Model.Joint
prompt string Text displayed on the SmallPanel, as instructions to the user
return Canguro.Model.Joint

GetJoint() public method

This method requests a point and returns a joint. If a joint is found, the method gets it. If not, then creates one and if the created joint lies on a line, then the command splits the line and adds the new line to the newLines list.
public GetJoint ( IList newLines ) : Model.Joint
newLines IList List of new lines created by this method while creating new joints
return Model.Joint

GetLine() public method

Method to get a Line element from the user by any means available (i.e. picking, text input, etc.)
public GetLine ( ) : Canguro.Model.LineElement
return Canguro.Model.LineElement

GetLine() public method

Method to get a Line element from the user by any means available (i.e. picking, text input, etc.)
public GetLine ( string prompt ) : Canguro.Model.LineElement
prompt string Text displayed on the SmallPanel, as instructions to the user
return Canguro.Model.LineElement

GetMany() public method

Method to get many Items from the user by any means available (i.e. picking, text input, etc.)
public GetMany ( ) : void
return void

GetMany() public method

Method to get many Items from the user by any means available (i.e. picking, text input, etc.)
public GetMany ( string prompt ) : void
prompt string Text displayed on the SmallPanel, as instructions to the user
return void

GetPoint() public method

This method returns a Magnet whose SnapPoint property has the point obtained either typed or clicked.
public GetPoint ( ) : Magnet
return Canguro.Controller.Snap.Magnet

GetPoint() public method

This method returns a Magnet whose SnapPoint property has the point obtained either typed or clicked.
public GetPoint ( string prompt ) : Magnet
prompt string The instruction text that appears at the SmallPanel.
return Canguro.Controller.Snap.Magnet

GetProperties() public method

Method to present the user with an option to view and change an object properties. It shows a PropertyGrid with which the user is allowed to interact. Properties are changed in the object immediately after the user changes them in the PropertyGrid.
public GetProperties ( object obj ) : void
obj object The object whose properties are being accessed
return void

GetProperties() public method

Method to present the user with an option to view and change an object properties. It shows a PropertyGrid with which the user is allowed to interact. Properties are changed in the object immediately after the user changes them in the PropertyGrid.
public GetProperties ( string title, object obj ) : void
title string The title being displayed on the Titlebar of the PropertyGrid's window
obj object The object whose properties are being accessed
return void

GetProperties() public method

Method to present the user with an option to view and change an object properties. It shows a PropertyGrid with which the user is allowed to interact. Properties are changed in the object immediately after the user changes them in the PropertyGrid.
public GetProperties ( string title, object obj, bool runAsync ) : void
title string The title being displayed on the Titlebar of the PropertyGrid's window
obj object The object whose properties are being accessed
runAsync bool Flag indicating whether the window should block the command /// until the user dismisses it or if it should be allowed to float while the command /// continues execution (the same as a modal vs. a modeless window)
return void

GetProperties() public method

Method to present the user with an option to view and change an object properties. It shows a PropertyGrid with which the user is allowed to interact. Properties are changed in the object immediately after the user changes them in the PropertyGrid.
public GetProperties ( string title, object obj, bool runAsync, string listItems ) : void
title string The title being displayed on the Titlebar of the PropertyGrid's window
obj object The object whose properties are being accessed
runAsync bool Flag indicating whether the window should block the command /// until the user dismisses it or if it should be allowed to float while the command /// continues execution (the same as a modal vs. a modeless window)
listItems string Options to be shown at the CommandBox in the /// CommandToolbox. If null, no CommandBox is shown.
return void

GetSelection() public method

If the Model has selected Items, they are put in one list and returned. Otherwise, the user is asked to select items. Returns a List of selected Items with at least one element.
public GetSelection ( ) : List
return List

GetSelection() public method

If the Model has selected Items, they are put in one list and returned. Otherwise, the user is asked to select items. Returns a List of selected Items with at least one element.
public GetSelection ( Model.Joint>.Dictionary joints, List lines, List areas ) : bool
joints Model.Joint>.Dictionary Returns the list of selected joints
lines List Returns the list of selected lines
areas List
return bool

GetSingle() public method

Method to get a float value from the user
public GetSingle ( string prompt ) : float
prompt string Text displayed on the SmallPanel, as instructions to the user
return float

GetString() public method

Method to get a text string from the user
public GetString ( string prompt ) : string
prompt string Text displayed on the SmallPanel, as instructions to the user
return string

GetVector() public method

This method returns a vector (displacement) obtained by user input, either from clicking or typing. The input works by asking for a basepoint and then for a second point, which can be typed with absolute or relative coordinates. The difference between the 2 points is returned.
public GetVector ( Microsoft &v ) : bool
v Microsoft The vector (diplacement) to be returned or Vector3.Empty if /// no vector could be obtained.
return bool

Print() public method

Method to allow commands to print messages on the DirectX panel to inform the user in a not-so-invasive way.
public Print ( string message ) : void
message string The text message to display
return void

ReportProgress() public method

Method to allow commands to display their progress. If a command takes some time to complete without user intervention, it should call this method.
public ReportProgress ( uint mainProgress ) : void
mainProgress uint Percentage completed of the whole command's execution
return void

ReportProgress() public method

Method to allow commands to display their progress. If a command takes some time to complete without user intervention, it should call this method.
public ReportProgress ( uint mainProgress, string subtaskText, uint subtaskProgress ) : void
mainProgress uint Percentage completed of the whole command's execution
subtaskText string Description of the command's current task
subtaskProgress uint Percentage completed of the current command task being performed
return void

RestoreSelection() public method

public RestoreSelection ( ) : void
return void

Run() public method

Executes a command from another command's thread
public Run ( Commands command ) : void
command Commands
return void

SelectionDone() public method

Method that responds to a click on an Item. It releases any waiting locks, i.e.sets waitingObj to pickedObj and the selectionFilter to None.
public SelectionDone ( object pickedObj ) : void
pickedObj object The clicked Item
return void

ShowDialog() public method

public ShowDialog ( System form ) : System.Windows.Forms.DialogResult
form System
return System.Windows.Forms.DialogResult

StoreSelection() public method

public StoreSelection ( ) : bool
return bool