private ToDoListVersionDetailSubWindow Init(ToDoListProductDetailView _productDetailView
                                                    , ToDoProduct _todoProduct, ToDoProductVersion _version)
        {
            productView    = _productDetailView;
            todoProduct    = _todoProduct;
            productVersion = _version;

            if (_version != null)
            {
                todoVersion.SetVersion(_version.version);
                versionNameView.Content.Val = _version.name;
            }
            else
            {
                todoVersion.SetVersion(0, 0, 0);
                productName = string.Empty;
            }


            UpdateMajor();
            UpdateMiddle();
            UpdateSmall();

            return(this);
        }
 public static void RemoveProductToDoItem(this ToDoListCls cls, ToDoProductVersion productVersion, ToDoData data)
 {
     productVersion.todoIDs.Remove(data.id);
     productVersion.todos.Remove(data);
     cls.todoList.Remove(data);
     cls.Save();
 }
        public static ToDoListVersionDetailSubWindow Open(ToDoListProductDetailView productDetailView,
                                                          ToDoProduct todoProduct, ToDoProductVersion version = null, string name = null)
        {
            string str    = name ?? (version == null ? "Version Detail Create Window" : "Version Detail Editor Window");
            var    window = Open <ToDoListVersionDetailSubWindow>(str)
                            .Init(productDetailView, todoProduct, version);

            instance = window;
            window.Show();
            return(window);
        }
Beispiel #4
0
        public void CreateAndInsertProductVersion(ToDoProductVersion version)
        {
            int index = -1;

            foreach (var item in todoProduct.versions.OrderByDescending(x =>
                                                                        x.version))
            {
                ++index;
                if (item == version)
                {
                    new ToDoListProductFoldoutDetailView(this, todoProduct, version).InsertTo(index, versionDetailView);
                }
            }
        }
        public void SaveProduct()
        {
            if (productVersion != null)
            {
                productVersion.name = productName;
                productVersion.version.SetVersion(todoVersion);
                productView.RefreshProductFoldoutDetailView();
            }
            else
            {
                var version = new ToDoProductVersion()
                {
                    name    = productName,
                    version = todoVersion
                };
                todoProduct.versions.Add(version);
                productView.CreateAndInsertProductVersion(version);
            }

            ToDoDataManager.Save();
            Close();
            ToDoListMainWindow.instance.Focus();
        }
Beispiel #6
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);
            }
        }
 public static void RemoveProductToDoItem(ToDoProductVersion productVersion, ToDoData data) =>
 Data.RemoveProductToDoItem(productVersion, data);
 public static void AddProductToDoItem(ToDoProductVersion productVersion, ToDoData data) =>
 Data.AddProductToDoItem(productVersion, data);