Beispiel #1
0
        protected override void Initialize(bool initData)
        {
            base.Initialize(initData);

            if (initData)
            {
                _tempName        = _doc.FitFunctionName;
                _tempCategory    = _doc.FitFunctionCategory;
                _tempDescription = _doc.FitFunctionDescription;

                _controllerName                 = (ISingleValueController)Current.Gui.GetControllerAndControl(new object[] { _tempName }, typeof(ISingleValueController));
                _controllerCategory             = (ISingleValueController)Current.Gui.GetControllerAndControl(new object[] { _tempCategory }, typeof(ISingleValueController));
                _controllerDescription          = (ISingleValueController)Current.Gui.GetControllerAndControl(new object[] { _tempDescription }, typeof(ISingleValueController));
                _controllerShouldSaveInUserData = (IBooleanValueController)Current.Gui.GetControllerAndControl(new object[] { _tempShouldSave }, typeof(IBooleanValueController));

                _controllerName.DescriptionText                 = "Enter fit function name:";
                _controllerCategory.DescriptionText             = "Enter fit function category:";
                _controllerDescription.DescriptionText          = "Enter fit function description:";
                _controllerShouldSaveInUserData.DescriptionText = "Save in user fit functions directory?";

                _innerController = new MultiChildController(new ControlViewElement[] {
                    new ControlViewElement(null, _controllerName, _controllerName.ViewObject),
                    new ControlViewElement(null, _controllerCategory, _controllerCategory.ViewObject),
                    new ControlViewElement(null, _controllerDescription, _controllerDescription.ViewObject),
                    new ControlViewElement(null, _controllerShouldSaveInUserData, _controllerShouldSaveInUserData.ViewObject)
                },
                                                            false);
            }
        }
Beispiel #2
0
        public override IEnumerable <ControllerAndSetNullMethod> GetSubControllers()
        {
            yield return(new ControllerAndSetNullMethod(_grid1, () => _grid1 = null));

            yield return(new ControllerAndSetNullMethod(_grid2, () => _grid2 = null));

            yield return(new ControllerAndSetNullMethod(_background, () => _background = null));

            yield return(new ControllerAndSetNullMethod(_innerController, () => _innerController = null));
        }
Beispiel #3
0
        public override IEnumerable <ControllerAndSetNullMethod> GetSubControllers()
        {
            yield return(new ControllerAndSetNullMethod(_controllerName, () => _controllerName = null));

            yield return(new ControllerAndSetNullMethod(_controllerCategory, () => _controllerCategory = null));

            yield return(new ControllerAndSetNullMethod(_controllerDescription, () => _controllerDescription = null));

            yield return(new ControllerAndSetNullMethod(_controllerShouldSaveInUserData, () => _controllerShouldSaveInUserData = null));

            yield return(new ControllerAndSetNullMethod(_innerController, () => _innerController = null));
        }
        public override IEnumerable <ControllerAndSetNullMethod> GetSubControllers()
        {
            yield return(new ControllerAndSetNullMethod(_ctrl0, () => _ctrl0 = null));

            yield return(new ControllerAndSetNullMethod(_ctrl1, () => _ctrl1 = null));

            yield return(new ControllerAndSetNullMethod(_ctrl2, () => _ctrl2 = null));

            yield return(new ControllerAndSetNullMethod(_ctrl3, () => _ctrl3 = null));

            yield return(new ControllerAndSetNullMethod(_innerController, () => _innerController = null));
        }
Beispiel #5
0
        protected override void Initialize(bool initData)
        {
            base.Initialize(initData);

            if (initData)
            {
                _grid1 = new XYGridStyleController()
                {
                    UseDocumentCopy = UseDocument.Directly
                };
                _grid1.InitializeDocument(_doc.GridStyleFirst ?? new GridStyle()
                {
                    ShowGrid = false
                });
                Current.Gui.FindAndAttachControlTo(_grid1);
                var c1 = new ControlViewElement(GridName(_doc.PlaneID.InPlaneAxisNumber1), _grid1, _grid1.ViewObject);

                _grid2 = new XYGridStyleController()
                {
                    UseDocumentCopy = UseDocument.Directly
                };
                _grid2.InitializeDocument(_doc.GridStyleSecond ?? new GridStyle()
                {
                    ShowGrid = false
                });
                Current.Gui.FindAndAttachControlTo(_grid2);
                var c2 = new ControlViewElement(GridName(_doc.PlaneID.InPlaneAxisNumber2), _grid2, _grid2.ViewObject);

                _background = new BrushControllerAdvanced()
                {
                    UseDocumentCopy = UseDocument.Directly
                };
                _background.InitializeDocument(_doc.Background ?? BrushX.Empty);
                Current.Gui.FindAndAttachControlTo(_background);
                var c3 = new ControlViewElement("Background", _background, _background.ViewObject);

                _innerController = new MultiChildController(new ControlViewElement[] { c1, c2, c3 }, false);
            }
        }
        protected override void Initialize(bool initData)
        {
            base.Initialize(initData);

            if (initData)
            {
                string[] names = new string[_doc.SelectedDataColumns.Count];
                for (int i = 0; i < names.Length; i++)
                {
                    names[i] = _doc.Table[_doc.SelectedDataColumns[i]].Name;
                }

                _ctrl0 = new SingleChoiceController(names, 0);
                _ctrl1 = new BooleanValueController(_doc.IncludeIntercept);
                _ctrl2 = new BooleanValueController(_doc.GenerateRegressionValues);
                _ctrl3 = new BooleanValueController(_doc.GenerateRegressionValues);

                _ctrl0.DescriptionText = "Choose the dependent variable:";
                _ctrl1.DescriptionText = "Include intercept";
                _ctrl2.DescriptionText = "Generate prediction values";
                _ctrl3.DescriptionText = "Generate residual values";

                _elements[0] = new ControlViewElement(null, _ctrl0);
                _elements[1] = new ControlViewElement(null, _ctrl1);
                _elements[2] = new ControlViewElement(null, _ctrl2);
                _elements[3] = new ControlViewElement(null, _ctrl3);

                for (int i = 0; i < _elements.Length; i++)
                {
                    Current.Gui.FindAndAttachControlTo((IMVCController)_elements[i].Controller);
                    _elements[i].View = ((IMVCController)_elements[i].Controller).ViewObject;
                }

                _innerController = new MultiChildController(_elements, false);
            }
        }