Lists all the commands that have been added to the interpreter
Syntax
Visual Basic (Declaration) | |
---|
Public ReadOnly Property Commands As ICommand() |
Example
Library/Library.Test/TestCmdInterpreter.cs
C# | Copy Code |
---|
string result;
CommandInterpreter ci = new CommandInterpreter(DefaultCommands.None, new TestCommands(), typeof(StaticTestFilter));
Assert.AreEqual(1, ci.Filters.Length);
Assert.AreEqual("AddLineNumbers", ci.Filters[0].DisplayName);
result = Capture(ci, "Count 2 /linenumbers");
Assert.AreEqual("1: 1\r\n2: 2", result);
int cmds = ci.Commands.Length;
ci.AddCommand(ci.Filters[0]);
Assert.AreEqual(cmds + 1, ci.Commands.Length);
result = Capture(ci, "AddLineNumbers");
Assert.AreEqual("2", result); |
VB.NET | Copy Code |
---|
Dim result As String
Dim ci As New CommandInterpreter(DefaultCommands.None, New TestCommands(), GetType(StaticTestFilter))
Assert.AreEqual(1, ci.Filters.Length)
Assert.AreEqual("AddLineNumbers", ci.Filters(0).DisplayName)
result = Capture(ci, "Count 2 /linenumbers")
Assert.AreEqual("1: 1" & vbCr & vbLf & "2: 2", result)
Dim cmds As Integer = ci.Commands.Length
ci.AddCommand(ci.Filters(0))
Assert.AreEqual(cmds + 1, ci.Commands.Length)
result = Capture(ci, "AddLineNumbers")
Assert.AreEqual("2", result) |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also