// have this here as controller too public override bool Apply(bool disposeController) { if (_applySuspend++ > 0) { _applySuspend--; return(true); } bool applyResult = false; if (null != _dataController && !_dataController.Apply(disposeController)) { return(false); } if (!_styleCollectionController.Apply(disposeController)) { return(false); } var activeSubStyleIndex = GetActiveSubStyleControlIndex(); if (activeSubStyleIndex.HasValue) { if (false == _styleControllerList[activeSubStyleIndex.Value].Apply(false)) { _view.BringTabToFront(activeSubStyleIndex.Value); applyResult = false; goto end_of_function; } DistributeStyleChange(activeSubStyleIndex.Value, true); } for (int i = 0; i < _styleControllerList.Count; ++i) { if (false == _styleControllerList[i].Apply(disposeController)) { _view.BringTabToFront(i); applyResult = false; goto end_of_function; } } ApplyPlotGroupView(disposeController); applyResult = true; end_of_function: _applySuspend--; return(ApplyEnd(applyResult, disposeController)); }
private void _styleCollectionController_CollectionChangeCommit(object sender, EventArgs e) { if (true == _styleCollectionController.Apply()) { // remove the tabs 2.. int firstStyle = GetFirstStyleTabIndex(); RemoveTabRange(firstStyle, TabCount - firstStyle); InitializeStyles(); BringTabToFront(GetFirstStyleTabIndex() - 1); } }