Пример #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;
        }
Пример #2
0
 internal SpreadsheetPull(DataSourcePull dataSource)
 {
     this.dataSource = dataSource;
 }
Пример #3
0
 internal PieChartPull(DataSourcePull dataSource)
 {
     this.dataSource = dataSource;
 }