Ejemplo n.º 1
0
 public void Write(string value, int x = -1, int y = -1)
 {
     lock (this) {
         IOOperation = EIOOperation.Write;
         if (InvokeRequired)
         {
             InvokeEx((WriteDelegate)DoWrite, 1000, new object[] { value, x, y });
         }
         else
         {
             DoWrite(value, x, y);
         }
         IOOperation = EIOOperation.None;
     }
 }
Ejemplo n.º 2
0
 public string Read(bool readLine)
 {
     lock (this) {
         EnableInput(true);
         IOOperation = EIOOperation.Read; this.readLine = readLine; string value = "";
         ClearInputBuffer(); eventInput.WaitOne();
         object[] args = new object[] { value, readLine };
         if (InvokeRequired)
         {
             InvokeEx((ReadDelegate)DoRead, 1000, args); value = (string)args[0];
         }
         else
         {
             DoRead(out value, readLine);
         }
         //inputPosition = textBox.Text.Length; inputBuffer = "";
         ClearInputBuffer();
         IOOperation = EIOOperation.None;
         EnableInput(false);
         return(value);
     }
 }