private void loginAndInit() { bool isLoginSucceeded = false; string accessToken = null; try { isLoginSucceeded = FBAgent.LoginAndInit(out accessToken); if (isLoginSucceeded) { isLoginSucceeded = true; UIRunner.HideCurrentForm(); UIRunner.OpenForm <MainForm>(); setRememberMeChoise(accessToken); } else { throw new Exception(); } } catch (Exception ex) { MessageBox.Show("Something occur, please try again!"); } }
internal void RunUI() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); AppSettings.LoadFile(); if (!AppSettings.Instance.RememberUser || string.IsNullOrEmpty(AppSettings.Instance.LastAccessToken)) { CurrentForm = new LoginForm(); } else { LoginResult result = FBAgent.Connect(AppSettings.Instance.LastAccessToken); CurrentForm = new MainForm(); } CurrentForm.ShowDialog(); AppSettings.Instance.SaveToFile(); }
private void fetchSelcetedAlbum(string i_AlbumName) { int position = topCover.Bottom + 100; int numOfFetchedPhoto = 0; FacebookObjectCollection <Photo> wallPictures = FBAgent.GetAlbumPhotosByName(i_AlbumName); foreach (Photo photo in wallPictures) { WallPhoto photoComponent = new WallPhoto(photo); photoComponent.Top = position; position = photoComponent.Bottom + 30; photoComponent.Left = (this.Width) / 2 - (photoComponent.Width / 2); this.Controls.Add(photoComponent); m_CurrentPhotoOnWall.Add(photoComponent); //Show the first k_NumberOfPhotosOnWall images if (++numOfFetchedPhoto >= k_NumberOfPhotosOnWall) { break; } } }