Beispiel #1
0
        private void SetUsedIfNotDefault()
        {
            CellStyleData data1 = this.parent.Element;

            if ((data1.BorderStyle[this.borderIndex] != MB.WinEIDrive.Excel.LineStyle.None) || (data1.BorderColor[this.borderIndex].ToArgb() != Color.Black.ToArgb()))
            {
                data1.BordersUsed |= CellBorder.MultipleFromIndividualBorder(this.borderId);
            }
        }
Beispiel #2
0
        internal void CopyTo(CellStyle destination)
        {
            CellStyleData data1 = destination.Element;
            CellStyleData data2 = this.parent.Element;

            for (int num1 = 0; num1 < 5; num1++)
            {
                data1.BorderColor[num1] = data2.BorderColor[num1];
                data1.BorderStyle[num1] = data2.BorderStyle[num1];
            }
            data1.BordersUsed = data2.BordersUsed;
        }
Beispiel #3
0
        public override bool Equals(object obj)
        {
            CellStyleData data1 = (CellStyleData)obj;

            if (((((data1.HorizontalAlignment != this.HorizontalAlignment) || (data1.VerticalAlignment != this.VerticalAlignment)) || ((data1.PatternStyle != this.PatternStyle) || (data1.PatternBackgroundColor.ToArgb() != this.PatternBackgroundColor.ToArgb()))) || (((data1.PatternForegroundColor.ToArgb() != this.PatternForegroundColor.ToArgb()) || (data1.Indent != this.Indent)) || ((data1.Rotation != this.Rotation) || (data1.Locked != this.Locked)))) || (((data1.FormulaHidden != this.FormulaHidden) || (data1.WrapText != this.WrapText)) || ((data1.ShrinkToFit != this.ShrinkToFit) || (data1.NumberFormat != this.NumberFormat))))
            {
                return(false);
            }
            if (!data1.FontData.Equals(this.FontData))
            {
                return(false);
            }
            if (data1.BordersUsed != this.BordersUsed)
            {
                return(false);
            }
            for (int num1 = 0; num1 < 4; num1++)
            {
                if ((this.BordersUsed & CellBorder.MultipleFromIndividualBorder((IndividualBorder)num1)) != MultipleBorders.None)
                {
                    if (data1.BorderColor[num1].ToArgb() != this.BorderColor[num1].ToArgb())
                    {
                        return(false);
                    }
                    if (data1.BorderStyle[num1] != this.BorderStyle[num1])
                    {
                        return(false);
                    }
                }
            }
            if ((this.BordersUsed & MultipleBorders.Diagonal) != MultipleBorders.None)
            {
                if (data1.BorderColor[4].ToArgb() != this.BorderColor[4].ToArgb())
                {
                    return(false);
                }
                if (data1.BorderStyle[4] != this.BorderStyle[4])
                {
                    return(false);
                }
            }
            return(true);
        }
Beispiel #4
0
        public override HashtableElement Clone(WeakHashtable parentCollection)
        {
            CellStyleData data1 = new CellStyleData((CellStyleCachedCollection)parentCollection, false);

            data1.HorizontalAlignment    = this.HorizontalAlignment;
            data1.VerticalAlignment      = this.VerticalAlignment;
            data1.PatternStyle           = this.PatternStyle;
            data1.PatternBackgroundColor = this.PatternBackgroundColor;
            data1.PatternForegroundColor = this.PatternForegroundColor;
            data1.Indent        = this.Indent;
            data1.Rotation      = this.Rotation;
            data1.Locked        = this.Locked;
            data1.FormulaHidden = this.FormulaHidden;
            data1.WrapText      = this.WrapText;
            data1.ShrinkToFit   = this.ShrinkToFit;
            data1.NumberFormat  = this.NumberFormat;
            data1.FontData      = new ExcelFontData(this.FontData);
            data1.BorderColor   = (Color[])this.BorderColor.Clone();
            data1.BorderStyle   = (LineStyle[])this.BorderStyle.Clone();
            data1.BordersUsed   = this.BordersUsed;
            return(data1);
        }