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); } }
public FitFunctionNameAndCategoryController(FitFunctionScript doc) { _doc = doc; _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?"; base.Initialize(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); }
public FitFunctionNameAndCategoryController(FitFunctionScript doc) { _doc = doc; _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?"; base.Initialize(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); }
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)); }