private void ApplyPlotGroupView(bool disposeController)
        {
            _plotGroupController.Apply(disposeController);
            _groupStyles.CopyFrom((PlotGroupStyleCollection)_plotGroupController.ModelObject);

            // now distribute the new style to the other plot items
            if (_doc.ParentCollection != null)
            {
                _doc.ParentCollection.GroupStyles.CopyFrom(_groupStyles);
                _doc.ParentCollection.DistributePlotStyleFromTemplate(_doc, _groupStyles.PlotGroupStrictness);
                _doc.ParentCollection.DistributeChanges(_doc);
            }
        }
Exemple #2
0
        public bool Apply()
        {
            foreach (SelectableListNode node in _availableTransfoStyles)
            {
                if (node.Selected)
                {
                    _currentTransfoStyle = (Type)node.Item;
                    break;
                }
            }

            if (null != _currentTransfoStyle)
            {
                _doc.CoordinateTransformingStyle = (ICoordinateTransformingGroupStyle)Activator.CreateInstance(_currentTransfoStyle);
            }
            else
            {
                _doc.CoordinateTransformingStyle = null;
            }

            _view.SynchronizeCurrentNormalGroupStyles(); // synchronize the checked state of the items
            foreach (CheckableSelectableListNode node in _currentNormalStyles)
            {
                IPlotGroupStyle style = _doc.GetPlotGroupStyle((Type)node.Item);
                style.IsStepEnabled = node.Checked;
            }

            bool inherit, distribute;

            _view.QueryUpdateMode(out inherit, out distribute);
            _doc.InheritFromParentGroups = inherit;
            _doc.DistributeToChildGroups = distribute;
            foreach (SelectableListNode node in _availableUpdateModes)
            {
                if (node.Selected)
                {
                    _doc.PlotGroupStrictness = (PlotGroupStrictness)node.Item;
                    break;
                }
            }

            if (_useDocument == UseDocument.Copy)
            {
                _origdoc.CopyFrom(_doc);
            }
            return(true);
        }