Example #1
0
        public void ShowType(Type t)
        {
            Buffer.Clear ();

            current_tag = "default";

            GuiStream guistream = new GuiStream (null, (x,y) => {
                TextIter end = Buffer.EndIter;
                Buffer.InsertWithTagsByName (ref end, y, current_tag);
            });

            StreamWriter writer = new StreamWriter (guistream);
            Outline outliner = new Outline (t, writer, true, false, false);

            outliner.OutlineNotificationEvent += delegate (int kind, object value) {
                switch (kind){
                case 0:
                    current_tag = "default";
                    break;
                case 1:
                    current_tag = GetTypeTag ((Type) value);
                    break;
                }
            };
            outliner.OutlineType ();
            writer.Flush ();
        }
Example #2
0
		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);
			}
		}
Example #3
0
        public void ShowType(Type t)
        {
            Buffer.Clear();

            current_tag = "default";

            GuiStream guistream = new GuiStream(null, (x, y) => {
                TextIter end = Buffer.EndIter;
                Buffer.InsertWithTagsByName(ref end, y, current_tag);
            });

            StreamWriter writer   = new StreamWriter(guistream);
            Outline      outliner = new Outline(t, writer, true, false, false);

            outliner.OutlineNotificationEvent += delegate(int kind, object value) {
                switch (kind)
                {
                case 0:
                    current_tag = "default";
                    break;

                case 1:
                    current_tag = GetTypeTag((Type)value);
                    break;
                }
            };
            outliner.OutlineType();
            writer.Flush();
        }
Example #4
0
        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);


            context   = new CompilerContext(new CompilerSettings(), new ConsoleReportPrinter());
            evaluator = new Evaluator(context);
            evaluator.DescribeTypeExpressions = true;

            evaluator.InteractiveBaseClass = 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);
            }
        }