示例#1
0
        public void Test()
        {
            var provider = new EventDataProvider();

            var observer = new EventDataObserver(provider);

            provider.Next(2);
            provider.Next(10);
        }
示例#2
0
 public EventDataObserver(EventDataProvider provider)
 {
     _provider          = provider;
     _provider.NewData += (object sender, int e) =>
     {
         Trace.WriteLine($"Received new data: {e}");
     };
     //_provider.NewData += (int e) => Trace.WriteLine($"Received new data: {e}");
 }