Ejemplo n.º 1
0
        public LoginView()
        {
            var usernameLine = new HorizontalLayout().AddTo(this);

            new LabelView("username:"******"").AddTo(usernameLine);

            var passwordLine = new HorizontalLayout().AddTo(this);

            new LabelView("password:"******"").PasswordMode().AddTo(passwordLine);

            var loginBtn    = new ButtonView("登录").AddTo(this);
            var registerBtn = new ButtonView("注册").AddTo(this);

            loginBtn.OnClick.AddListener(() =>
            {
                mController.SendCommand(new LoginCommand(username.Content.Value, password.Content.Value));
            });

            registerBtn.OnClick.AddListener(() =>
            {
                mController.SendCommand <OpenRegisterWebsiteCommand>();
            });
        }
Ejemplo n.º 2
0
        public LoginView()
        {
            var usernameLine = EasyIMGUI.Horizontal().Parent(this);

            EasyIMGUI.Label().Text("username:"******"password:"******"登录")
            .OnClick(() => { mController.SendCommand(new LoginCommand(username.Content.Value, password.Content.Value)); })
            .Parent(this);

            EasyIMGUI.Button()
            .Text("注册")
            .OnClick(() => { mController.SendCommand <OpenRegisterWebsiteCommand>(); })
            .Parent(this);
        }
Ejemplo n.º 3
0
        public RegisterView()
        {
            var usernameLine = new HorizontalLayout().AddTo(this);

            new LabelView("username:"******"").AddTo(usernameLine);

            var passwordLine = new HorizontalLayout().AddTo(this);

            new LabelView("password:"******"").PasswordMode().AddTo(passwordLine);

            new ButtonView("注册", () => { }).AddTo(this);

            new ButtonView("返回注册", () => { mControllerNode.SendCommand(new OpenRegisterViewCommand()); })
            .AddTo(this);
        }
Ejemplo n.º 4
0
        public RegisterView()
        {
            var usernameLine = EasyIMGUI.Horizontal().Parent(this);

            EasyIMGUI.Label().Text("username:"******"password:"******"注册")
            .OnClick(() => { })
            .Parent(this);

            EasyIMGUI.Button()
            .Text("返回注册")
            .OnClick(() => { mControllerNode.SendCommand(new OpenRegisterViewCommand()); })
            .Parent(this);
        }
Ejemplo n.º 5
0
        protected override void Init()
        {
            PackageMakerState.InitState();

            RootLayout = new VerticalLayout("box");

            var editorView    = new VerticalLayout().AddTo(RootLayout);
            var uploadingView = new VerticalLayout().AddTo(RootLayout);
            // var finishView = new VerticalLayout().AddTo(RootLayout);

            // 当前版本号
            var versionLine = new HorizontalLayout().AddTo(editorView);

            new LabelView("当前版本号").Width(100).AddTo(versionLine);
            new LabelView(mPackageVersion.Version).Width(100).AddTo(versionLine);

            // 发布版本号
            var publishedVersionLine = new HorizontalLayout().AddTo(editorView);

            new LabelView("发布版本号")
            .Width(100)
            .AddTo(publishedVersionLine);

            new TextView(mPublishVersion)
            .Width(100)
            .AddTo(publishedVersionLine)
            .Content.Bind(v => mPublishVersion = v);

            // 类型
            var typeLine = new HorizontalLayout().AddTo(editorView);

            new LabelView("类型").Width(100).AddTo(typeLine);

            var packageType = new EnumPopupView(mPackageVersion.Type).AddTo(typeLine);

            var accessRightLine = new HorizontalLayout().AddTo(editorView);

            new LabelView("权限").Width(100).AddTo(accessRightLine);
            var accessRight = new EnumPopupView(mPackageVersion.AccessRight).AddTo(accessRightLine);

            new LabelView("发布说明:").Width(150).AddTo(editorView);

            var releaseNote = new TextAreaView().Width(250).Height(300).AddTo(editorView);

            PackageMakerState.InEditorView.BindWithInitialValue(value => { editorView.Visible = value; })
            .AddTo(mDisposableList);

            if (User.Logined)
            {
                new ButtonView("发布", () =>
                {
                    mPackageVersion.Readme.content = releaseNote.Content.Value;
                    mPackageVersion.AccessRight    = (PackageAccessRight)accessRight.ValueProperty.Value;
                    mPackageVersion.Type           = (PackageType)packageType.ValueProperty.Value;
                    mPackageVersion.Version        = mPublishVersion;

                    mControllerNode.SendCommand(new PublishPackageCommand(mPackageVersion));
                }).AddTo(editorView);
            }

            var notice = new LabelViewWithRect("", 100, 200, 200, 200).AddTo(uploadingView);

            PackageMakerState.NoticeMessage
            .BindWithInitialValue(value => { notice.Content.Value = value; }).AddTo(mDisposableList);

            PackageMakerState.InUploadingView.BindWithInitialValue(value => { uploadingView.Visible = value; })
            .AddTo(mDisposableList);
        }