GuiConsoleForm.DelayedExecute C# (CSharp) Method

DelayedExecute() public method

public DelayedExecute ( string line ) : void
line string
return void
    public void DelayedExecute(string line) {
        currentLine = line;
        while (currentLine.IndexOf(prompt) == 0)
            currentLine = currentLine.Substring(prompt.Length);
        timer.Start();
    }   
     

Usage Example

コード例 #1
0
    private void XKeyDown(object sender, KeyEventArgs e)
    {
        string line = null;

        if (e.KeyCode == Keys.Enter)
        {
            if (SelectionLength == 0)
            {
                int lineNo = GetLineFromCharIndex(SelectionStart);
                if (lineNo < Lines.Length)
                {
                    line = Lines[lineNo];
                }
            }
            else
            {
                // line = SelectedText.Replace("\n>", " ");  // ?? this should be done where prompt is set and use prompt
                line = SelectedText;
            }

            if (line != null)
            {
                parent.DelayedExecute(line);
                if (SelectionStart != Text.Length)
                {
                    e.Handled = true;                                 // do not let Enter insert CR unless at very end
                }
            }
        }
    }
All Usage Examples Of GuiConsoleForm::DelayedExecute