Exemple #1
0
 public void OnDispose()
 {
     mDisposableList.Dispose();
     mDisposableList = null;
     mPackageKitLoginApp.Dispose();
     mPackageKitLoginApp = null;
 }
Exemple #2
0
        public void Init(IQFrameworkContainer container)
        {
            new LabelView("账户信息").FontSize(12).AddTo(this);

            var boxLayout = new VerticalLayout("box").AddTo(this);


            var logoutBtn = new ButtonView("注销")
                            .Do(btn => btn.Visible = PackageKitLoginState.Logined.Value)
                            .AddTo(boxLayout);

            var loginView = new LoginView()
                            .Do(self => self.Visible = PackageKitLoginState.LoginViewVisible.Value)
                            .AddTo(boxLayout);

            var registerView = new RegisterView()
                               .Do(self => self.Visible = PackageKitLoginState.RegisterViewVisible.Value)
                               .AddTo(boxLayout);

            PackageKitLoginState.Logined.Bind(value =>
            {
                logoutBtn.Visible = value;
            }).AddTo(mDisposableList);

            logoutBtn.OnClick.AddListener(() =>
            {
                PackageKitLoginApp.Send <LogoutCommand>();
            });

            PackageKitLoginState.LoginViewVisible.Bind(value =>
            {
                loginView.Visible = value;
            }).AddTo(mDisposableList);


            PackageKitLoginState.RegisterViewVisible.Bind(value =>
            {
                registerView.Visible = value;
            }).AddTo(mDisposableList);
        }
Exemple #3
0
        public void Init(IQFrameworkContainer container)
        {
            var expendLayout = new TreeNode(false, LocaleText.UserInfo)
                               .AddTo(this);

            var boxLayout = new VerticalLayout("box");

            expendLayout.Add2Spread(boxLayout);

            var logoutBtn = new ButtonView("注销").AddTo(boxLayout);

            var loginView = new LoginView()
                            .Do(self => self.Visible = PackageKitLoginState.LoginViewVisible.Value)
                            .AddTo(boxLayout);

            var registerView = new RegisterView()
                               .Do(self => self.Visible = PackageKitLoginState.RegisterViewVisible.Value)
                               .AddTo(boxLayout);

            PackageKitLoginState.Logined.Bind(value =>
            {
                logoutBtn.Visible = value;
            }).AddTo(mDisposableList);

            logoutBtn.OnClick.AddListener(() =>
            {
                PackageKitLoginApp.Send <LogoutCommand>();
            });

            PackageKitLoginState.LoginViewVisible.Bind(value =>
            {
                loginView.Visible = value;
            }).AddTo(mDisposableList);


            PackageKitLoginState.RegisterViewVisible.Bind(value =>
            {
                registerView.Visible = value;
            }).AddTo(mDisposableList);
        }