public void processEnterName() { if (isCalled) { return; } isCalled = true; txtBxEnterName.IsReadOnly = false; Uri nextPage; string country_code = null; App.appSettings.TryGetValue <string>(App.COUNTRY_CODE_SETTING, out country_code); if (string.IsNullOrEmpty(country_code) || country_code == "+91") { App.appSettings[App.SHOW_FREE_SMS_SETTING] = true; } else { App.appSettings[App.SHOW_FREE_SMS_SETTING] = false; } nextPage = new Uri("/View/WelcomeScreen.xaml", UriKind.Relative); nameErrorTxt.Visibility = Visibility.Collapsed; msgTxtBlk.Text = AppResources.EnterName_Msg_TxtBlk; Thread.Sleep(1 * 500); try { if (_avatar != null) { MiscDBUtil.saveAvatarImage(HikeConstants.MY_PROFILE_PIC, _avatar, false); } App.appSettings[HikeConstants.IS_NEW_INSTALLATION] = true; App.appSettings[App.SHOW_FAVORITES_TUTORIAL] = true; App.WriteToIsoStorageSettings(App.SHOW_NUDGE_TUTORIAL, true); NavigationService.Navigate(nextPage); progressBar.Opacity = 0; progressBar.IsEnabled = false; } catch (Exception e) { Debug.WriteLine("Exception handled in page EnterName Screen : " + e.StackTrace); } }
public void updateProfile_Callback(JObject obj) { Deployment.Current.Dispatcher.BeginInvoke(() => { if (obj != null && HikeConstants.OK == (string)obj[HikeConstants.STAT]) { avatarImage.Source = profileImage; avatarImage.MaxHeight = 83; avatarImage.MaxWidth = 83; MiscDBUtil.saveAvatarImage(HikeConstants.MY_PROFILE_PIC, _avatar, false); } else { MessageBox.Show(AppResources.Cannot_Change_Img_Error_Txt, AppResources.Something_Wrong_Txt, MessageBoxButton.OK); } //progressBarTop.IsEnabled = false; shellProgress.IsVisible = false; }); }
public void getProfilePic_Callback(byte[] fullBytes, object fName) { string fileName = fName as string; if (fullBytes != null && fullBytes.Length > 0) { MiscDBUtil.saveAvatarImage(fileName, fullBytes, false); } Deployment.Current.Dispatcher.BeginInvoke(() => { loadingProgress.Opacity = 0; if (fullBytes != null && fullBytes.Length > 0) { this.FileImage.Source = UI_Utils.Instance.createImageFromBytes(fullBytes); } else { byte[] smallThumbnailImage = MiscDBUtil.getThumbNailForMsisdn(msisdn); if (smallThumbnailImage != null && smallThumbnailImage.Length > 0) { this.FileImage.Source = UI_Utils.Instance.createImageFromBytes(smallThumbnailImage); } else { BitmapImage defaultImage = null; if (Utils.isGroupConversation(msisdn)) { defaultImage = UI_Utils.Instance.getDefaultGroupAvatar(msisdn); } else { defaultImage = UI_Utils.Instance.getDefaultAvatar(msisdn); } this.FileImage.Source = defaultImage; } } }); }