Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
0
        private void AddToDoToFoldoutView(ToDoData todoItem)
        {
            var itemToDoView = new ToDoListItemView(todoItem, (_) => RefreshStateWithView());

            itemToDoView.deleteAct = (_) =>
            {
                EnqueueCmd(() =>
                {
                    ToDoDataManager.RemoveProductToDoItem(productVersion, todoItem);
                    foldoutView.RemoveFoldoutView(itemToDoView);
                });
            };

            foldoutView.AddFoldoutView(itemToDoView);
        }
Ejemplo n.º 3
0
        public ToDoListProductDetailView(ToDoListProductView _productView, ToDoProduct _todoProduct, bool isNewPage
                                         , Action _rebuildProductViews)
            : base("box")
        {
            productView = _productView;
            todoProduct = _todoProduct;

            if (isNewPage)
            {
                new LabelView(_todoProduct.name).FontBold().FontSize(30).TextMiddleCenter().AddTo(this);
                new SpaceView(8).AddTo(this);
                new ButtonView("返回", () => EnqueueCmd(_rebuildProductViews), true).FontSize(20).TextMiddleCenter()
                .AddTo(this);
            }

            new SpaceView(8).AddTo(this);

            new LabelView("描述: " + _todoProduct.description).FontBold().FontSize(25).TextMiddleLeft().MarginLeft(30)
            .AddTo(this);

            //Feature Detail-------------------

            new SpaceView(8).AddTo(this);

            new ToDoListFeatureView(todoProduct).AddTo(this);

            //Version Detail-----------
            new SpaceView(8).AddTo(this);

            versionDetailView = new VerticalLayout("box");
            var createVersionBtn =
                new ButtonView("创建版本", OpenVersionDetailWindow, true)
                .Height(20).Width(100).FontSize(15).TextMiddleCenter();
            var versionFoldout = new FoldoutView(false, "版本:", createVersionBtn)
                                 .FontSize(25).FontBold().MarginLeft(15).AddTo(this);

            versionFoldout.AddFoldoutView(versionDetailView);

            RefreshProductFoldoutDetailView();
        }
Ejemplo n.º 4
0
        private void Init()
        {
            featureDetailView = new VerticalLayout("box");

            var hor = new HorizontalLayout();

            //string foldoutName = isHeader ? "功能:" : currentFeature.name + "	" + currentFeature.description;

            featureFoldout =
                new FoldoutView(false, string.Empty, hor)
                .FontSize(25)
                .FontBold().MarginLeft(15 + depth * 5).AddTo(this);

            RefreshFoldoutViewContent();

            new FlexibleSpaceView().AddTo(hor);

            new ImageButtonView(ImageButtonIcon.addIcon, OpenFeatureCreateSubWindow)
            .Height(25).Width(25).BackgroundColor(Color.yellow).AddTo(hor);

            if (!isHeader)
            {
                new ImageButtonView(ImageButtonIcon.editorIcon, OpenFeatureEditorSubWindow)
                .Height(25).Width(25).BackgroundColor(Color.red).AddTo(hor);

                new ImageButtonView(ImageButtonIcon.deleteIcon, DeleteFeature)
                .Height(25).Width(25).BackgroundColor(Color.red).AddTo(hor);
            }

            featureFoldout.AddFoldoutView(featureDetailView);

            foreach (var feature in isHeader ? product.features : currentFeature.childFeatures)
            {
                new ToDoListFeatureView(feature, this).AddTo(featureDetailView);
            }
        }
Ejemplo n.º 5
0
        public ToDoListProductFoldoutDetailView(ToDoListProductDetailView _productDetailView
                                                , ToDoProduct _todoProduct, ToDoProductVersion _productVersion) : base("box")
        {
            productDetailView = _productDetailView;
            todoProduct       = _todoProduct;
            productVersion    = _productVersion;

            HorizontalLayout horView = new HorizontalLayout();

            new FlexibleSpaceView().AddTo(horView);

            stateBoxView = new BoxView(String.Empty).Height(20).AddTo(horView);

            new ImageButtonView(ImageButtonIcon.editorIcon,
                                OpenVersionDetailWindow).BackgroundColor(Color.black).Width(30).Height(20).AddTo(horView);

            new ImageButtonView(ImageButtonIcon.deleteIcon,
                                DeleteItem).BackgroundColor(Color.red).Width(30).Height(20).AddTo(horView);

            foldoutView = new FoldoutView(false, productVersion.name + "	"+ productVersion.version, horView)
                          .FontBold().FontSize(15).MarginLeft(30).TextMiddleLeft().AddTo(this);


            var input = new ToDoListInputView(AddFoldoutItem);

            input.Show();

            foldoutView.AddFoldoutView(input);

            RefreshStateWithView();

            foreach (var todoItem in productVersion.todos)
            {
                AddToDoToFoldoutView(todoItem);
            }
        }