예제 #1
0
 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++;
     }
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
        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);
            }
        }
예제 #5
0
        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());
            }
        }
예제 #6
0
        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);
            }
        }