Esempio n. 1
0
        private void SetAllNull()
        {
            this.Cfvo1               = new SLConditionalFormattingValueObject2010();
            this.Cfvo2               = new SLConditionalFormattingValueObject2010();
            this.FillColor           = new SLColor(new List <System.Drawing.Color>(), new List <System.Drawing.Color>());
            this.BorderColor         = new SLColor(new List <System.Drawing.Color>(), new List <System.Drawing.Color>());
            this.NegativeFillColor   = new SLColor(new List <System.Drawing.Color>(), new List <System.Drawing.Color>());
            this.NegativeBorderColor = new SLColor(new List <System.Drawing.Color>(), new List <System.Drawing.Color>());
            this.AxisColor           = new SLColor(new List <System.Drawing.Color>(), new List <System.Drawing.Color>());

            this.MinLength = 10;
            this.MaxLength = 90;
            this.ShowValue = true;
            this.Border    = false;
            this.Gradient  = true;
            this.Direction = X14.DataBarDirectionValues.Context;
            this.NegativeBarColorSameAsPositive       = false;
            this.NegativeBarBorderColorSameAsPositive = true;
            this.AxisPosition = X14.DataBarAxisPositionValues.Automatic;
        }
        private void SetAllNull()
        {
            Cfvo1               = new SLConditionalFormattingValueObject2010();
            Cfvo2               = new SLConditionalFormattingValueObject2010();
            FillColor           = new SLColor(new List <Color>(), new List <Color>());
            BorderColor         = new SLColor(new List <Color>(), new List <Color>());
            NegativeFillColor   = new SLColor(new List <Color>(), new List <Color>());
            NegativeBorderColor = new SLColor(new List <Color>(), new List <Color>());
            AxisColor           = new SLColor(new List <Color>(), new List <Color>());

            MinLength = 10;
            MaxLength = 90;
            ShowValue = true;
            Border    = false;
            Gradient  = true;
            Direction = X14.DataBarDirectionValues.Context;
            NegativeBarColorSameAsPositive       = false;
            NegativeBarBorderColorSameAsPositive = true;
            AxisPosition = X14.DataBarAxisPositionValues.Automatic;
        }
