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); } }
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; } }