예제 #1
0
        public void OnProductChanged(object sender, ProductChangeEventArgs product)
        {
            IEnumerable <IList <Client> > channels = _subscriptionList.Where(a => a.Key.GetType() == product.Part.GetType()).Select(a => a.Value);

            foreach (IList <Client> channel in channels)
            {
                foreach (Client client in channel)
                {
                    client.HandlePartUpdate(product);
                }
            }
        }
예제 #2
0
 public void HandlePartUpdate(ProductChangeEventArgs e)
 {
     Console.WriteLine($"I {NameOfClient} recieved an update for Part {e.Part.Name} for the price of {e.Part.Price}");
 }