Esempio n. 1
0
        public static void Run()
        {
            var           dataSource  = new DataSourcePull();
            IObserverPull spreadsheet = new SpreadsheetPull(dataSource);
            IObserverPull piechart    = new PieChartPull(dataSource);

            dataSource.AddObserver(spreadsheet);
            dataSource.AddObserver(piechart);

            dataSource.Display();
            dataSource.Data = 12;
            dataSource.RemoveObserver(piechart);
            dataSource.Data = 13;
        }
Esempio n. 2
0
 internal SpreadsheetPull(DataSourcePull dataSource)
 {
     this.dataSource = dataSource;
 }
Esempio n. 3
0
 internal PieChartPull(DataSourcePull dataSource)
 {
     this.dataSource = dataSource;
 }