Welcome Guest, you are in: Login

FDOT Wiki

RSS RSS

GisFramework



Search the wiki
»
Scriptable Commands can be created to allow interaction through JavaScript. All command must implement the interface IScriptableCommand or inherit from abstract classes ScriptableCommand or ScriptableCommand. Here's a fully implemented scriptableCommand example: DrawCommand.

Table of Contents [Hide/Show]


IScriptableCommand Interface

Methods

NameReturn TypeDescription
CanRespondToCommand(string command)boolThis method is implemented to return if the command can respond to command name
Execute(string parameter)voidThe method that executes when the JavaScript ExecuteCommand is run.
Initialize(IDictionary customSettings)voidThis method is called when the application is initially loaded. This can be used to take in custom configuration for a particular command.

Properties

NameTypeDescription
CommandVerbstringThe command verb that is passed into the executeCommand method to execute this command.
ExecutingboolLets the framework know if the command is currently executing
IsInitializedboolLets the framework know if the command has been initialized and is available to be called.

Events

NameTypeDescription
ExecutionCompleteEventHandlerThis should be raised when execution is complete.

CommandExecutionCompleteEventArgs

NameTypeDescription
MessagestringA message that can be returned back to the JavaScript caller.
ResultobjectA result object that can be returned back to the JavaScript caller.
SuccessboolReturns to the JavaScript caller if the call was a sucess or not.

ScriptableCommand Class

Two abstract classes are provided to allow easier implementations of ScriptableCommands. The two classes are ScriptableCommand and ScriptableCommand, the class ScriptableCommand is used to pass Type T parameters into the command.

Abstract Members

These members need to be implemented from the abstract class.
ClassNameMember TypeTypeDescription
ScriptableCommand/ScriptableCommandCommandVerbPropertystringThe CommandVerb that is passed into ExecuteCommand to specify the command used.
ScriptableCommandOnExecute(string parameter)MethodvoidThis method is implemented with the logic you want execute when the command is run.
ScriptableCommandExecute(T parameters)MethodvoidThis method is implemented with the logic you want execute when the command is run.

Methods

NameReturn TypeDescription
CanRespondToCommand(string command)boolReturns true if the string matches the CommandVerb. The match is case insensitive.
ClearGraphics()voidClears all graphics from the current graphics manager.
Dispose()voidClears all graphics from the current graphics manager.
Execute(string parameter)voidExecutes the command with the specified parameter.
Failure(Exception ex)voidCalled when a failure occurs and relays this back to JavaScript.
Initialize(IDictionary customSettings)voidInitialize the command with the provided settings.
OnInitialize(IDictionary customSettings)voidA virtual method that allows code to be executed on initialization.
Success(object result)voidCalled when the command is a success and relays this back to JavaScript.

Properties

NameTypeDescription
ExecutingboolReturns true if the command is currently executing.
GraphicsManagerGraphicsManagerA graphicsManager that allows the manipulation of graphics on the map.
IsInitializedboolReturns true if the command has been initialized.

See Also

Any Questions or Comments? Email
Some of the icons created by FamFamFam.