Example #1
0
        private void CopyMessage_Click(object sender, EventArgs e)
        {
            MessageTicker.Stop();
            RefreshMessage.Enabled = false;
            CopyMessage.Enabled    = false;

            Clipboard.SetText(MessageDisplayTb.Text);
            PromptUser.Visible = true;
            PromptUser.Text    = "Copied\r\nšŸ’¾";

            Timer timer = new Timer
            {
                Interval = 1500
            };

            timer.Tick += (s, ee) =>
            {
                PromptUser.Visible = false;
                PromptUser.Text    = string.Empty;
                timer.Stop();
                MessageTicker.Start();
                RefreshMessage.Enabled = true;
                CopyMessage.Enabled    = true;
            };

            timer.Start();
        }
Example #2
0
        internal void TriggerDelayedRefresh()
        {
            MessageTicker.Stop();
            RefreshMessage.Enabled = false;
            CopyMessage.Enabled    = false;
            PromptUser.Visible     = true;
            int    i       = 0;
            string loading = "Loading\r\n";
            Timer  timer   = new Timer
            {
                Interval = 375
            };

            timer.Tick += (s, ee) =>
            {
                if (i % 2 == 0)
                {
                    PromptUser.Text = $"{loading}ā³";
                }
                else
                {
                    PromptUser.Text = $"{loading}āŒ›";
                }

                if (i == 7)
                {
                    PromptUser.Visible = false;
                    PromptUser.Text    = string.Empty;
                    RefreshMessageDisplay();
                    timer.Stop();
                    MessageTicker.Start();
                    RefreshMessage.Enabled = true;
                    CopyMessage.Enabled    = true;
                }

                i++;
            };

            _delay.SetDelay(30, new DateAndTime(TimeAndDateUtility.GetCurrentDate(), TimeAndDateUtility.GetCurrentTime()));
            timer.Start();
        }