예제 #1
0
        public IActionResult Report()
        {
            var mango  = _repository.GetProduct(new Guid("09C2599E-652A-4807-A0F8-390A146F459B"));
            var apple  = _repository.GetProduct(new Guid("7AF8C5C2-FA98-42A0-B4E0-6D6A22FC3D52"));
            var orange = _repository.GetProduct(new Guid("E2A8D6B3-A1F9-46DD-90BD-7F797E5C3986"));
            var model  = new List <MessageViewModel>();
            //provider
            var productProvider = new ProductRecorder();
            //observer1
            var productObserver1 = new ProductReporter(nameof(mango));
            //observer2
            var productObserver2 = new ProductReporter(nameof(apple));
            //observer3
            var productObserver3 = new ProductReporter(nameof(orange));

            //subssribe
            productObserver1.Subscribe(productProvider);
            productObserver2.Subscribe(productProvider);
            productObserver3.Subscribe(productProvider);

            //Report and Unsubscribe
            productProvider.Record(mango);
            model.AddRange(productObserver1.Reporter);
            productObserver1.Unsubscribe();
            productProvider.Record(apple);
            model.AddRange(productObserver2.Reporter);
            productObserver2.Unsubscribe();
            productProvider.Record(orange);
            model.AddRange(productObserver3.Reporter);
            productObserver3.Unsubscribe();

            return(View(model));
        }
예제 #2
0
 /// <summary>
 /// REturns the report for that particluar product type.
 /// </summary>
 /// <returns></returns>
 public override object[,] DoXLReport(InstrumentControllerBase instrument)
 {
     return(ProductReporter.DoXLReport(instrument));
 }
예제 #3
0
 /// <summary>
 /// REturns the report for that particluar product type.
 /// </summary>
 /// <param name="product">The product.</param>
 /// <param name="properties">The properties.</param>
 /// <returns></returns>
 public override object[,] DoReport(Product product, NamedValueSet properties)
 {
     return(ProductReporter.DoReport(product, properties));
 }
예제 #4
0
 /// <summary>
 /// REturns the report for that particluar product type.
 /// </summary>
 /// <param name="instrument"></param>
 /// <returns></returns>
 public override List <object[]> DoExpectedCashflowReport(InstrumentControllerBase instrument)
 {
     return(ProductReporter.DoExpectedCashflowReport(instrument));
 }