示例#1
0
 private int GetOutputLinesCount()
 {
     if (OutputTextBox.InvokeRequired)
     {
         GetOutputLinesCountCallback d = new GetOutputLinesCountCallback(GetOutputLinesCount);
         IAsyncResult result           = OutputTextBox.BeginInvoke(d, new object[] { });
         result.AsyncWaitHandle.WaitOne();
         int returnValue = (int)this.EndInvoke(result);
         result.AsyncWaitHandle.Close();
         return(returnValue);
     }
     else
     {
         return(OutputTextBox.Lines.Length);
     }
 }
示例#2
0
 private int GetOutputLinesCount()
 {
     if (OutputTextBox.InvokeRequired)
     {
         GetOutputLinesCountCallback d = new GetOutputLinesCountCallback(GetOutputLinesCount);
         IAsyncResult result = OutputTextBox.BeginInvoke(d, new object[] { });
         result.AsyncWaitHandle.WaitOne();
         int returnValue = (int)this.EndInvoke(result);
         result.AsyncWaitHandle.Close();
         return returnValue;
     }
     else
     {
         return OutputTextBox.Lines.Length;
     }
 }