public override void Interpret(ShellControl !shellControl, Interpretation !interp) { if (condition.BoolValue(interp)) { block.Interpret(shellControl, interp); } }
public static int Run(String script, ShellControl !shellControl, CommandLineRunner runner, String[] arguments) { ScriptEngine engine = new ScriptEngine(script, runner); try { engine.Parse(); } catch (Parser.ParseException e) { Console.WriteLine(e.Message); return(-1); } catch (Exception e) { Console.WriteLine(e.Message); return(-1); } try { return(engine.Run(shellControl, arguments)); } catch (Interpretation.InterpretationException e) { Console.WriteLine(e.Message); } catch (ScriptException e) { Console.WriteLine(e.Message); } catch (Exception e) { Console.WriteLine(e.Message); } return(-1); }
public MainForm() { InitializeComponent(); // Load everything LoadSerial(); LoadSymbols(); LoadVS(); // Load virtual machine VirtualMachine = new QemuVirtualMachine(Path.Combine(Bootstrap.Root, @"VMware\Disk.vmdk")); VirtualMachine.Started += VirtualMachine_Started; VirtualMachine.Stopped += VirtualMachine_Stopped; freshStart = !VirtualMachine.Running; // Add debugger console DebuggerConsole console = new DebuggerConsole(); ShellControl shellControl = new ShellControl(console); shellControl.Dock = DockStyle.Fill; shellControl.Padding = new Padding(2); ConsolePanel.Controls.Add(shellControl); }
public override void Interpret(ShellControl !shellControl, Interpretation !interp) { String[] arguments = new String[commandLine.Count]; int i = 0; //Console.WriteLine("Interpret Command"); foreach (Expression !e in commandLine) { string arg = e.StringValue(interp); //Console.WriteLine(" CMD[{0}]: {1}", i, arg); arguments[i++] = arg; } if (i != 0 && ((!)arguments[0]).Trim() == "exit") { if (arguments.Length >= 2) { try { int exitCode = Int32.Parse(arguments[1]); interp.ExitCode = exitCode; } catch (FormatException) { throw new Interpretation.TypeConversionException((String)arguments[1], "integer"); } } interp.Exit = true; }
private int Run(ShellControl !shellControl, String[] arguments) { Interpretation interp = new Interpretation(runner, arguments); parsedScript.Interpret(shellControl, interp); return(interp.ExitCode); }
public MainPage() { this.InitializeComponent(); this.TopContentTemplate = this.Resources["WideTopTemplate"] as DataTemplate; this.DataContext = this; SizeChanged += OnSizeChanged; ShellControl.ClearCommandBar(); }
public override void Interpret(ShellControl !shellControl, Interpretation !interp) { Object value = expression.GetValue(interp); if (interp != null) { interp.SetSymbol(variable, value); } }
Shell(string shellId, MdiChild shellWindow) { IsClosing = false; ShellId = shellId; ShellWindow = shellWindow; OpenWindowState = WindowState.Normal; MainControl = null; Interrupter = new InterruptSource(); }
public ShellScene() { shell = new ShellControl(); shell.Prompt = ">>>"; shell.ShellTextBackColor = System.Drawing.Color.Black; shell.ShellTextFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); shell.ShellTextForeColor = System.Drawing.Color.LimeGreen; shell.CommandEntered += new EventCommandEntered(shellControl_CommandEntered); }
public override void Interpret(ShellControl !shellControl, Interpretation !interp) { while (condition.BoolValue(interp)) { block.Interpret(shellControl, interp); if (interp.Exit) { break; } } }
public bool SetControl(ShellControl c) { if (c == null) { Close(); return(false); } MainControl = c; ShellWindow.Content = c; c.Init(); return(true); }
public override void Interpret(ShellControl !shellControl, Interpretation !interp) { foreach (Statement statement in statements) { if (statement != null) { statement.Interpret(shellControl, interp); } if (interp.Exit) { break; } } }
public void Close() { if (IsClosing) { return; } IsClosing = true; Interrupter.GenerateInterrupt(); Modules.CloseShell(ShellId); if (MainControl != null) { MainControl.Close(); MainControl = null; } RemoveShell(this); MainWindow.CloseChild(ShellWindow); MainWindow.UpdateStatus("Shell#" + ShellId, null); }
private async void OnKeyUp(object sender, KeyRoutedEventArgs e) { if (e.Key == Windows.System.VirtualKey.F11) { if (SupportFullScreen) { await ShellControl.TryEnterFullScreenAsync(); } } else if (e.Key == Windows.System.VirtualKey.Escape) { if (SupportFullScreen && ShellControl.IsFullScreen) { ShellControl.ExitFullScreen(); } else { NavigationService.GoBack(); } } }
public ShellPage() { InitializeComponent(); this.DataContext = this; ShellPage.Current = this; this.SizeChanged += OnSizeChanged; if (SystemNavigationManager.GetForCurrentView() != null) { SystemNavigationManager.GetForCurrentView().BackRequested += ((sender, e) => { if (SupportFullScreen && ShellControl.IsFullScreen) { e.Handled = true; ShellControl.ExitFullScreen(); } else if (NavigationService.CanGoBack()) { NavigationService.GoBack(); e.Handled = true; } }); NavigationService.Navigated += ((sender, e) => { if (NavigationService.CanGoBack()) { SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible; } else { SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed; } }); } }
public ControlWriter(ShellControl textbox) { this.textbox = textbox; }
public void HandleConsole(ShellControl shell, Command cmd) { }
public static void Init(ShellControl shell) { _shell = shell; }
public void HandleConsole(ShellControl shell, Command cmd) { switch (cmd.Name) { case "help": Shell.WriteLine("Here are some Commands"); foreach (var c in ConsolePage.Tools) { var spl = c.HelpText.Split('|'); foreach (var ht in spl) { Shell.WriteLine(ht); } } break; case "save": var sg = ServiceLocator.Get <SavedGame>("SavedGame"); sg.Save(); Shell.WriteLine("Successfully saved"); break; case "load": var sg2 = ServiceLocator.Add("SavedGame", SavedGame.Load()); ServiceLocator.CallEvent("Loaded", sg2); Shell.WriteLine("Successfully loaded"); break; case "echo": Shell.WriteLine(cmd.Args[0]); break; case "cls": Shell.Clear(); break; case "shutdown": Application.Exit(); break; case "info": Shell.WriteLine(ServiceLocator._("Name:") + " " + ServiceLocator.Get <SavedGame>("SavedGame").Computer.Name); Shell.WriteLine(ServiceLocator._("Language:") + " " + ServiceLocator.Get <SavedGame>("SavedGame").Locale); break; case "settings": switch (cmd.Args[0]) { case "language": var sg3 = ServiceLocator.Get <SavedGame>("SavedGame"); sg3.Locale = cmd.Args[1]; CultureInfo.CurrentUICulture = new CultureInfo(sg3.Locale); ServiceLocator.LoadLocale(); break; default: break; } break; } }
public static int Run(String script, ShellControl !shellControl, CommandLineRunner runner) { return(Run(script, shellControl, runner, null)); }
public abstract void Interpret(ShellControl !shellControl, Interpretation !interp);