private void unlinkAccountResponse_Callback(JObject obj) { if (obj == null || HikeConstants.FAIL == (string)obj[HikeConstants.STAT]) { Debug.WriteLine("Unlink Account", "Could not unlink account !!"); Deployment.Current.Dispatcher.BeginInvoke(() => { MessageBoxResult result = MessageBox.Show(AppResources.Privacy_UnlinkErrMsgBxText, AppResources.Privacy_UnlinkErrMsgBxCaptn, MessageBoxButton.OKCancel); progress.Hide(LayoutRoot); progress = null; canGoBack = true; }); return; } DeleteLocalStorage(); }
private void Delete_Tap(object sender, System.Windows.Input.GestureEventArgs e) { MessageBoxResult result = MessageBox.Show(AppResources.Privacy_DeleteAccounConfirmMsgBxText, AppResources.Privacy_DeleteAccountHeader, MessageBoxButton.OKCancel); if (result == MessageBoxResult.Cancel) { return; } if (progress == null) { progress = new ProgressIndicatorControl(); } progress.Show(LayoutRoot, AppResources.Privacy_DeleteAccountProgress); canGoBack = false; AccountUtils.deleteAccount(new AccountUtils.postResponseFunction(deleteAccountResponse_Callback)); }
private void deleteAccountResponse_Callback(JObject obj) { if (obj == null || HikeConstants.FAIL == (string)obj[HikeConstants.STAT]) { Debug.WriteLine("Delete Account", "Could not delete account !!"); Deployment.Current.Dispatcher.BeginInvoke(() => { MessageBoxResult result = MessageBox.Show("hike couldn't delete your account. Please try again.", "Account not deleted", MessageBoxButton.OKCancel); progress.Hide(LayoutRoot); progress = null; canGoBack = true; }); return; } DeleteLocalStorage(); }
private void DeleteLocalStorage() { NetworkManager.turnOffNetworkManager = true; App.MqttManagerInstance.disconnectFromBroker(false); App.ClearAppSettings(); App.WriteToIsoStorageSettings(App.IS_DB_CREATED, true); MiscDBUtil.clearDatabase(); HttpNotificationChannel pushChannel = HttpNotificationChannel.Find(HikeConstants.pushNotificationChannelName); if (pushChannel != null) { if (pushChannel.IsShellTileBound) { pushChannel.UnbindToShellTile(); } if (pushChannel.IsShellToastBound) { pushChannel.UnbindToShellToast(); } pushChannel.Close(); } Deployment.Current.Dispatcher.BeginInvoke(() => { App.ViewModel.ClearViewModel(); try { progress.Hide(LayoutRoot); progress = null; } catch { } try { NavigationService.Navigate(new Uri("/View/WelcomePage.xaml", UriKind.Relative)); } catch { } }); }
private void refreshContacts_Click(object sender, EventArgs e) { App.AnalyticsInstance.addEvent(Analytics.REFRESH_CONTACTS); if (!NetworkInterface.GetIsNetworkAvailable()) { MessageBoxResult result = MessageBox.Show(AppResources.Please_Try_Again_Txt, AppResources.No_Network_Txt, MessageBoxButton.OK); return; } disableAppBar(); if (progressIndicator == null) { progressIndicator = new ProgressIndicatorControl(); } progressIndicator.Show(LayoutRoot, AppResources.SelectUser_RefreshWaitMsg_Txt); canGoBack = false; ContactUtils.getContacts(new ContactUtils.contacts_Callback(makePatchRequest_Callback)); }