Public Member Functions | |
Shell () | |
bool | PutCommand (string command) |
void | Load (string parameters) |
Retrieves (loads) the workspace and the command history. | |
void | Save (string parameters) |
Stores the workspace and the command history. | |
delegate void | ShellEvent (object parameter) |
delegate void | GeneratedSourceChangeHandler (object sourceCode) |
delegate void | NewCommandHistoryHandler () |
Properties | |
ArrayList | CommandNames |
A list of the names of all build-in command. | |
ObservableWriterStream | StdOut = new ObservableWriterStream() |
ObservableWriterStream | StdError = new ObservableWriterStream() |
ObservableWriterStream | UserProgramOut = new ObservableWriterStream() |
ObservableWriterStream | UserProgramError = new ObservableWriterStream() |
event GeneratedSourceChangeHandler | OnSourceChange |
readonly string | GeneratedSourceCode = "" |
readonly Workspace | Workspace |
DllAndNamespaceHandling | DllAndNamespaceHandling = new DllAndNamespaceHandling(true) |
ShellCommands | _shellCommands |
ArrayList | CommandHistory = new ArrayList() |
event ShellEvent | OnCommandAdded |
event NewCommandHistoryHandler | OnNewCommandHistory |
Help | help = new Help() |
static string | _defaultFileName = "CSharpShell.dat" |
static readonly string | _className = "UserCode" |
static readonly string | _prependUserClass |
static readonly string | _appendUserClass |
static readonly string | _helpText |
Private Member Functions | |
void | GetFirstWordOfInput (string input, out string firstWord, out string parameters) |
void | ExecuteUserCode (string code) |
string | VariableUseMatch (Match m) |
void | InvokeExecuteUserCodeMethod (string fileName) |
bool | CreateClassCode (string inCode, string compileString, DllAndNamespaceHandling dllAndNamespaceHandling, out string outCode) |
string | Whos () |
Displays all workspace variables. | |
string | Help (string parameters) |
Displays a help text. | |
void | Methods (string parameters) |
Displays the public methods of a workspace variable. | |
string | ParametersToFileName (string parameters) |
void | Clear (string parameters) |
Static Private Member Functions | |
static string | MakeCompileString (DllAndNamespaceHandling dllAndNamespaceHandling, string fileName) |
Via the Workspace class it also stores the workspace variables. It also stores which namespaces, dlls, and paths should be included when compiling user code (via DllAndNamespaceHandling class). Finally it stores the command history.
|
|
|
|
|
|
|
Compiles and executes C# code.
|
|
|
|
|
|
Displays a help text.
|
|
|
|
Retrieves (loads) the workspace and the command history.
|
|
|
|
Displays the public methods of a workspace variable.
|
|
|
|
Used by load and save command. It extracts the filename from parameters. If no filename is present it used the _defaultFileName. |
|
|
|
Stores the workspace and the command history.
|
|
|
|
|
|
Displays all workspace variables.
|
|
Initial value: @"
}
}"
|
|
|
|
|
|
Initial value: @"
Currently C#Shell supports the following build-in commands:
- help
- load [file name]
- save [file name]
- whos
- methods <variable>
- quit
- exit
Help is the current command. Load and save retrieves and stores the current workspace (variables and command history). Whos shows all your variables. Methods shows which methods a variable supports. Quit and exit stops C#Shell.
Please try this program and send any comments to mads_lindstroem@yahoo.dk."
|
|
Initial value: @" class " + _className + @" : IUserCode { public void ExecuteUserCode(Workspace workspace) { if (workspace == null) { System.Console.WriteLine(" + "\"Ugler i mosen. Workspace is a null reference\"" + @"); return; } #line 1 " |
|
|
|
|
|
A list of the names of all build-in command.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|