private void ReBuildToDoItems()
        {
            verticalLayout.Clear();

            var data = ToDoDataManager.Data;

            foreach (var item in data.categoryList)
            {
                var layout = new HorizontalLayout("box").AddTo(verticalLayout);

                //new BoxView(item.name).BackgroundColor(item.color.ToColor()).AddTo(layout);

                new CategoryComponent(item).AddTo(layout);


                new FlexibleSpaceView().AddTo(layout);

                new ImageButtonView(ImageButtonIcon.editorIcon, () => OpenSubWindow(item))
                .Width(25).Height(25).BackgroundColor(Color.black).AddTo(layout);

                new ImageButtonView(ImageButtonIcon.deleteIcon, () =>
                {
                    ToDoDataManager.RemoveToDoCategory(item);
                    UpdateToDoItems();
                })
                .Width(25).Height(25).BackgroundColor(Color.red).AddTo(layout);
            }
        }
示例#2
0
        public void Init(IQFrameworkContainer container)
        {
            var expendLayout = new TreeNode(false, LocaleText.UserInfo)
                               .AddTo(this);

            var verticalLyaout = new VerticalLayout("box");

            expendLayout.Add2Spread(verticalLyaout);

            AccountModel.Subject
            .StartWith(AccountModel.State)
            .Subscribe(state =>
            {
                verticalLyaout.Clear();

                if (state.Logined)
                {
                    new ButtonView("注销", () =>
                    {
                        AccountModel.Effects.Logout();
                    }).AddTo(verticalLyaout);
                }
                else
                {
                    if (state.InLoginView)
                    {
                        new LoginView().AddTo(verticalLyaout);
                    }
                    else
                    {
                        new RegisterView().AddTo(verticalLyaout);
                    }
                }
            });
        }
示例#3
0
        public void RefreshProductFoldoutDetailView()
        {
            versionDetailView.Clear();

            foreach (var item in todoProduct.versions.OrderByDescending(x =>
                                                                        x.version))
            {
                new ToDoListProductFoldoutDetailView(this, todoProduct, item).AddTo(versionDetailView);
            }
        }
示例#4
0
        public void RebuildDetailViews(ToDoProduct todoProduct)
        {
            this.todoProduct = todoProduct;

            detailViews.Clear();

            productViews.Hide();

            CreateDetailView(todoProduct, true).AddTo(detailViews);
            detailViews.Show();
        }
        public void ReBuildToDoItems()
        {
            todoListItemsLayout.Clear();

            var dataList = ToDoDataManager.Data.todoList
                           .Where(item => (item.state.Val == ToDoData.ToDoState.Done) == false &&
                                  item.isHide == true)
                           .OrderByDescending(item => item.state.Val)
                           .ThenBy(item => item.priority.Val);

            foreach (var item in dataList)
            {
                new ToDoListItemView(item, ChangeProperty).AddTo(todoListItemsLayout);
                new SpaceView(4).AddTo(todoListItemsLayout);
            }

            RefreshVisible();
        }
示例#6
0
        public void RebuildProductViews()
        {
            productViews.Clear();

            detailViews.Hide();
            todoProduct = null;

            new ButtonView("创建产品", () => OpenProductEditorWindow(null), true).Height(40).AddTo(productViews);

            new SpaceView(10f).AddTo(productViews);

            var data = ToDoDataManager.Data.productList;

            for (int i = data.Count - 1; i >= 0; i--)
            {
                var product = data[i];

                var title = new HorizontalLayout();

                new FlexibleSpaceView().AddTo(title);

                new ImageButtonView(ImageButtonIcon.openIcon, () => EnqueueCmd(() => RebuildDetailViews(product)))
                .Width(40).Height(25).BackgroundColor(Color.black).AddTo(title);

                new ImageButtonView(ImageButtonIcon.editorIcon, () => OpenProductEditorWindow(product))
                .Width(40).Height(25).BackgroundColor(Color.black).AddTo(title);

                new ImageButtonView(ImageButtonIcon.deleteIcon, () => RemoveProduct(product)).Width(25).Height(25)
                .BackgroundColor(Color.red).AddTo(title);

                var foldout = new FoldoutView(false, product.name, title).FontSize(25)
                              .FontBold().AddTo(productViews);

                new SpaceView(10f).AddTo(productViews);

                foldout.AddFoldoutView(CreateDetailView(product, false).AddTo(detailViews));

                foldout.AddFoldoutView(new SpaceView(15f));
            }

            productViews.Show();
        }
