C# Класс Canguro.Controller.CommandServices

Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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.

Описание методов

CommandServices() публичный Метод

public CommandServices ( Controller controller ) : System
controller Controller
Результат System

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

GetItem() публичный Метод

Method to get any Item from the user by any means available (i.e. picking, text input, etc.)
public GetItem ( ) : Canguro.Model.Item
Результат Canguro.Model.Item

GetItem() публичный Метод

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
Результат Canguro.Model.Item

GetJoint() публичный Метод

Method to get a Joint from the user by any means available (i.e. picking, text input, etc.)
public GetJoint ( ) : Canguro.Model.Joint
Результат Canguro.Model.Joint

GetJoint() публичный Метод

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
Результат Canguro.Model.Joint

GetJoint() публичный Метод

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
Результат Model.Joint

GetLine() публичный Метод

Method to get a Line element from the user by any means available (i.e. picking, text input, etc.)
public GetLine ( ) : Canguro.Model.LineElement
Результат Canguro.Model.LineElement

GetLine() публичный Метод

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
Результат Canguro.Model.LineElement

GetMany() публичный Метод

Method to get many Items from the user by any means available (i.e. picking, text input, etc.)
public GetMany ( ) : void
Результат void

GetMany() публичный Метод

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
Результат void

GetPoint() публичный Метод

This method returns a Magnet whose SnapPoint property has the point obtained either typed or clicked.
public GetPoint ( ) : Magnet
Результат Canguro.Controller.Snap.Magnet

GetPoint() публичный Метод

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.
Результат Canguro.Controller.Snap.Magnet

GetProperties() публичный Метод

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
Результат void

GetProperties() публичный Метод

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
Результат void

GetProperties() публичный Метод

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)
Результат void

GetProperties() публичный Метод

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.
Результат void

GetSelection() публичный Метод

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
Результат List

GetSelection() публичный Метод

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
Результат bool

GetSingle() публичный Метод

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
Результат float

GetString() публичный Метод

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
Результат string

GetVector() публичный Метод

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.
Результат bool

Print() публичный Метод

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
Результат void

ReportProgress() публичный Метод

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
Результат void

ReportProgress() публичный Метод

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
Результат void

RestoreSelection() публичный Метод

public RestoreSelection ( ) : void
Результат void

Run() публичный Метод

Executes a command from another command's thread
public Run ( Commands command ) : void
command Commands
Результат void

SelectionDone() публичный Метод

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
Результат void

ShowDialog() публичный Метод

public ShowDialog ( System form ) : System.Windows.Forms.DialogResult
form System
Результат System.Windows.Forms.DialogResult

StoreSelection() публичный Метод

public StoreSelection ( ) : bool
Результат bool