private void ir_Code(object sender, IRCodeEventArgs e) { Dispatcher.Invoke(DispatcherPriority.Normal, (Action)(() => { CanSave = true; Code = new MayhemIRCode(e.Code); })); }
void ir_Code(object sender, IRCodeEventArgs e) { codeTxt.Text = "0x" + e.Code; bitLengthTextBox.Text = e.Code.BitCount.ToString(); repeatCount++; if (!e.Repeat) { repeatCount = 0; } repeatCountTextBox.Text = repeatCount.ToString(); }
// When we receive a code private void ir_Code(object sender, IRCodeEventArgs e) { if (code == null) { ErrorLog.AddError(ErrorType.Failure, "No code is set, please reconfigure"); return; } // If the data matches, // Do we care about the number of times it was repeated? if (code.Data.SequenceEqual(e.Code.Data)) { // We need to make a timeout for the IR TimeSpan diff = DateTime.Now - lastSignal; if (diff.TotalMilliseconds >= 750) { // then trigger Trigger(); } lastSignal = DateTime.Now; } }
void ir_Code(object sender, IRCodeEventArgs e) { codeTxt.Text = "0x"+e.Code; bitLengthTextBox.Text = e.Code.BitCount.ToString(); repeatCount++; if (!e.Repeat) repeatCount = 0; repeatCountTextBox.Text = repeatCount.ToString(); }
private void ir_Code(object sender, IRCodeEventArgs e) { Logger.WriteLine("Code"); }