コード例 #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);
        }
コード例 #2
0
        // 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
ファイル: ConsoleUtil.cs プロジェクト: JonasUJ/czip
 private static void RaiseWarningEvent(WarningEventArgs e)
 {
     WarningEvent?.Invoke(typeof(ConsoleUtil), e);
 }
コード例 #4
0
 protected virtual void Notify(WarningEventArgs e)
 {
     WarningEvent?.Invoke(this, e);
 }