예제 #1
0
        public void SpotPlane(JetFighter jetFighter)
        {
            try
            {
                if (string.Equals(jetFighter.Name, "UFO"))
                {
                    throw new Exception("UFO Found");
                }

                this.planeSpotted.OnNext(jetFighter);
            }
            catch (Exception exception)
            {
                this.planeSpotted.OnError(exception);
            }
        }
예제 #2
0
        private void OnPlaneSpotted(JetFighter jetFighter)
        {
            JetFighter spottedPlane = jetFighter;

            Console.WriteLine(spottedPlane.Name);
        }
예제 #3
0
 public void ISawThis(JetFighter jetFighter)
 {
     jetFighter.SpotPlane(jetFighter);
 }