Internal script for running embedded applications. This script will contain examples that are prepared for Marko Petek by Igor Gresovnik.
More...
Public Member Functions |
| AppIgorGresovnik () |
void | CloseLogWriter () |
| Closes the file writer used for logging, and thus unlocks teh underlyig file so that other programs dcan use it.
|
override void | Script_AddCommands (ICommandLineApplicationInterpreter interpreter, SortedList< string, string > helpStrings) |
| Adds application commands to the application interpreter.
|
string | AppExGraphics (string[] arguments) |
| Runs some graphics examples.
|
string | AppExVector (string[] arguments) |
| Runs some vector examples.
|
string | AppExFunction (string[] arguments) |
| Example for defining custom functions.
|
string | AppExLocateScriptCode (string[] arguments) |
| Code in this method helps the user locate script classes and their appropriate methods that execute particular examples via the "Internal" interpreter command. Instructions for locating the code of interest:* Anywhere in the code, declare a variable of the correspoonding script class. Full class name is precisely the argumet that follows the "Internal" command or argument when the command is launched through interpreter.* Navigate to the definition of that class.* Search for the string that is the internal command. This string is usually assigned to some constant.* By searching where that constant is referenced (you can perform usual string search within the script class, or right-click constant name and chose "Find All References"), locate the position where command is installed on the script's interpreter. This is usually done by the LoadableScriptBase.Script_AddCommand method.One of the arguments of the method that installs the command is the method that actually executes the command. Navigate to that method (right-click, select "Go To Definition"), and in the body of the method you will find the code behind the interpreter command. Beside the pure code, there may be some auxiliary stuff, e.g. for acquisition of interpreter arguments.Warnings:* Sometimes the command is not defined directly in the script class that is loaded to execte the command (i.e. the class whose name follows the "Internal" keyword in the interpreter command), but it is defined and/or installed in one of the classes from which this class derives (inheritance!). Therefore, if you don't find the appropriate interpreter command in the expected class, check also down the inheritance hierarchy, i.e in the class inherited by the expected class, then in the class inherited by that class, etc. * Nested commands: Some script commands are nested, i.e. one command contains a number of subcommands. In this case, the method you are looking for is associated with the subcommand rather than the main command.Example:In the following command: Shell Internal IG.Script.ScriptGraphics2dBase Graph CurvePlotLissajous 8 10"Graph" is the main command of the IG.Script.ScriptGraphics2dBase script class, but it contains several nested commands, and "CurvePlotLissajous" is the nested command that dues the actual job of plotting the Lissajous curves. Therefore, this is the string you must search for within the script class. The second occurrence of the string is where the string is assigned to the IG.Script.ScriptGraphics2dBase.GraphCurvePlotLissajous constant, and by searching for references to this constant within the class, you quickly find the place where the command is installed. The corresponding line of code looks something like this:AddGraphCommand(GraphCurvePlotLissajous, GraphFunctionCurvePlotLissajous, GraphHelpCurvePlotLissajous);The second argument is the method that actually does the job of plotting Lissajous curves, terefore you can just right-click on this argument and select "Go To Definition."
|
Public Attributes |
const string | DefaultWorkingDirectoryName = "Petek_Diploma" |
| Default name of the working directory for Marko Petek's graduate thesis.
|
const string | DefaultSolutionFileName = "Solution.txt" |
| Default name of the file where solution is written.
|
const string | DefaultLogFileName = "Log.txt" |
| Default name of the application's log file.
|
const string | ConstExGraphics = "ExGraphics" |
| Name of the command that runns the main thesis application.
|
const string | ConstHelpExGraphics = "Customized function for running some examples." |
const string | ConstExVector = "ExVector" |
| Name of the command that runns the main thesis application.
|
const string | ConstHelpExVector = "Customized function for running some vector examples." |
const string | ConstExFunction = "ExFunction" |
| Name of the command that runns the main thesis application.
|
const string | ConstHelpExFunction = "Customized function for running some real function examples." |
const string | ConstLocateScriptCode = "LocateScriptCode" |
| Name of the command that runs the snippet of code used for location of script classes.
|
const string | ConstHelpLocateScriptCode = "Runs auxiliary code containing instructions for locating script code." |
Protected Member Functions |
virtual void | InitLogWriter (TextWriter writer) |
| Initializes a text writer used for logging. Initialization consists of writing introductory text that includes the current time.
|
Protected Attributes |
string | _workingDirectoryName = DefaultWorkingDirectoryName |
string | _workingDirectoryPath |
string | _solutionFileName = DefaultSolutionFileName |
string | _solutionFilePath |
string | _logFileName = DefaultLogFileName |
string | _logFilePath |
bool | _externalLogWriterUsed = false |
Properties |
virtual string | ParentWorkingDirectory [get] |
| Returns parent directory of the working directory. Delegated to Utilities.ParentWorkingDirectoryPath
|
virtual string | WorkingDirectoryName [get, set] |
| Name of the working directory.
|
virtual string | WorkingDirectoryPath [get, set] |
| Path of the application's working directory.
|
virtual string | SolutionFileName [get, set] |
| Name of the file where solution is written to.
|
virtual string | SolutionFilePath [get, set] |
| Path to the solution file.
|
virtual string | LogFileName [get, set] |
| Name of the file where notes on operation can be logged.
|
virtual string | LogFilePath [get, set] |
| Path to the log file where notes on operations can be logged.
|
TextWriter | LogWriter [get, set] |
| File writer used for logging notes on operation of the application.
|
Private Attributes |
TextWriter | _logWriter |
Internal script for running embedded applications.
This script will contain examples that are prepared for Marko Petek by Igor Gresovnik.
In the applications that have the command-line interpreter, embedded applications from this class can typically be run in the following way:
AppName Internal IG.Script.AppShellExt CommandName arg1 arg2 ...
where AppName is the application name, IG.Script.AppBase is the full name of the script class that contains embedded applications, CommandName is name of the command that launches embedded application, and arg1, arg2, etc. are command arguments for the embedded application.
- See also:
- ScriptAppBase
$A Igor Jan01;
string IG::Script::AppIgorGresovnik::AppExLocateScriptCode |
( |
string[] |
arguments | ) |
[inline] |
Code in this method helps the user locate script classes and their appropriate methods that execute particular examples via the "Internal" interpreter command. Instructions for locating the code of interest:* Anywhere in the code, declare a variable of the correspoonding script class. Full class name is precisely the argumet that follows the "Internal" command or argument when the command is launched through interpreter.* Navigate to the definition of that class.* Search for the string that is the internal command. This string is usually assigned to some constant.* By searching where that constant is referenced (you can perform usual string search within the script class, or right-click constant name and chose "Find All References"), locate the position where command is installed on the script's interpreter. This is usually done by the LoadableScriptBase.Script_AddCommand method.One of the arguments of the method that installs the command is the method that actually executes the command. Navigate to that method (right-click, select "Go To Definition"), and in the body of the method you will find the code behind the interpreter command. Beside the pure code, there may be some auxiliary stuff, e.g. for acquisition of interpreter arguments.Warnings:* Sometimes the command is not defined directly in the script class that is loaded to execte the command (i.e. the class whose name follows the "Internal" keyword in the interpreter command), but it is defined and/or installed in one of the classes from which this class derives (inheritance!). Therefore, if you don't find the appropriate interpreter command in the expected class, check also down the inheritance hierarchy, i.e in the class inherited by the expected class, then in the class inherited by that class, etc. * Nested commands: Some script commands are nested, i.e. one command contains a number of subcommands. In this case, the method you are looking for is associated with the subcommand rather than the main command.Example:In the following command: Shell Internal IG.Script.ScriptGraphics2dBase Graph CurvePlotLissajous 8 10"Graph" is the main command of the IG.Script.ScriptGraphics2dBase script class, but it contains several nested commands, and "CurvePlotLissajous" is the nested command that dues the actual job of plotting the Lissajous curves. Therefore, this is the string you must search for within the script class. The second occurrence of the string is where the string is assigned to the IG.Script.ScriptGraphics2dBase.GraphCurvePlotLissajous constant, and by searching for references to this constant within the class, you quickly find the place where the command is installed. The corresponding line of code looks something like this:AddGraphCommand(GraphCurvePlotLissajous, GraphFunctionCurvePlotLissajous, GraphHelpCurvePlotLissajous);The second argument is the method that actually does the job of plotting Lissajous curves, terefore you can just right-click on this argument and select "Go To Definition."
- Parameters:
-
arguments | Command arguments. |
- Returns:
- null.