public override void onMetronomeEvent(object sender, metronomeEventArgs e) { if (spinBox.InvokeRequired) { //Set call back setCallBack d = new setCallBack(onMetronomeEvent); //Let spinBox know what we want to do spinBox.Invoke(d, new object[] {sender,e}); } else { spinBox.Value++; } }
public void AddToLog(string line) { DateTime time = DateTime.Now; line = "[" + time.ToString("HH:mm:ss") + "] " + line + "\n"; if (this.InvokeRequired) { setCallBack d = new setCallBack(AddToLog); this.Invoke(d, new object[] { line }); } else { this.txtUpdateLog.AppendText(line); } }
public void AddToLog(string line, bool timestamp = true) { if (_loggingTxt.InvokeRequired) { setCallBack d = new setCallBack(AddToLog); _loggingTxt.Invoke(d, new object[] { line, timestamp }); } else { if (timestamp) { DateTime time = DateTime.Now; line = "[" + time.ToString("HH:mm:ss") + "] " + line + "\n"; } _loggingTxt.AppendText(line); } }
public void AddToLog(string line, bool timestamp=true) { if (_loggingTxt.InvokeRequired) { setCallBack d = new setCallBack(AddToLog); _loggingTxt.Invoke(d, new object[] { line, timestamp }); } else { if (timestamp) { DateTime time = DateTime.Now; line = "[" + time.ToString("HH:mm:ss") + "] " + line + "\n"; } _loggingTxt.AppendText(line); } }
public override void onMetronomeEvent(object sender, metronomeEventArgs e) { DateTime currDateTime = e.currentTime; if (listBox.InvokeRequired) { //Set call back setCallBack d = new setCallBack(onMetronomeEvent); listBox.Invoke(d, new object[] { sender, e }); } else { listBox.Items.Add(currDateTime.ToString()); } }
public void AddToLog(string line) { DateTime time = DateTime.Now; line = "["+time.ToString("HH:mm:ss")+"] "+line+"\n"; if (this.InvokeRequired) { setCallBack d = new setCallBack(AddToLog); this.Invoke(d, new object[] { line }); } else { this.txtUpdateLog.AppendText(line); } }