Ejemplo n.º 1
0
 public static void Initialize()
 {
     ackTask            = new Dictionary <string, List <Dictionary <string, string> > >();
     logInEvent         = new LogInEvent();
     chapter            = new User();
     chapterUpdateEvent = new UpdateEvent();
 }
Ejemplo n.º 2
0
 public Task HandleAsync(LogInEvent logInEvent, CancellationToken cancellationToken)
 {
     ActivateItemAsync(_dashboardViewModel);
     IsSideMenuVisible = true;
     IsMenuBarVisible  = true;
     return(Task.CompletedTask);
 }
Ejemplo n.º 3
0
        private void _dispatcher_LoggedIn(object sender, LogInEvent e)
        {
            var dispatcher = UsernameTextBox.Dispatcher;

#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                if (e.IsLogged)
                {
                    (Window.Current.Content as Frame).Navigate(typeof(ChooseGameTypePage), e.Me);
                }
                else
                {
                    var md = new MessageDialog("Failed to log in");
                    md.ShowAsync();
                }
            });
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
        }
Ejemplo n.º 4
0
        public void LogIn(string username, string password)
        {
            UserModel user = _userDBHelper.GetUser(username, Password);

            if (user.Username != null)
            {
                ActiveUser = user;
                LoginError = "Login succeded";
                Username   = "";                       //Password = "";
                LogInEvent?.Invoke(this, new LogInEventArgs(true, ActiveUser));
            }
            else
            {
                LoginError = "Login failed, try again";
                //Password = "";
                ActiveUser = null;
                //LogInEvent?.Invoke(this, new LogInEventArgs(false));
            }
        }
Ejemplo n.º 5
0
 public async Task HandleAsync(LogInEvent message, CancellationToken cancellationToken)
 {
     await ActivateItemAsync(IoC.Get <LoginViewModel>(), cancellationToken);
 }
Ejemplo n.º 6
0
        // Log In Event
        public async Task HandleAsync(LogInEvent message, CancellationToken cancellationToken)
        {
            await ActivateItemAsync(IoC.Get <SalesViewModel>());

            SyncMenu();
        }
Ejemplo n.º 7
0
 public void Handle(LogInEvent message)
 {
     _events.PublishOnUIThread(new buttonsTopMenuEvent(true));
     FirstSubViewModel  = _container.GetInstance <MainMenuViewModel>();
     SecondSubViewModel = _container.GetInstance <chatBoxViewModel>();
 }
Ejemplo n.º 8
0
 public void Handle(LogInEvent message)
 {
     ActivateItem(IoC.Get <LoginViewModel>());
 }
Ejemplo n.º 9
0
 public void Handle(LogInEvent message)
 {
     ActivateItem(_salesVM);
 }
Ejemplo n.º 10
0
 public virtual void LogIn()
 {
     LogInEvent?.Invoke();
 }