public override Uri MapUri(Uri uri) { tempUri = System.Net.HttpUtility.UrlDecode(uri.ToString()); // URI association launch for gtask. //check if logged in, else check for ListID, else gTask if (!GTaskSettings.IsLoggedIn() && !tempUri.Contains("Login.xaml")) { //load default task list view return(new Uri("/MainPage.xaml", UriKind.Relative)); } else if (tempUri.Contains("gtask:ShowList?Id=")) { //redirect to TaskList w/ given ID int IdIndex = tempUri.IndexOf("Id=") + 3; string Id = tempUri.Substring(IdIndex); return(new Uri("/Views/TaskView.xaml?Id=" + Id, UriKind.RelativeOrAbsolute)); } else if (tempUri.Contains("gtask")) { //load default task list view return(new Uri("/MainPage.xaml", UriKind.Relative)); } // Otherwise perform normal launch. return(uri); }
// Constructor public MainPage() { InitializeComponent(); if (GTaskSettings.IsLoggedIn()) { //Check to see if Reminder should be shown LoginHelper.Reminder(); //Create Menu Bar BuildLocalizedApplicationBar(); //hide login button btnLogin.Visibility = System.Windows.Visibility.Collapsed; //show TaskListBox TaskListBox.Visibility = System.Windows.Visibility.Visible; //add logout menu item ApplicationBarMenuItem appBarLogoutMenuItem = new ApplicationBarMenuItem(AppResources.AppBarLogoutMenuText); ApplicationBar.MenuItems.Add(appBarLogoutMenuItem); appBarLogoutMenuItem.Click += new EventHandler(Logout_Click); } else { //Set/Reset App Variables LoginHelper.SetVariables(); //hide TaskListbox TaskListBox.Visibility = System.Windows.Visibility.Collapsed; } //Set Title txtTitle.Text = GTaskSettings.ApplicationTitle; //Turnoff Ads if not paid for if (GTaskSettings.IsFree) { AdControl.Visibility = System.Windows.Visibility.Visible; TaskListBox.Margin = new Thickness(0, 0, 0, 80); } else { AdControl.Visibility = System.Windows.Visibility.Collapsed; TaskListBox.Margin = new Thickness(0, 0, 0, 0); } }
private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e) { SystemTray.ProgressIndicator = new ProgressIndicator(); //Get Data if logged in if (GTaskSettings.IsLoggedIn()) { if (GTaskSettings.AutoRefreshLists) { refresh(true, true); } else { refresh(); } } }
public Login() { InitializeComponent(); //Login or Logout depending on current state if (GTaskSettings.IsLoggedIn()) { try { webBrowserGoogleLogin.Navigate(new Uri(GTaskSettings.LogOutURL, UriKind.RelativeOrAbsolute)); //Remove Stored Information GTaskSettings.ClearSession(); //Remove LocalStorage (if exists) string ApplicationDataFileName = "TaskListData.txt"; IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication(); if (storage.FileExists(ApplicationDataFileName)) { storage.DeleteFile(ApplicationDataFileName); } //Remove LiveTiles List <ShellTile> listST = new List <ShellTile>(); foreach (ShellTile shellTile in ShellTile.ActiveTiles) { if (shellTile.NavigationUri.ToString().Contains("/Views/TaskView.xaml?Id=")) { shellTile.Delete(); } } MessageBoxResult msgbox = MessageBox.Show("You have successfully logged out."); Dispatcher.BeginInvoke(() => NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.RelativeOrAbsolute))); } catch (Exception) { MessageBox.Show("[4] Take a screenshot and send it to @MattLoflin or [email protected]"); } } else { webBrowserGoogleLogin.Navigate(LoginHelper.GetLoginUrl()); } }
//If not logged it - take back to homepage where it will prompt //if logged in then pull in list, check to see if "Pinned" and show pin or unpin accordingly protected override void OnNavigatedTo(NavigationEventArgs e) { //If the user isn't logged in then go to the MainPage if (!GTaskSettings.IsLoggedIn()) { NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.RelativeOrAbsolute)); } else { //Check to see if Reminder should be shown LoginHelper.Reminder(); } //If there is an ID set it, else go to MainPage if (NavigationContext.QueryString.ContainsKey("Id")) { Id = NavigationContext.QueryString["Id"]; //Check to see if the Id exists. Check_Id(Id); //Set Title txtTitle.Text = GTaskSettings.ApplicationTitle; } else { NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.RelativeOrAbsolute)); } //Create Menu Bar //BuildLocalizedApplicationBar(); //Turnoff Ads if not paid for if (GTaskSettings.IsFree) { AdControl.Visibility = System.Windows.Visibility.Visible; //TasksView.Margin = new Thickness(0, 0, 0, 80); } else { AdControl.Visibility = System.Windows.Visibility.Collapsed; //TasksView.Margin = new Thickness(0, 0, 0, 0); } }