Esempio n. 3
0
        private void InitialiseDataBarOptions(SLConditionalFormatDataBarValues DataBar, bool Is2010Default)
        {
            this.Is2010 = Is2010Default;

            this.FillColor           = new SLColor(new List <System.Drawing.Color>(), new List <System.Drawing.Color>());
            this.BorderColor         = new SLColor(new List <System.Drawing.Color>(), new List <System.Drawing.Color>());
            this.NegativeFillColor   = new SLColor(new List <System.Drawing.Color>(), new List <System.Drawing.Color>());
            this.NegativeBorderColor = new SLColor(new List <System.Drawing.Color>(), new List <System.Drawing.Color>());
            this.AxisColor           = new SLColor(new List <System.Drawing.Color>(), new List <System.Drawing.Color>());

            switch (DataBar)
            {
            case SLConditionalFormatDataBarValues.Blue:
                this.FillColor.Color   = System.Drawing.Color.FromArgb(0xFF, 0x63, 0x8E, 0xC6);
                this.BorderColor.Color = System.Drawing.Color.FromArgb(0xFF, 0x63, 0x8E, 0xC6);
                break;

            case SLConditionalFormatDataBarValues.Green:
                this.FillColor.Color   = System.Drawing.Color.FromArgb(0xFF, 0x63, 0xC3, 0x84);
                this.BorderColor.Color = System.Drawing.Color.FromArgb(0xFF, 0x63, 0xC3, 0x84);
                break;

            case SLConditionalFormatDataBarValues.Red:
                this.FillColor.Color   = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0x55, 0x5A);
                this.BorderColor.Color = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0x55, 0x5A);
                break;

            case SLConditionalFormatDataBarValues.Orange:
                this.FillColor.Color   = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0xB6, 0x28);
                this.BorderColor.Color = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0xB6, 0x28);
                break;

            case SLConditionalFormatDataBarValues.LightBlue:
                this.FillColor.Color   = System.Drawing.Color.FromArgb(0xFF, 0x00, 0x8A, 0xEF);
                this.BorderColor.Color = System.Drawing.Color.FromArgb(0xFF, 0x00, 0x8A, 0xEF);
                break;

            case SLConditionalFormatDataBarValues.Purple:
                this.FillColor.Color   = System.Drawing.Color.FromArgb(0xFF, 0xD6, 0x00, 0x7B);
                this.BorderColor.Color = System.Drawing.Color.FromArgb(0xFF, 0xD6, 0x00, 0x7B);
                break;
            }

            this.NegativeFillColor.Color   = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0x00, 0x00);
            this.NegativeBorderColor.Color = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0x00, 0x00);
            this.AxisColor.Color           = System.Drawing.Color.FromArgb(0xFF, 0x00, 0x00, 0x00);

            if (Is2010Default)
            {
                this.vMinimumType = SLConditionalFormatAutoMinMaxValues.Automatic;
                this.MinimumValue = string.Empty;
                this.vMaximumType = SLConditionalFormatAutoMinMaxValues.Automatic;
                this.MaximumValue = string.Empty;
                this.MinLength    = 0;
                this.MaxLength    = 100;
            }
            else
            {
                this.vMinimumType = SLConditionalFormatAutoMinMaxValues.Value;
                this.MinimumValue = string.Empty;
                this.vMaximumType = SLConditionalFormatAutoMinMaxValues.Value;
                this.MaximumValue = string.Empty;
                this.MinLength    = 10;
                this.MaxLength    = 90;
            }

            this.ShowBarOnly = false;
            this.bBorder     = false;
            this.bGradient   = false;
            this.vDirection  = X14.DataBarDirectionValues.Context;
            this.bNegativeBarColorSameAsPositive       = false;
            this.bNegativeBarBorderColorSameAsPositive = true;
            this.vAxisPosition = X14.DataBarAxisPositionValues.Automatic;
        }
        private void InitialiseDataBarOptions(SLConditionalFormatDataBarValues DataBar, bool Is2010Default)
        {
            this.Is2010 = Is2010Default;

            this.FillColor = new SLColor(new List<System.Drawing.Color>(), new List<System.Drawing.Color>());
            this.BorderColor = new SLColor(new List<System.Drawing.Color>(), new List<System.Drawing.Color>());
            this.NegativeFillColor = new SLColor(new List<System.Drawing.Color>(), new List<System.Drawing.Color>());
            this.NegativeBorderColor = new SLColor(new List<System.Drawing.Color>(), new List<System.Drawing.Color>());
            this.AxisColor = new SLColor(new List<System.Drawing.Color>(), new List<System.Drawing.Color>());

            switch (DataBar)
            {
                case SLConditionalFormatDataBarValues.Blue:
                    this.FillColor.Color = System.Drawing.Color.FromArgb(0xFF, 0x63, 0x8E, 0xC6);
                    this.BorderColor.Color = System.Drawing.Color.FromArgb(0xFF, 0x63, 0x8E, 0xC6);
                    break;
                case SLConditionalFormatDataBarValues.Green:
                    this.FillColor.Color = System.Drawing.Color.FromArgb(0xFF, 0x63, 0xC3, 0x84);
                    this.BorderColor.Color = System.Drawing.Color.FromArgb(0xFF, 0x63, 0xC3, 0x84);
                    break;
                case SLConditionalFormatDataBarValues.Red:
                    this.FillColor.Color = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0x55, 0x5A);
                    this.BorderColor.Color = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0x55, 0x5A);
                    break;
                case SLConditionalFormatDataBarValues.Orange:
                    this.FillColor.Color = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0xB6, 0x28);
                    this.BorderColor.Color = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0xB6, 0x28);
                    break;
                case SLConditionalFormatDataBarValues.LightBlue:
                    this.FillColor.Color = System.Drawing.Color.FromArgb(0xFF, 0x00, 0x8A, 0xEF);
                    this.BorderColor.Color = System.Drawing.Color.FromArgb(0xFF, 0x00, 0x8A, 0xEF);
                    break;
                case SLConditionalFormatDataBarValues.Purple:
                    this.FillColor.Color = System.Drawing.Color.FromArgb(0xFF, 0xD6, 0x00, 0x7B);
                    this.BorderColor.Color = System.Drawing.Color.FromArgb(0xFF, 0xD6, 0x00, 0x7B);
                    break;
            }

            this.NegativeFillColor.Color = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0x00, 0x00);
            this.NegativeBorderColor.Color = System.Drawing.Color.FromArgb(0xFF, 0xFF, 0x00, 0x00);
            this.AxisColor.Color = System.Drawing.Color.FromArgb(0xFF, 0x00, 0x00, 0x00);

            if (Is2010Default)
            {
                this.vMinimumType = SLConditionalFormatAutoMinMaxValues.Automatic;
                this.MinimumValue = string.Empty;
                this.vMaximumType = SLConditionalFormatAutoMinMaxValues.Automatic;
                this.MaximumValue = string.Empty;
                this.MinLength = 0;
                this.MaxLength = 100;
            }
            else
            {
                this.vMinimumType = SLConditionalFormatAutoMinMaxValues.Value;
                this.MinimumValue = string.Empty;
                this.vMaximumType = SLConditionalFormatAutoMinMaxValues.Value;
                this.MaximumValue = string.Empty;
                this.MinLength = 10;
                this.MaxLength = 90;
            }

            this.ShowBarOnly = false;
            this.bBorder = false;
            this.bGradient = false;
            this.vDirection = X14.DataBarDirectionValues.Context;
            this.bNegativeBarColorSameAsPositive = false;
            this.bNegativeBarBorderColorSameAsPositive = true;
            this.vAxisPosition = X14.DataBarAxisPositionValues.Automatic;
        }
