Пример #1
0
 private void OnTogglHttpResponse (TogglHttpResponseMessage msg)
 {
     if (Handle == IntPtr.Zero)
         return;
     if (msg.StatusCode == System.Net.HttpStatusCode.Gone) {
         new ForcedUpgradeDialogFragment ().Show (FragmentManager, "upgrade_dialog");
     }
 }
Пример #2
0
        private void OnHttpResponse (TogglHttpResponseMessage msg)
        {
            if (msg.ServerTime == null || msg.Latency == null)
                return;

            var localTime = DateTime.UtcNow;
            var serverTime = msg.ServerTime.Value + TimeSpan.FromTicks (msg.Latency.Value.Ticks / 2);
            var correction = serverTime - localTime;

            AddMeasurement (new TimeCorrectionData () {
                MeasuredAt = serverTime,
                Correction = correction.Ticks,
            });
        }
Пример #3
0
 private void OnTogglHttpResponse (TogglHttpResponseMessage msg)
 {
     if (msg.StatusCode == System.Net.HttpStatusCode.Gone) {
         if (upgradeAlert == null) {
             upgradeAlert = new UIAlertView (
                 "MainUpdateNeededTitle".Tr (),
                 "MainUpdateNeededMessage".Tr (),
                 null, "MainUpdateNeededOk".Tr ());
             upgradeAlert.Clicked += (s, e) => UIApplication.SharedApplication.OpenUrl (new NSUrl (Build.AppStoreUrl));
         }
         upgradeAlert.Show ();
     }
 }