Пример #1
0
        public void JustUtil()
        {
            var st = new StockTicker();

            var gf = new GoogleMonitor();
            var mf = new MicrosoftMonitor();

            using (st.Subscribe(gf))
                using (st.Subscribe(mf))
                    foreach (var s in SampleData.GetNext())
                    {
                        st.Stock = s;
                    }
        }
Пример #2
0
        public static void MainED(string[] args)
        {
            // Monitor a stock ticker, when particular events occur, react
            StockTicker st = new StockTicker();

            // Create New observers to listen to the stock ticker
            GoogleMonitor    gf = new GoogleMonitor(st);
            MicrosoftMonitor mf = new MicrosoftMonitor(st);

            // Load the Sample Stock Data
            foreach (var s in SampleData.getNext())
            {
                st.Stock = s;
            }
        }
Пример #3
0
        public static void RunDemo()
        {
            StockTicker stockTicker = new StockTicker();

            //// ReSharper disable UnusedVariable

            GoogleMonitor    googleMonitor    = new GoogleMonitor(stockTicker);
            MicrosoftMonitor microsoftMonitor = new MicrosoftMonitor(stockTicker);

            //// ReSharper restore UnusedVariable

            foreach (var stock in SampleData.GetNext())
            {
                stockTicker.Stock = stock;
            }
        }
Пример #4
0
        static void Main(string[] args)
        {
            StockTicker st = new StockTicker();

            GoogleMonitor gf = new GoogleMonitor();
            MicrosoftMonitor mf = new MicrosoftMonitor();

            using (st.Subscribe(gf))
            using (st.Subscribe(mf))
            {
                foreach (var s in SampleData.getNext())
                {
                    st.Stock = s;
                }
            }
        }
Пример #5
0
        public static void Main(string[] args)
        {
            var st = new StockTicker();

            var gf = new GoogleMonitor();
            var mf = new MicrosoftMonitor();

            using (st.Subscribe(gf))
                using (st.Subscribe(mf))
                {
                    foreach (var s in SampleData.getNext())
                    {
                        st.Stock = s;
                    }
                }
        }
        public static void Run()
        {
            // Monitor a stock ticker, when particular events occur, react
            var st = new StockTicker();

            var gf = new GoogleMonitor();
            var mf = new MicrosoftMonitor();

            using (st.Subscribe(gf))
                using (st.Subscribe(mf))
                {
                    // Load the Sample Stock Data
                    foreach (var s in SampleData.getNext())
                    {
                        st.Stock = s;
                    }
                }
        }
Пример #7
0
        public static void RunDemo()
        {
            StockTicker stockTicker = new StockTicker();

            GoogleMonitor googleMonitor = new GoogleMonitor();
            MicrosoftMonitor microsoftMonitor = new MicrosoftMonitor();

            using (stockTicker.Subscribe(googleMonitor))
            {
                using (stockTicker.Subscribe(microsoftMonitor))
                {
                    foreach (var stock in SampleData.GetNext())
                    {
                        stockTicker.Stock = stock;
                    }
                }
            }
        }
        public static void RunDemo()
        {
            StockTicker stockTicker = new StockTicker();

            GoogleMonitor    googleMonitor    = new GoogleMonitor();
            MicrosoftMonitor microsoftMonitor = new MicrosoftMonitor();

            using (stockTicker.Subscribe(googleMonitor))
            {
                using (stockTicker.Subscribe(microsoftMonitor))
                {
                    foreach (var stock in SampleData.GetNext())
                    {
                        stockTicker.Stock = stock;
                    }
                }
            }
        }
Пример #9
0
        static void Main(string[] args)
        {
            //EventKeyWord();

            //TraditionalObserver();

            // Monitor a stock ticker, when particular events occur, react
            var st = new IObserver.StockTicker();

            GoogleMonitor    gf = new GoogleMonitor();
            MicrosoftMonitor mf = new MicrosoftMonitor();

            using (st.Subscribe(gf))
                using (st.Subscribe(mf))
                {
                    // Load the Sample Stock Data
                    foreach (var s in SampleData.getNext())
                    {
                        st.Stock = s;
                    }
                }
        }