Class vdCommandLine
- Namespace
- VectorDraw.Professional.vdCommandLine
- Assembly
- vdCommandLine.dll
A Windows Forms control that provides command-line functionality for VectorDraw documents.
public sealed class vdCommandLine : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl
- Inheritance
-
vdCommandLine
- Implements
- Inherited Members
Examples
// Create and configure the command line control
vdCommandLine commandLine = new vdCommandLine();
commandLine.LoadCommands("path/to/commands", "Commands.txt");
commandLine.SelectDocument(myVdDocument);
// Customize appearance
commandLine.PopupFormFont = new Font("Arial", 11f);
commandLine.PopupFormWidth = 300;
commandLine.EnablePopupForm = true;
Remarks
The vdCommandLine control is designed to transfer keyboard user input to VectorDraw document actions.
It provides a user-friendly command-line interface with command history, autocomplete popup, and customizable
command loading from external files or streams.
Key features include:
- Command execution with dynamic DLL loading and reflection-based invocation
- Command history tracking and display
- Popup form for command suggestions and autocomplete
- Customizable fonts, colors, and appearance
- Support for command shortcuts and multiple aliases
To use this control:
- Add the control to a Windows Forms application
- Load commands using LoadCommands(string, string) or LoadCommands(StreamReader)
- Select a document using SelectDocument(object)
- Optionally customize appearance using the various properties
Constructors
- vdCommandLine()
Main constructor of the vdCommandLine.
Properties
- CommandLineHeight
Get the Height of the CommandLine without the History panel.
- EnablePopupForm
Get/Set a boolean value representing if the popup form will be shown.
- MaxNumberOfCommandsShown
Get/Set an integer value that represents the number of commands shown to the popup form. This value must be a positive number greater than 2.
- PopupBackColor
Get/Set the color used as background to the popup form.
- PopupFormCenterText
Get/Set a boolean value that represents if the orientation of the texts of the commands will be Centered or Left. Default value is false.
- PopupFormFont
Get/Set the font used to display the commands to the popup form.
- PopupFormIconSize
Represents the size of the icons of the popup form. Default size is 24;
- PopupFormShowBelow
Represents a boolean value that if true shows the popup form below the commandLine, usefull when the commandline is in the upper section of the application.
- PopupFormShowIcons
Get/Set a boolean value that represents if icons are going to be displayed while veing the commands to the popup form.
- PopupFormWidth
Get/Set an integer value that represents the width of the popup form.If the value is less than 1 then the form calculates the value so all commands are shown.
- PopuphighlightColor
Get/Set the color used as highlight color of the popup form.
- ProcessKeyMessages
Get/Set a boolean value that controls if the key messages from the VectorDraw control will be also process by this control.
- ShowPopupFormPerigram
Get/Set a boolean value that represents if while showing the popup form the form will show it's perigram or only the list will be shown.
- UserTextString
Get/Set the command line text string.
Methods
- Dispose(bool)
Clean up any resources being used.
- ExecuteCommand(string)
This method executes the passed command if found in the commands.
- ExecuteCommandEx(string)
This method executes the passed command.
- GetSelectedDocument()
Returns the selected vdDocument object.
- LoadCommands(StreamReader)
Load all commands from an existing System.IO.StreamReader stream.
- LoadCommands(string, string)
Load all commands from a existing ASCII formated filename (ex. Commands.txt)
- MergeCommands(StreamReader)
Merge commands from an existing System.IO.StreamReader stream with the already loaded commands. If a command with the same name exist in both, the existing one will be used.
- MergeCommands(string, string)
Merge commands from a existing ASCII formated filename (ex. Commands.txt) with the already loaded commands. If a command with the same name exist in both, the existing one will be used.
- OnLostFocus(EventArgs)
Fires when the control losses Focus.
- OnResize(EventArgs)
Raises the System.Windows.Forms.Control.Resize event.
- PostExecuteCommand(string)
This ExecuteCommand Posts the Execution of the command as aoon as the Message que of the application is ready to translate the message.
- ProcessCmdKey(ref Message, Keys)
Processes a command key.
- ProcessKeyDownMessage(int)
Send a key code to the user text box.
- ReloadCommands()
Called in order to reload the commands in case the selected reources files changed
- SelectDocument(object)
Select a new vdDocument object.
- SendKeyPress(KeyPressEventArgs)
Send a key character to UserText control
- SetPopupFormFont(string, float, int)
A method to set the PopupFormFont font.
- UnLoadCommands()
UnLoad all commands previous loaded from LoadCommands(string, string) method or LoadCommands(StreamReader)
- WndProc(ref Message)
Processes Windows messages.
- vdProcessKeyMessage(ref Message)
Send a keyboard message to the user text box.
Events
- CommandExecute
Fires before a command execute.
- UserTextEnterPressed
Fires when the user press the enter in commandline user text control.