private void InitialPage_LayoutUpdated(object sender, EventArgs e)
        {
            this.LayoutUpdated -= InitialPage_LayoutUpdated;

            if (ConsentManager.HasConsented)
            {
                if (!(App.Current as App).JustLoggedOut)
                {
                    TombstoneData data = TombstoneManager.Load();
                    if (data != null)
                    {
                        TinderSession activeSession = TinderSession.FromTombstoneData(data);
                        (App.Current as App).RightSideBar.DataContext = activeSession.Matches;

                        TopBarViewModel.ShowTopButtons = System.Windows.Visibility.Visible;

                        NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));

                        App.RootFrame.RemoveBackEntry();

                        return;
                    }
                }
                else
                {
                    LoginButtonBorder.Visibility = System.Windows.Visibility.Visible;
                }
            }

            if (!(App.Current as App).JustLoggedOut)
            {
                Open.Begin();
            }
        }
示例#2
0
 private void PhoneApplicationService_Activated(object sender, Microsoft.Phone.Shell.ActivatedEventArgs e)
 {
     if (!e.IsApplicationInstancePreserved)
     {
         TombstoneData data = TombstoneManager.Load();
         if (data != null)
         {
             TinderSession.FromTombstoneData(data);
         }
     }
 }
示例#3
0
        public static TinderSession FromTombstoneData(TombstoneData data)
        {
            Client.AuthToken = data.AuthToken;
            _currentSession  = new TinderSession(data.FBSession, data.Location);
            _currentSession._currentProfile = data.CurrentProfile;
            _currentSession._currentUser    = data.CurrentUser;
            _currentSession._globalInfo     = data.CurrentGlobals;
            _currentSession._lastActivity   = data.LastActivity;
            //_currentSession._matches = new MatchesViewModel(data.Matches);
            _currentSession._recommendations = new Stack <UserResult>(data.Recommendations);
            _currentSession.StartUpdatesTimer();

            //(Application.Current as TinderApp.Library.Controls.IApp).RootFrameInstance.LoggedIn();

            return(_currentSession);
        }
示例#4
0
 public static void Save(TombstoneData data)
 {
     Coding4Fun.Toolkit.Storage.Serializer.Save<TombstoneData>("TombstoneState", data);
 }
示例#5
0
        public static TinderSession FromTombstoneData(TombstoneData data)
        {
            Client.AuthToken = data.AuthToken;
            _currentSession = new TinderSession(data.FBSession, data.Location);
            _currentSession._currentProfile = data.CurrentProfile;
            _currentSession._currentUser = data.CurrentUser;
            _currentSession._globalInfo = data.CurrentGlobals;
            _currentSession._lastActivity = data.LastActivity;
            _currentSession._matches = new MatchesViewModel(data.Matches);
            _currentSession._recommendations = new Stack<UserResult>(data.Recommendations);
            _currentSession.StartUpdatesTimer();

            (Application.Current as TinderApp.Library.Controls.IApp).RootFrameInstance.LoggedIn();

            return _currentSession;
        }