コード例 #1
0
ファイル: TZClock.cs プロジェクト: zkg642/JXXZ
        private void Request()
        {
            try
            {
                System.Threading.Thread.Sleep(5000);

                this._messageTextBlock.Text       = REMOTE_TIME_INPROGRESS;
                this._messageTextBlock.Visibility = Visibility.Visible;

                WebAPIHelper webAPIHelper = new WebAPIHelper();

                webAPIHelper.GetDataCompleted += (s, args) =>
                {
                    this.CurrentDateTime         = (DateTime)args.DataResult;
                    _messageTextBlock.Visibility = Visibility.Collapsed;
                };

                webAPIHelper.GetData <DateTime>(this.RemoteUri);
            }
            catch (Exception)
            {
                _messageTextBlock.Text = REMOTE_TIME_FAILED;
            }
        }