private void ir_Code(object sender, IRCodeEventArgs e)
 {
     Dispatcher.Invoke(DispatcherPriority.Normal, (Action)(() =>
     {
         CanSave = true;
         Code = new MayhemIRCode(e.Code);
     }));
 }
Пример #2
0
        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();
        }
Пример #3
0
        // 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;
            }
        }
Пример #4
0
        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();
        }
Пример #5
0
 private void ir_Code(object sender, IRCodeEventArgs e)
 {
     Logger.WriteLine("Code");
 }