Esempio n. 5
0
        internal void FromDataBar(X14.DataBar db)
        {
            this.SetAllNull();

            using (OpenXmlReader oxr = OpenXmlReader.Create(db))
            {
                int i = 0;
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(X14.ConditionalFormattingValueObject))
                    {
                        if (i == 0)
                        {
                            this.Cfvo1.FromConditionalFormattingValueObject((X14.ConditionalFormattingValueObject)oxr.LoadCurrentElement());
                            ++i;
                        }
                        else if (i == 1)
                        {
                            this.Cfvo2.FromConditionalFormattingValueObject((X14.ConditionalFormattingValueObject)oxr.LoadCurrentElement());
                            ++i;
                        }
                    }
                    else if (oxr.ElementType == typeof(X14.FillColor))
                    {
                        this.FillColor.FromFillColor((X14.FillColor)oxr.LoadCurrentElement());
                    }
                    else if (oxr.ElementType == typeof(X14.BorderColor))
                    {
                        this.BorderColor.FromBorderColor((X14.BorderColor)oxr.LoadCurrentElement());
                    }
                    else if (oxr.ElementType == typeof(X14.NegativeFillColor))
                    {
                        this.NegativeFillColor.FromNegativeFillColor((X14.NegativeFillColor)oxr.LoadCurrentElement());
                    }
                    else if (oxr.ElementType == typeof(X14.NegativeBorderColor))
                    {
                        this.NegativeBorderColor.FromNegativeBorderColor((X14.NegativeBorderColor)oxr.LoadCurrentElement());
                    }
                    else if (oxr.ElementType == typeof(X14.BarAxisColor))
                    {
                        this.AxisColor.FromBarAxisColor((X14.BarAxisColor)oxr.LoadCurrentElement());
                    }
                }
            }

            if (db.MinLength != null)
            {
                this.MinLength = db.MinLength.Value;
            }
            if (db.MaxLength != null)
            {
                this.MaxLength = db.MaxLength.Value;
            }
            if (db.ShowValue != null)
            {
                this.ShowValue = db.ShowValue.Value;
            }
            if (db.Border != null)
            {
                this.Border = db.Border.Value;
            }
            if (db.Gradient != null)
            {
                this.Gradient = db.Gradient.Value;
            }
            if (db.Direction != null)
            {
                this.Direction = db.Direction.Value;
            }
            if (db.NegativeBarColorSameAsPositive != null)
            {
                this.NegativeBarColorSameAsPositive = db.NegativeBarColorSameAsPositive.Value;
            }
            if (db.NegativeBarBorderColorSameAsPositive != null)
            {
                this.NegativeBarBorderColorSameAsPositive = db.NegativeBarBorderColorSameAsPositive.Value;
            }
            if (db.AxisPosition != null)
            {
                this.AxisPosition = db.AxisPosition.Value;
            }
        }