Beispiel #1
0
        private VNode RenderLogin(RootController rootController)
        {
            if (CurrentRenderMode == RenderMode.error)
            {
                return(Text("Wrong Username/Password!", Styles.AbortBtn & Styles.MP4, () => CurrentRenderMode = RenderMode.@default));
            }

            return(Div(
                       Input(Username, s => Username = s),
                       Input(Password, s => Password = s).WithPassword(),
                       Text("login ", Styles.Btn, () =>
            {
                try
                {
                    Account.Commands.LoginAccount(GetUser().ID, Password);
                }
                catch (ArgumentException)
                {
                    CurrentRenderMode = RenderMode.error;
                }
                rootController.AccountEntry = GetUser();
            }),
                       Text("back", Styles.Btn & Styles.MP4, () => LoginSelected = false)
                       ));
        }
Beispiel #2
0
        public VNode Render(RootController rootController)
        {
            VNode login    = RenderLogin(rootController);
            VNode register = RenderRegisterAccount();
            VNode loginRegisterSelection = Div(
                Text("Register", Styles.Btn & Styles.MP4, () => RegisterSelected = true),
                Text("Login", Styles.Btn & Styles.MP4, () => LoginSelected       = true)
                );

            return
                (LoginSelected
                ? login
                : RegisterSelected
                    ? register
                    : loginRegisterSelection);
        }
Beispiel #3
0
 public Session(Application application, SessionStartupInfo info)
     : base(application, info)
 {
     RootController = new RootController(this);
 }