예제 #1
0
        /// <summary>
        /// Called in order to change the text being displayed on the warning.
        /// </summary>
        private void Execute(object sender = null, EventArgs e = null)
        {
            // Increment the counter.
            counter++;

            // Make sure that that that index location exists.
            if (WarningList.Count <= counter)
            {
                counter = 0;
            }

            WarningMessage = WarningList.ElementAt(counter);
        }
예제 #2
0
        /// <summary>
        /// Removes the warning with the given text from the warning queue
        /// </summary>
        /// <param name="text">The texr warning to stop.</param>
        public void StopWarning(string text, bool fromRobot = false)
        {
            if (WarningList.Contains(text))
            {
                WarningList.Remove(text);
            }
            // If the warning had been dispatched from the robot, remove it.
            if (fromRobot && NtAddedWarnings.Contains(text))
            {
                NtAddedWarnings.Remove(text);
            }

            // If we have no text to show, stop executing
            if (WarningList.Count <= 0)
            {
                StopAnimation();
            }
            else if (WarningList.Count == 1)
            {
                StopExecuting();
                WarningMessage = WarningList.ElementAt(0);
            }
        }