Пример #1
0
        public void Bind(Stock stock)
        {
            this.labelStockName.Text = stock.Name;
            this.labelHighLow.Text   = string.Format("{0}/{1}", stock.High, stock.Low);
            this.labelLast.Text      = stock.Last;

            if (this.stock == null)
            {
                this.switchMonitor.ValueChanged += async(sender, e) =>
                {
                    if (this.switchMonitor.On)
                    {
                        this.switchMonitor.Enabled = false;
                        this.activityUpdating.StartAnimating();

                        await StockViewModel.StockModel.RefreshOrAdd(this.stock.Symbol);

                        ////StockModel.
                        //try
                        //{
                        //    var s = await AppDelegate.StockClient.GetStockQuoteAsync(this.stock.Symbol);
                        //    this.labelLast.Text = s.Last;
                        //}
                        //catch{}

                        this.activityUpdating.StopAnimating();
                        this.switchMonitor.On      = false;
                        this.switchMonitor.Enabled = true;
                    }
                };
            }

            this.stock = stock;
        }
Пример #2
0
 private object[] OnEndGetStockQuote(System.IAsyncResult result)
 {
     SimplyMobile.Plugins.WcfStockService.StockQuote retVal = ((SimplyMobile.Plugins.WcfStockService.IStockQuoteService)(this)).EndGetStockQuote(result);
     return(new object[] {
         retVal
     });
 }
Пример #3
0
        public void Bind(Stock stock)
        {
            this.labelStockName.Text = stock.Name;
            this.labelHighLow.Text = string.Format ("{0}/{1}", stock.High, stock.Low);
            this.labelLast.Text = stock.Last;

            if (this.stock == null)
            {
                this.switchMonitor.ValueChanged += async (sender, e) => 
                {
                    if (this.switchMonitor.On)
                    {
                        this.switchMonitor.Enabled = false;
                        this.activityUpdating.StartAnimating();

                        await StockViewModel.StockModel.RefreshOrAdd(this.stock.Symbol);
                        ////StockModel.
                        //try
                        //{
                        //    var s = await AppDelegate.StockClient.GetStockQuoteAsync(this.stock.Symbol);
                        //    this.labelLast.Text = s.Last;
                        //}
                        //catch{}

                        this.activityUpdating.StopAnimating();
                        this.switchMonitor.On = false;
                        this.switchMonitor.Enabled = true;
                    }
                };
            }

            this.stock = stock;
        }
Пример #4
0
 public SimplyMobile.Plugins.WcfStockService.StockQuote EndGetStockQuote(System.IAsyncResult result)
 {
     object[] _args = new object[0];
     SimplyMobile.Plugins.WcfStockService.StockQuote _result = ((SimplyMobile.Plugins.WcfStockService.StockQuote)(base.EndInvoke("GetStockQuote", _args, result)));
     return(_result);
 }