Пример #1
0
        /// <summary>
        /// Report a warning
        /// </summary>
        /// <param name="message">Warning message</param>
        protected void OnWarningEvent(string message)
        {
            if (WarningEvent == null && WriteToConsoleIfNoListener && !SkipConsoleWriteIfNoWarningListener)
            {
                ConsoleMsgUtils.ShowWarningCustom(message, EmptyLinesBeforeWarningMessages);
            }

            WarningEvent?.Invoke(message);
        }
        // Checks if there's a separation condition between two tracks
        public void CheckForCondition(Track t1, Track t2)
        {
            if (Math.Abs((t1.Altitude - t2.Altitude)) <= 300 &&
                (DistanceCalculator(t1, t2) <= 5000))
            {
                // Prepare arguments
                var args = new SepCondEventArgs();
                args.TimeOfOccurrence = DateTime.Now;
                args.Track1           = t1;
                args.Track2           = t2;

                AddToTrackList(t1, t2);
                _SepCondEventArgsList.Add(args);

                // Raise event for warnings
                WarningEvent?.Invoke(this, args);
            }
        }
Пример #3
0
 private static void RaiseWarningEvent(WarningEventArgs e)
 {
     WarningEvent?.Invoke(typeof(ConsoleUtil), e);
 }
Пример #4
0
 protected virtual void Notify(WarningEventArgs e)
 {
     WarningEvent?.Invoke(this, e);
 }