Beispiel #1
0
        public void EhView_RemoveNormalGroupStyle()
        {
            for (int i = _currentNormalStyles.Count - 1; i >= 0; i--)
            {
                CheckableSelectableListNode selected = _currentNormalStyles[i];
                if (!selected.Selected)
                {
                    continue;
                }

                _doc.RemoveType((Type)selected.Item);

                _currentNormalStyles.RemoveAt(i);
                if (i < _currentStepItems)
                {
                    _currentStepItems--;
                }

                _availableNormalStyles.Add(new SelectableListNode(
                                               Current.Gui.GetUserFriendlyClassName((Type)selected.Item),
                                               selected.Item,
                                               true));
            }

            UpdateCurrentNormalIndentation();
            _view.InitializeAvailableNormalGroupStyles(_availableNormalStyles);
            _view.InitializeCurrentNormalGroupStyles(_currentNormalStyles);
        }
Beispiel #2
0
        void ApplyPlotGroupView()
        {
            if (null != _plotGroupView)
            {
                bool color     = _plotGroupView.PlotGroupColor;
                bool linestyle = _plotGroupView.PlotGroupLineType;
                bool symbol    = _plotGroupView.PlotGroupSymbol;
                bool serial    = !_plotGroupView.PlotGroupConcurrently;

                if (_groupStyles.ContainsType(typeof(ColorGroupStyle)))
                {
                    _groupStyles.RemoveType(typeof(ColorGroupStyle));
                }
                if (_groupStyles.ContainsType(typeof(LineStyleGroupStyle)))
                {
                    _groupStyles.RemoveType(typeof(LineStyleGroupStyle));
                }
                if (_groupStyles.ContainsType(typeof(SymbolShapeStyleGroupStyle)))
                {
                    _groupStyles.RemoveType(typeof(SymbolShapeStyleGroupStyle));
                }


                if (color)
                {
                    _groupStyles.Add(new ColorGroupStyle());
                }
                if (linestyle)
                {
                    if (serial && color)
                    {
                        _groupStyles.Add(new LineStyleGroupStyle(), typeof(ColorGroupStyle));
                    }
                    else
                    {
                        _groupStyles.Add(new LineStyleGroupStyle());
                    }
                }
                if (symbol)
                {
                    if (serial && linestyle)
                    {
                        _groupStyles.Add(new SymbolShapeStyleGroupStyle(), typeof(LineStyleGroupStyle));
                    }
                    else if (serial && color)
                    {
                        _groupStyles.Add(new SymbolShapeStyleGroupStyle(), typeof(ColorGroupStyle));
                    }
                    else
                    {
                        _groupStyles.Add(new SymbolShapeStyleGroupStyle());
                    }
                }

                _groupStyles.PlotGroupStrictness = _plotGroupView.PlotGroupStrict;
            }


            // now distribute the new style to the other plot items
            if (_doc.ParentCollection != null)
            {
                _doc.ParentCollection.DistributePlotStyleFromTemplate(_doc, _groupStyles.PlotGroupStrictness);
                _doc.ParentCollection.DistributeChanges(_doc);
            }
        }