//void SetStacksNumber()
        //{
        //    Dispatcher.Invoke(() =>
        //    {
        //        if (Stacks > 1)
        //        {
        //            s.Visibility = Visibility.Visible;
        //            stacksnumber.Text = Stacks.ToString();
        //        }
        //        else
        //        {
        //            s.Visibility = Visibility.Hidden;
        //        }
        //    });
        //}
        private void PacketRouter_BuffUpdated(ulong target, Data.Abnormality ab, int duration, int stacks)
        {
            //SecondsTimer.Stop();

            Dispatcher.Invoke(() =>
            {
                if (target == TargetId)
                {
                    if (ab.Id == AbnormalityId)
                    {
                        Duration    = duration;
                        Stacks      = stacks;
                        CurrentTime = duration / 1000;
                        //number.Text = (duration / 1000).ToString();
                        //SetStacksNumber();
                        //InitTimer();
                        if (SecondsTimer != null)
                        {
                            SecondsTimer.Stop();
                            SecondsTimer.Enabled = true;
                        }
                        if (duration < 0)
                        {
                            //durationLabel.Visibility = Visibility.Hidden;
                            //number.Text = "-";
                            return;
                        }
                        arc.BeginAnimation(Arc.EndAngleProperty, new DoubleAnimation(0, 359.9, TimeSpan.FromMilliseconds(duration)));
                    }
                }
            });
        }
示例#2
0
        private void btnStop_Click(object sender, EventArgs e)
        {
            //closing the serialport but keeping the preferences!
            mySerialPort.Close();
            textToAdd = "--End-of-Log--";
            fileclose = true;
            txtlog();
            filecreated      = false;
            lblMessage.Text  = "Log Stopped";
            btnStop.Enabled  = false;
            btnStart.Enabled = true;
            logging          = false;

            SecondsTimer.Stop();
            timer         = 0;
            lblTimer.Text = Convert.ToString(timer);

            //enabling preferences
            btnSearchCom.Enabled = true;
            cbCom.Enabled        = true;
            cbBaudRate.Enabled   = true;
            btnLocation.Enabled  = true;
            tbFileName.Enabled   = true;
            tbLogID.Enabled      = true;
            cbTimer.Enabled      = true;
        }
示例#3
0
 public void Freeze()
 {
     lock (freezeLock)
     {
         Flashlight.UnInitCamera();
         SecondsTimer.Stop();
         MusicView.XNAFrameworkDispatcher.Stop();
     }
 }