コード例 #1
0
 /// <summary>
 /// Raises <see cref="ModeSMessageReceived"/>.
 /// </summary>
 /// <param name="args"></param>
 private void OnModeSMessageReceived(ModeSMessageEventArgs args)
 {
     if (ModeSMessageReceived != null)
     {
         ModeSMessageReceived(this, args);
     }
 }
コード例 #2
0
ファイル: ListenerWrapper.cs プロジェクト: vishalishere/vrs
 /// <summary>
 /// Passes through events from the original <see cref="ModeSMessageReceived"/>.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void Original_ModeSMessageReceived(object sender, ModeSMessageEventArgs args)
 {
     args = Filter.FilterEvent(args);
     if (args != null)
     {
         OnModeSMessageReceived(args);
     }
 }
コード例 #3
0
        public void ModeSMessageEventArgs_Constructor_Initialises_To_Known_State()
        {
            var dateTimeNow = DateTime.UtcNow;
            var message     = new ModeSMessage();
            var adsbMessage = new AdsbMessage(message);
            var eventArgs   = new ModeSMessageEventArgs(dateTimeNow, message, adsbMessage);

            Assert.AreEqual(dateTimeNow, eventArgs.ReceivedUtc);
            Assert.AreSame(message, eventArgs.ModeSMessage);
            Assert.AreSame(adsbMessage, eventArgs.AdsbMessage);
        }
コード例 #4
0
        /// <summary>
        /// Returns the event args passed in, possibly altered, or null if the event must not be passed on.
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public static ModeSMessageEventArgs FilterEvent(ModeSMessageEventArgs args)
        {
            var result = args;

            if (args != null && args.ModeSMessage != null)
            {
                if (_ParsedConfiguration.IsIcaoProhibited(args.ModeSMessage.Icao24))
                {
                    result = null;
                }
                else if (args.ModeSMessage.IsMlat && _ParsedConfiguration.IsMlatProhibited())
                {
                    result = null;
                }
            }

            return(result);
        }
コード例 #5
0
ファイル: Listener.cs プロジェクト: ts295983632/vrs
 /// <summary>
 /// Raises <see cref="ModeSMessageReceived"/>.
 /// </summary>
 /// <param name="args"></param>
 private void OnModeSMessageReceived(ModeSMessageEventArgs args)
 {
     EventHelper.RaiseQuickly(ModeSMessageReceived, this, args);
 }