public override int GetHashCode() { int num1 = 0; num1 ^= this.HorizontalAlignment.GetHashCode(); num1 ^= this.VerticalAlignment.GetHashCode(); num1 ^= this.PatternStyle.GetHashCode(); num1 ^= this.PatternBackgroundColor.GetHashCode(); num1 ^= this.PatternForegroundColor.GetHashCode(); num1 = Utilities.RotateLeft(num1, (byte)8); num1 ^= this.Indent; num1 ^= this.Rotation; num1 ^= this.Locked.GetHashCode(); num1 ^= this.FormulaHidden.GetHashCode(); num1 ^= this.WrapText.GetHashCode(); num1 ^= this.ShrinkToFit.GetHashCode(); num1 = Utilities.RotateLeft(num1, (byte)8); num1 ^= this.NumberFormat.GetHashCode(); num1 ^= this.FontData.GetHashCode(); num1 ^= this.BordersUsed.GetHashCode(); for (int num2 = 0; num2 < 4; num2++) { if ((this.BordersUsed & CellBorder.MultipleFromIndividualBorder((IndividualBorder)num2)) != MultipleBorders.None) { num1 ^= this.BorderStyle[num2].GetHashCode(); num1 ^= this.BorderColor[num2].GetHashCode(); } } if ((this.BordersUsed & MultipleBorders.Diagonal) != MultipleBorders.None) { num1 ^= this.BorderStyle[4].GetHashCode(); num1 ^= this.BorderColor[4].GetHashCode(); } return(num1); }
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); } }
///<summary> ///Sets specific line color and line style on multiple borders. ///</summary> ///<param name="multipleBorders">Borders to set.</param> ///<param name="lineColor">Border line color.</param> ///<param name="lineStyle">Border line style.</param> public void SetBorders(MultipleBorders multipleBorders, Color lineColor, LineStyle lineStyle) { for (int num1 = 0; num1 < 6; num1++) { IndividualBorder border1 = (IndividualBorder)num1; if ((multipleBorders & CellBorder.MultipleFromIndividualBorder(border1)) != MultipleBorders.None) { this[border1].SetBorder(lineColor, lineStyle); } } }
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); }
internal CellStyle StyleResolved(int row, int column) { if (this.IsStyleDefault) { return(null); } IndividualBorder[] borderArray1 = new IndividualBorder[4]; int num1 = 0; CellBorder border1 = this.style.Borders[IndividualBorder.Bottom]; if ((border1.LineStyle != LineStyle.None) && (row < base.LastRowIndex)) { borderArray1[num1++] = IndividualBorder.Bottom; } border1 = this.style.Borders[IndividualBorder.Top]; if ((border1.LineStyle != LineStyle.None) && (row > base.FirstRowIndex)) { borderArray1[num1++] = IndividualBorder.Top; } border1 = this.style.Borders[IndividualBorder.Right]; if ((border1.LineStyle != LineStyle.None) && (column < base.LastColumnIndex)) { borderArray1[num1++] = IndividualBorder.Right; } border1 = this.style.Borders[IndividualBorder.Left]; if ((border1.LineStyle != LineStyle.None) && (column > base.FirstColumnIndex)) { borderArray1[num1++] = IndividualBorder.Left; } if (num1 == 0) { return(this.style); } CellStyle style1 = new CellStyle(this.style, this.style.Element.ParentCollection); for (int num2 = 0; num2 < num1; num2++) { style1.Borders[borderArray1[num2]].SetBorder(Color.Empty, LineStyle.None); } return(style1); }
private static void ResolveBorder(CellStyle bordersStyle, MergedCellRange mergedRange, IndividualBorder borderId, int row, int column, int rowInc, int colInc) { CellBorder border1 = bordersStyle.Borders[borderId]; bool flag1 = true; while ((row < mergedRange.Height) && (column < mergedRange.Width)) { CellBorder border2 = mergedRange[row, column].Style.Borders[borderId]; if (flag1) { border1.LineStyle = border2.LineStyle; border1.LineColor = border2.LineColor; flag1 = false; } else if ((border2.LineStyle != border1.LineStyle) || (border2.LineColor != border1.LineColor)) { border1.LineStyle = LineStyle.None; border1.LineColor = Color.Empty; return; } row += rowInc; column += colInc; } }
// Methods internal CellBorder(CellStyle parent, IndividualBorder borderId) { this.parent = parent; this.borderId = borderId; this.borderIndex = CellBorder.IndexFromIndividualBorder(borderId); }