protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _initialColor = _doc; _subControllerColorModel = new ColorModelController(); _subControllerColorModel.InitializeDocument(_doc.Color); _subControllerColorModel.MadeDirty += EhController_Dirty; _subControllerColorCircle = new ColorCircleController(); _subControllerColorCircle.InitializeDocument(_doc.Color); _subControllerColorCircle.MadeDirty += EhController_Dirty; _subControllerColorPicker = new ColorPickerController(); _subControllerColorPicker.InitializeDocument(_doc.Color); _subControllerColorPicker.MadeDirty += EhController_Dirty; } if (null != _view) { _view.InitializeSubViews(GetTabNamesAndViews()); _view.SetOldColor(_initialColor); _view.SetNewColor(_doc); _view.ColorName = _doc.Name; } }
public override IEnumerable <ControllerAndSetNullMethod> GetSubControllers() { yield return(new ControllerAndSetNullMethod(_subControllerColorModel, () => _subControllerColorModel = null)); yield return(new ControllerAndSetNullMethod(_subControllerColorCircle, () => _subControllerColorCircle = null)); yield return(new ControllerAndSetNullMethod(_subControllerColorPicker, () => _subControllerColorPicker = null)); }