示例#1
0
 public static void Main(string[] args) {
     GuiConsoleForm form = new GuiConsoleForm(caption,prompt,new StringHandler(ProcessLine));
     GuiConsole console = new GuiConsole(form);
     Interpreter.Console = console;
     console.Write(caption+"\n"+prompt);        
     interp = new Interpreter();
     string defs = args.Length > 0 ? args[0] : interp.DefaultIncludeFile();
     interp.ReadIncludeFile(defs);        
     interp.SetValue("form",form);
     interp.SetValue("text",form.TextBox);
     Application.Run(form);
 }   
示例#2
0
    public static void Main(string[] args)
    {
        GuiConsoleForm form    = new GuiConsoleForm(caption, prompt, new StringHandler(ProcessLine));
        GuiConsole     console = new GuiConsole(form);

        Interpreter.Console = console;
        console.Write(caption + "\n" + prompt);
        interp = new Interpreter();
        string defs = args.Length > 0 ? args[0] : interp.DefaultIncludeFile();

        interp.ReadIncludeFile(defs);
        interp.SetValue("form", form);
        interp.SetValue("text", form.TextBox);
        Application.Run(form);
    }
示例#3
0
    // execute the selection line.  If substitute is true, replace selection with $VV
    public void ExecuteSelectionLine(bool substitute)
    {
        int    lineNo = GetLineFromCharIndex(SelectionStart);
        string line   = Lines[lineNo];

        if (substitute && SelectionLength > 0)
        {
            int lineStartIndex = GetFirstCharIndexFromLine(lineNo);
            line = line.Substring(0, SelectionStart - lineStartIndex) + "$VV" + line.Substring(SelectionStart + SelectionLength - lineStartIndex);
            RunCsi.interp.SetValue("VV", float.Parse(SelectedText));
            Console.WriteLine(".>. " + line);
        }
        parent.quiet = true;
        RunCsi.interp.ProcessLine(GuiConsoleForm.CleanLine(line));
        // parent.DelayedExecute(line);
    }
示例#4
0
    public static Interpreter XMain(string[] args)
    {
        GuiConsoleForm form    = new GuiConsoleForm(caption, prompt, new StringHandler(ProcessLine));
        GuiConsole     console = new GuiConsole(form);

        console.Write(caption + "\n" + prompt);
        string defs = args.Length > 0 ? args[0] : "csigui.csi";

        Interpreter.Console = console;
        interp = new Interpreter();
        interp.ReadIncludeFile(defs);
        interp.SetValue("form", form);
        interp.SetValue("text", form.TextBox);
        form.Show();
        return(interp);
        // Application.Run(form);
    }
示例#5
0
 public GuiConsole(GuiConsoleForm f)
 {
     form = f;
 }
示例#6
0
 public ConsoleTextBox(GuiConsoleForm parent_)
 {
     parent   = parent_;
     KeyDown += XKeyDown;
 }
示例#7
0
文件: console.cs 项目: orb1t/cs-repl
 public ConsoleTextBox(GuiConsoleForm parent_)
 {
     parent = parent_;
 }
示例#8
0
 public ConsoleTextBox(GuiConsoleForm parent_) {
     parent = parent_;
 }        
示例#9
0
 public GuiConsole(GuiConsoleForm f)
 {
     form = f;
 }