Ejemplo n.º 1
0
        void UpdateCurrentNormalIndentation()
        {
            int indentation = 0;

            for (int i = 0; i < _currentStepItems; i++)
            {
                Type childtype = i == 0 ? null : _doc.GetChildTypeOf((Type)_currentNormalStyles[i - 1].Item);
                if (childtype == (Type)_currentNormalStyles[i].Item)
                {
                    indentation++;
                }
                else
                {
                    indentation = 0;
                }

                if (indentation > 0)
                {
                    StringBuilder stb = new StringBuilder();
                    stb.Append(' ', indentation * 3);
                    stb.Append(_currentNormalStyles[i].Name.Trim());
                    _currentNormalStyles[i].Name = stb.ToString();
                }
                else
                {
                    _currentNormalStyles[i].Name = _currentNormalStyles[i].Name.Trim();
                }
            }
        }
Ejemplo n.º 2
0
        void InitializePlotGroupView()
        {
            bool bStandard = true;
            bool bSerial   = false;
            bool color     = false;
            bool linestyle = false;
            bool symbol    = false;

            if (_groupStyles != null)
            {
                color     = _groupStyles.ContainsType(typeof(ColorGroupStyle));
                linestyle = _groupStyles.ContainsType(typeof(LineStyleGroupStyle));
                symbol    = _groupStyles.ContainsType(typeof(SymbolShapeStyleGroupStyle));

                if (_groupStyles.Count != (color ? 1 : 0) + (linestyle ? 1 : 0) + (symbol ? 1 : 0))
                {
                    bStandard = false;
                }

                if (color && linestyle && typeof(LineStyleGroupStyle) == _groupStyles.GetChildTypeOf(typeof(ColorGroupStyle)))
                {
                    bSerial = true;
                }
                if ((linestyle && symbol) && typeof(SymbolShapeStyleGroupStyle) == _groupStyles.GetChildTypeOf(typeof(LineStyleGroupStyle)))
                {
                    if (color && !bSerial)
                    {
                        bStandard = false;
                    }
                    else
                    {
                        bSerial = true;
                    }
                }

                if (color && !((ColorGroupStyle)_groupStyles.GetPlotGroupStyle(typeof(ColorGroupStyle))).IsStepEnabled)
                {
                    bStandard = false;
                }
                if (linestyle && !((LineStyleGroupStyle)_groupStyles.GetPlotGroupStyle(typeof(LineStyleGroupStyle))).IsStepEnabled)
                {
                    bStandard = false;
                }
                if (symbol && !((SymbolShapeStyleGroupStyle)_groupStyles.GetPlotGroupStyle(typeof(SymbolShapeStyleGroupStyle))).IsStepEnabled)
                {
                    bStandard = false;
                }
                if (_groupStyles.CoordinateTransformingStyle != null)
                {
                    bStandard = false;
                }
            }

            if (bStandard && _groupStyles != null)
            {
                _plotGroupView = (IXYPlotGroupView)Current.Gui.FindAndAttachControlTo(this, typeof(IXYPlotGroupView));
                _plotGroupView.InitializePlotGroupConditions(
                    color,
                    linestyle,
                    symbol,
                    !bSerial,                  //_parentPlotGroup.ChangeStylesConcurrently,
                    PlotGroupStrictness.Normal //_parentPlotGroup.ChangeStylesStrictly
                    );
                _plotGroupView.AdvancedPlotGroupControl += EhAdvancedPlotGroupControlRequired;
            }
            else if (_groupStyles != null)
            {
                _plotGroupController = (IMVCAController)Current.Gui.GetControllerAndControl(new object[] { _groupStyles }, typeof(IMVCAController));
            }
        }