示例#1
0
 private void Print(string text)
 {
     if (this.richTextBox1.InvokeRequired)
     {
         PrintCallback d = new PrintCallback(Print);
         this.Invoke(d, new object[] { text });
     }
     else
     {
         this.richTextBox1.AppendText(text);
     }
 }
示例#2
0
        public override PrintCallbackInfo RegisterPrintCallback(OutputLevel outputLevel,
                                                                PrintCallback callback, object data = null)
        {
            var info = new PrintCallbackInfo
            {
                OutputLevel = outputLevel,
                Callback    = callback,
                Data        = data
            };

            PrintCallbacks.Add(info);
            return(info);
        }
示例#3
0
 private void Print(string s)
 {
     if (this.logTextBox.InvokeRequired)
     {
         PrintCallback d = new PrintCallback(Print);
         this.Invoke(d, new object[] { s });
     }
     else
     {
         logTextBox.AppendText(s);
         logTextBox.AppendText("\r\n");
     }
 }
示例#4
0
        public LuaState()
        {
            myStatePtr = LuaDLL.luaL_newstate();
            LuaDLL.luaL_openlibs(myStatePtr);

            LuaDLL.lua_getglobal(myStatePtr, "_G");
            myGlobalTable = new LuaObject(this, -1);

            myPrintFuction = new LuaCSFunction(print);

            LuaDLL.lua_pushcclosure(myStatePtr, myPrintFuction, 0);
            LuaDLL.lua_setglobal(myStatePtr, "print");

            printCallback = new PrintCallback(defaultPrint);
        }
示例#5
0
 private void Print(String str)
 {
     if (IsDisposed)
     {
         Console.Write(str);
     }
     else
     {
         if (base.InvokeRequired)
         {
             PrintCallback d = new PrintCallback(Print);
             this.Invoke(d, new object[] { str });
         }
         else
         {
             base.AppendText(str);
         }
     }
 }
示例#6
0
 private extern static void RegisterPrintCallback(PrintCallback callback);
示例#7
0
 public abstract PrintCallbackInfo RegisterPrintCallback(OutputLevel outputLevel,
                                                         PrintCallback callback, object data = null);
示例#8
0
 static public void SetPrintCallback(PrintCallback cb)
 {
     _PrintCallback = cb;
 }