示例#7
0
        protected override void Init()
        {
            RootLayout = new VerticalLayout("box");
            UploadModel.Subject
            .StartWith(UploadModel.State)
            .Subscribe(state =>
            {
                if (state.Progress == UploadProgress.STATE_GENERATE_INIT)
                {
                    RootLayout.Clear();

                    // 当前版本号
                    var versionLine = new HorizontalLayout().AddTo(RootLayout);
                    new LabelView("当前版本号").Width(100).AddTo(versionLine);
                    new LabelView(mPackageVersion.Version).Width(100).AddTo(versionLine);

                    // 发布版本号
                    var publishedVertionLine = new HorizontalLayout().AddTo(RootLayout);
                    new LabelView("发布版本号").Width(100).AddTo(publishedVertionLine);
                    new TextView(mVersionText).Width(100).AddTo(publishedVertionLine)
                    .Content.Bind(content => mVersionText = content);


                    var typeLine = new HorizontalLayout().AddTo(RootLayout);
                    new LabelView("类型").Width(100).AddTo(typeLine);

                    new EnumPopupView(mPackageVersion.Type).AddTo(typeLine)
                    .ValueProperty.Bind(value => mPackageVersion.Type = (PackageType)value);


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

                    new LabelView("权限").Width(100).AddTo(accessRightLine);

                    new EnumPopupView(mPackageVersion.AccessRight).AddTo(accessRightLine)
                    .ValueProperty.Bind(v => mPackageVersion.AccessRight = (PackageAccessRight)v);

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

                    new TextAreaView(mReleaseNote).Width(250).Height(300).AddTo(RootLayout)
                    .Content.Bind(releaseNote => mReleaseNote = releaseNote);

                    var docLine = new HorizontalLayout().AddTo(RootLayout);

                    new LabelView("文档地址:").Width(52).AddTo(docLine);
                    new TextView(mPackageVersion.DocUrl).Width(150).AddTo(docLine)
                    .Content.Bind(value => mPackageVersion.DocUrl = value);

                    new ButtonView("Paste", () =>
                    {
                        mPackageVersion.DocUrl = GUIUtility.systemCopyBuffer;
                    }).AddTo(docLine);


                    if (User.Logined)
                    {
                        new ButtonView("发布", () =>
                        {
                            User.Save();

                            if (mReleaseNote.Length < 2)
                            {
                                ShowErrorMsg("请输入版本修改说明");
                                return;
                            }

                            if (!IsVersionValide(mVersionText))
                            {
                                ShowErrorMsg("请输入正确的版本号");
                                return;
                            }

                            mPackageVersion.Version = mVersionText;
                            mPackageVersion.Readme  = new ReleaseItem(mVersionText, mReleaseNote, User.Username.Value,
                                                                      DateTime.Now);

                            mPackageVersion.Save();

                            AssetDatabase.Refresh();


                            UploadModel.Effects.Publish(mPackageVersion, false);
                        }).AddTo(RootLayout);

                        new ButtonView("发布并删除本地", () => { }).AddTo(RootLayout);
                    }
                }
                else
                {
                    RootLayout.Clear();

                    new CustomView(() =>
                    {
                        EditorGUI.LabelField(new Rect(100, 200, 200, 200), state.NoticeMessage, EditorStyles.boldLabel);
                    }).AddTo(RootLayout);
                }

                if (state.Progress == UploadProgress.STATE_GENERATE_COMPLETE)
                {
                    if (EditorUtility.DisplayDialog("上传结果", mUploadResult, "OK"))
                    {
                        AssetDatabase.Refresh();

                        UploadModel.Dispatch("setProgress", UploadProgress.STATE_GENERATE_INIT);
                        Close();
                    }
                }
            });
        }