protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _importOptionsController = new Data.DataSourceImportOptionsController() { UseDocumentCopy = UseDocument.Directly }; _importOptionsController.InitializeDocument(_doc.ImportOptions); _connectionMainController = new OleDbDataQueryController() { UseDocumentCopy = UseDocument.Directly }; _connectionMainController.InitializeDocument(_doc.DataQuery); } if (null != _view) { if (null == _importOptionsController.ViewObject) { Current.Gui.FindAndAttachControlTo(_importOptionsController); } if (null == _connectionMainController.ViewObject) { Current.Gui.FindAndAttachControlTo(_connectionMainController); } _view.SetImportOptionsView(_importOptionsController.ViewObject); _view.SetQueryView(_connectionMainController.ViewObject); } }
public override IEnumerable <ControllerAndSetNullMethod> GetSubControllers() { yield return(new ControllerAndSetNullMethod(_connectionMainController, () => _connectionMainController = null)); yield return(new ControllerAndSetNullMethod(_importOptionsController, () => _importOptionsController = null)); }