Exemple #1
0
        private void SaveOrCreateEvent()
        {
            ToDoListMainWindow.instance.Focus();

            if (isCreate)
            {
                ToDoFeature feature = new ToDoFeature(nameInputView.Content, descInputView.Content);

                if (productParent != null)
                {
                    productParent.features.Add(feature);
                }
                else
                {
                    featureOrParent.childFeatures.Add(feature);
                }

                inputView.AddNewToView(feature);
            }
            else
            {
                featureOrParent.name        = nameInputView.Content.Val;
                featureOrParent.description = descInputView.Content.Val;
                inputView.RefreshFoldoutViewContent();
            }

            ToDoDataManager.Save();
        }
Exemple #2
0
 public ToDoListFeatureView(ToDoFeature _currentFeature, ToDoListFeatureView _parentView)
 {
     isHeader       = false;
     depth          = _parentView.depth + 1;
     currentFeature = _currentFeature;
     parentView     = _parentView;
     Init();
 }
Exemple #3
0
        public static ToDoListFeaturesSubWindow Open(ToDoListFeatureView _inputView, ToDoFeature _featureOrParent,
                                                     bool _isCreate, string name = "ToDo Feature Editor")
        {
            var window = Open <ToDoListFeaturesSubWindow>(name);

            window.Init(_inputView, _featureOrParent, null, _isCreate);
            instance = window;
            window.Show();
            return(window);
        }
Exemple #4
0
        private void Init(ToDoListFeatureView _inputView, ToDoFeature _featureParent, ToDoProduct _todoProduct,
                          bool _isCreate)
        {
            inputView       = _inputView;
            isCreate        = _isCreate;
            featureOrParent = _featureParent;
            productParent   = _todoProduct;
            EditorGUI.FocusTextInControl(null);

            if (isCreate)
            {
                nameInputView.Content.Val = string.Empty;
                descInputView.Content.Val = string.Empty;
                saveCreateBtn.Text        = "创建";
            }
            else
            {
                nameInputView.Content.Val = featureOrParent.name;
                descInputView.Content.Val = featureOrParent.description;
                saveCreateBtn.Text        = "保存";
            }
        }
Exemple #5
0
 public void AddNewToView(ToDoFeature newFeature)
 {
     new ToDoListFeatureView(newFeature, this).AddTo(featureDetailView);
 }