Beispiel #1
0
        public static API_ConsoleOut show_ConsoleOut(this API_ConsoleOut apiConsoleOut, Control topPanel)
        {
            var richTextBox = apiConsoleOut.RichTextBox = topPanel.add_RichTextBox().showSelection().wordWrap(false);
            var showData    = true;

            richTextBox.backColor(Color.Black)
            .foreColor(Color.White)
            .font("Lucida Console");
            apiConsoleOut.o2StreamWriter.On_NewChar = (_char) =>
            {
                if (showData)
                {
                    if (_char != '\x0d')
                    {
                        richTextBox.append_Text(_char.str());
                    }
                }
            };
            apiConsoleOut.o2StreamWriter.LogAllLines = false;

            richTextBox.add_ContextMenu()
            .add_MenuItem("Clear", true, () => richTextBox.set_Text(""))
            .add_MenuItem("Write to Console Input", true, () => Console.WriteLine("Text to send to Console.Input".askUser()))
            .add_MenuItem("'Show' / 'Don't Show' received data", true, () => showData = !showData);

            return(apiConsoleOut);
        }
Beispiel #2
0
        public static API_ConsoleOut show_ConsoleOut_TestGui(this API_ConsoleOut apiConsoleOut, Control topPanel)
        {
            var consoleIn     = topPanel.insert_Above(40, "ConsoleIn");
            var lines_TextBox = topPanel.clear().add_GroupBox("Console.Out Lines").add_TreeView();
            var chars_TextBox = topPanel.insert_Right("Console.Out Chars")
                                .add_RichTextBox()
                                .showSelection()
                                .wordWrap(false);

            consoleIn.add_TextBox("Write to send to Console Input ->", "")
            .onKeyPress_getChar((_char) => Console.Write(_char))
            .multiLine(true)
            .focus();

            apiConsoleOut.o2StreamWriter.On_NewChar = (_char) => { if (_char != '\x0a')
                                                                   {
                                                                       chars_TextBox.append_Text(_char.str());
                                                                   }
            };
            apiConsoleOut.o2StreamWriter.On_NewLine = (line) => lines_TextBox.add_Node(line);

            Console.WriteLine("Welcome to show_ConsoleOut_TestGui");
            Console.Write("Type something on the TextBox above to see it on the rigth".line());
            Console.WriteLine("Current Process: " + Processes.getCurrentProcess().Id);
            return(apiConsoleOut);
        }
Beispiel #3
0
        public static API_ConsoleOut show_ConsoleOut(this string message)
        {
            var apiConsoleOut = new API_ConsoleOut();

            apiConsoleOut.show_ConsoleOut();
            Console.WriteLine(message);
            return(apiConsoleOut);
        }
Beispiel #4
0
        public static API_ConsoleOut show_ConsoleOut <T> (this T topPanel, string message) where T : Control
        {
            var apiConsoleOut = new API_ConsoleOut();

            apiConsoleOut.show_ConsoleOut(topPanel);
            if (message.valid())
            {
                Console.WriteLine(message);
            }
            return(apiConsoleOut);
        }
Beispiel #5
0
 public static API_ConsoleOut    clear(this API_ConsoleOut apiConsoleOut, string message)
 {
     if (apiConsoleOut.RichTextBox.isNull())
     {
         "[API_ConsoleOut] in clean() richTextBox was not set".error();
     }
     else
     {
         apiConsoleOut.RichTextBox.set_Text("");
     }
     return(apiConsoleOut);
 }
Beispiel #6
0
        public static API_ConsoleOut show_ConsoleOut(this API_ConsoleOut apiConsoleOut)
        {
            var topPanel = O2Gui.open <Panel>("Console.Out", 700, 200);

            return(apiConsoleOut.show_ConsoleOut(topPanel));
        }
Beispiel #7
0
 public static API_ConsoleOut    writeLine(this API_ConsoleOut apiConsoleOut, string message)
 {
     Console.WriteLine(message);
     return(apiConsoleOut);
 }
Beispiel #8
0
 public static API_ConsoleOut    writeLine(this API_ConsoleOut apiConsoleOut)
 {
     return(apiConsoleOut.writeLine(""));
 }