public Shell(MainWindow container) : base() { this.container = container; WrapMode = WrapMode.Word; CreateTags (); Pango.FontDescription font_description = new Pango.FontDescription(); font_description.Family = "Monospace"; ModifyFont(font_description); TextIter end = Buffer.EndIter; Buffer.InsertWithTagsByName (ref end, "Mono C# Shell, type 'help;' for help\n\nEnter statements or expressions below.\n", "Comment"); ShowPrompt (false); Evaluator.Init (new string [0]); Evaluator.SetInteractiveBaseClass (typeof (InteractiveGraphicsBase)); Evaluator.Run ("LoadAssembly (\"System.Drawing\");"); Evaluator.Run ("using System; using System.Linq; using System.Collections; using System.Collections.Generic; using System.Drawing;"); if (!MainClass.Debug){ GuiStream error_stream = new GuiStream ("Error", (x, y) => Output (x, y)); StreamWriter gui_output = new StreamWriter (error_stream); gui_output.AutoFlush = true; Console.SetError (gui_output); GuiStream stdout_stream = new GuiStream ("Stdout", (x, y) => Output (x, y)); gui_output = new StreamWriter (stdout_stream); gui_output.AutoFlush = true; Console.SetOut (gui_output); } }
public static void Start(string title, List<string> files) { if (!HostHasGtkRunning) Application.Init (); InteractiveGraphicsBase.RegisterTransformHandler (RenderBitmaps); MainWindow m = new MainWindow (); InteractiveGraphicsBase.MainWindow = m; InteractiveGraphicsBase.PaneContainer = m.PaneContainer; m.Title = title; m.LoadStartupFiles (); if (files != null) m.LoadFiles (files, false); m.ShowAll (); if (!HostHasGtkRunning){ try { GLib.ExceptionManager.UnhandledException += delegate (GLib.UnhandledExceptionArgs a) { ResetOutput (); Console.WriteLine ("Application terminating: " + a.ExceptionObject); }; Application.Run (); } catch (Exception e) { ResetOutput (); throw; } } }
public TypeView(MainWindow container) : base() { WrapMode = Gtk.WrapMode.None; CreateTags (); Pango.FontDescription font_description = new Pango.FontDescription(); font_description.Family = "Monospace"; ModifyFont(font_description); this.container = container; }