Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void WriteOutput(string format,params object[] args) {
- WriteOutput(string.Format(format,args));
- }
- /// <summary>
- /// Writes output to a windows form using InvokeRequired property
- /// </summary>
- /// <param name="value">Data to output</param>
- void WriteOutput(object value) {
- string text = value == null ? string.Empty : value.ToString();
- text += Environment.NewLine;
- Action<string> writeAction = (s) => richTextBox1.AppendText(s);
- if(InvokeRequired)
- BeginInvoke(new Action<string>(writeAction),text);
- else
- writeAction(text);
- }
Advertisement
Add Comment
Please, Sign In to add comment