public void GetFriends() { SocialAccount account = SettingHelper.GetKeyValue <SocialAccount>("SocialAccount"); Uri uri = new Uri(String.Format(EndpointHelper.USER_GET_FRIENDS, account.access_token)); ConstructRequest(uri, "GET", null, "get_friends"); }
private void OnRegisterClicked(object sender, System.Windows.Input.GestureEventArgs e) { if (TextBoxEmail.Text.Length == 0) { //Not valid } else { SocialAccount account = SettingHelper.GetKeyValue <SocialAccount>("SocialAccount"); authHelper.Register(account.user_name, TextBoxEmail.Text, account.social_id); } }
private void btnAll_Copy_Click(object sender, RoutedEventArgs e) { PhoneApplicationService.Current.State["SelectedObject"] = vm.NearestSpaceObject; User user = SettingHelper.GetKeyValue <User>("User"); if (user != null) { NavigationService.Navigate(new Uri("/View/CreateEventPage.xaml", UriKind.Relative)); } else { NavigationService.Navigate(new Uri("/View/LoginPage.xaml?page=create_event", UriKind.Relative)); } }
private void OnRecordTapped(object sender, System.Windows.Input.GestureEventArgs e) { PhoneApplicationService.Current.State["CurrentSpaceObject"] = vm.spaceObject; User user = SettingHelper.GetKeyValue <User>("User"); if (user != null) { NavigationService.Navigate(new Uri("/View/Camera.xaml", UriKind.Relative)); } else { NavigationService.Navigate(new Uri("/View/LoginPage.xaml?page=record_event", UriKind.Relative)); } }
private void ApplicationBarIconButton_Click_1(object sender, EventArgs e) { var friends = FriendList.SelectedItems; List <FBUser> user_to = new List <FBUser>(); foreach (var x in friends) { FBUser user = x as FBUser; user_to.Add(user); } App.CurrentUser.InviteFriends(eventId, user_to, SettingHelper.GetKeyValue <SocialAccount>("SocialAccount").access_token); }
void browser_Navigated(object sender, NavigationEventArgs e) { (sender as WebBrowser).Navigated -= browser_Navigated; MessageBox.Show("You successfully sign-out"); SettingHelper.SetKeyValue <SocialAccount>("SocialAccount", null); SettingHelper.SetKeyValue <User>("User", null); if (SettingHelper.GetKeyValue <User>("User") == null) { btnAllLogout.Visibility = Visibility.Collapsed; } else { btnAllLogout.Visibility = Visibility.Visible; } }
protected async override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (vm.NearestSpaceObject == null) { vm.Load(); } if (SettingHelper.GetKeyValue <User>("User") == null) { btnAllLogout.Visibility = Visibility.Collapsed; } else { btnAllLogout.Visibility = Visibility.Visible; } }
/// <summary> /// Constructor for the Application object. /// </summary> public App() { // Global handler for uncaught exceptions. UnhandledException += Application_UnhandledException; // Standard Silverlight initialization InitializeComponent(); CurrentUser = SettingHelper.GetKeyValue <User>("User"); MasterSpaceObjects = new SpaceObjectCollection(); // Phone-specific initialization InitializePhoneApplication(); string cul = "en-US"; CultureInfo newCulture = new CultureInfo(cul); Thread.CurrentThread.CurrentCulture = newCulture; // Show graphics profiling information while debugging. if (System.Diagnostics.Debugger.IsAttached) { // Display the current frame rate counters. // Application.Current.Host.Settings.EnableFrameRateCounter = true; // Show the areas of the app that are being redrawn in each frame. //Application.Current.Host.Settings.EnableRedrawRegions = true; // Enable non-production analysis visualization mode, // which shows areas of a page that are handed off to GPU with a colored overlay. //Application.Current.Host.Settings.EnableCacheVisualization = true; // Disable the application idle detection by setting the UserIdleDetectionMode property of the // application's PhoneApplicationService object to Disabled. // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run // and consume battery power when the user is not using the phone. PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; } }
protected void CreateEvent(SpaceObject obj) { App.CurrentUser.CreateEvent(obj, SettingHelper.GetKeyValue <SocialAccount>("SocialAccount").access_token); }
private void OnLogoutClicked(object sender, System.Windows.Input.GestureEventArgs e) { try{ WebBrowser browser = new WebBrowser(); browser.Navigate(new Uri(String.Format("https://www.facebook.com/logout.php?next={0}&access_token={1}", null, SettingHelper.GetKeyValue <SocialAccount>("SocialAccount").access_token))); browser.Navigated += browser_Navigated; } catch (Exception ex) { MessageBox.Show("Something is wrong, we've failed to process your request"); } }