private void SetUsedIfNotDefault() { CellStyleData element = this.parent.Element; if ((element.BorderStyle[this.borderIndex] != ebexcel.LineStyle.None) || (element.BorderColor[this.borderIndex].ToArgb() != Color.Black.ToArgb())) { element.BordersUsed |= MultipleFromIndividualBorder(this.borderId); } }
internal CellStyle(CellStyle style, WeakHashtable parentCollection) { this.UseFlags = CellStyleData.Properties.None; this.element = style.element; if (!this.element.IsInCache || (this.element.ParentCollection != parentCollection)) { this.CloneElement(parentCollection); this.AddToQueue(); } this.UseFlags = style.UseFlags; }
internal void CopyTo(CellStyle destination) { CellStyleData element = destination.Element; CellStyleData data2 = this.parent.Element; for (int i = 0; i < 5; i++) { element.BorderColor[i] = data2.BorderColor[i]; element.BorderStyle[i] = data2.BorderStyle[i]; } element.BordersUsed = data2.BordersUsed; }
public override bool Equals(object obj) { CellStyleData data = (CellStyleData)obj; if (((data.HorizontalAlignment == this.HorizontalAlignment) && (data.VerticalAlignment == this.VerticalAlignment)) && (data.PatternStyle == this.PatternStyle)) { int introduced3 = data.PatternBackgroundColor.ToArgb(); if (introduced3 == this.PatternBackgroundColor.ToArgb()) { int introduced4 = data.PatternForegroundColor.ToArgb(); if ((((introduced4 == this.PatternForegroundColor.ToArgb()) && (data.Indent == this.Indent)) && ((data.Rotation == this.Rotation) && (data.Locked == this.Locked))) && (((data.FormulaHidden == this.FormulaHidden) && (data.WrapText == this.WrapText)) && ((data.ShrinkToFit == this.ShrinkToFit) && (data.NumberFormat == this.NumberFormat)))) { if (!data.FontData.Equals(this.FontData)) { return(false); } if (data.BordersUsed != this.BordersUsed) { return(false); } for (int i = 0; i < 4; i++) { if ((this.BordersUsed & CellBorder.MultipleFromIndividualBorder((IndividualBorder)i)) != MultipleBorders.None) { if (data.BorderColor[i].ToArgb() != this.BorderColor[i].ToArgb()) { return(false); } if (data.BorderStyle[i] != this.BorderStyle[i]) { return(false); } } } if ((this.BordersUsed & MultipleBorders.Diagonal) != MultipleBorders.None) { if (data.BorderColor[4].ToArgb() != this.BorderColor[4].ToArgb()) { return(false); } if (data.BorderStyle[4] != this.BorderStyle[4]) { return(false); } } return(true); } } } return(false); }
internal void CopyIfNotUsed(CellStyle lowerPriority) { this.BeforeChange(); CellStyleData element = this.element; CellStyleData data2 = lowerPriority.element; if ((this.UseFlags & CellStyleData.Properties.HorizontalAlignment) == CellStyleData.Properties.None) { element.HorizontalAlignment = data2.HorizontalAlignment; } if ((this.UseFlags & CellStyleData.Properties.VerticalAlignment) == CellStyleData.Properties.None) { element.VerticalAlignment = data2.VerticalAlignment; } if ((this.UseFlags & CellStyleData.Properties.PatternStyle) == CellStyleData.Properties.None) { element.PatternStyle = data2.PatternStyle; } if ((this.UseFlags & CellStyleData.Properties.PatternBackgroundColor) == CellStyleData.Properties.None) { element.PatternBackgroundColor = data2.PatternBackgroundColor; } if ((this.UseFlags & CellStyleData.Properties.PatternForegroundColor) == CellStyleData.Properties.None) { element.PatternForegroundColor = data2.PatternForegroundColor; } if ((this.UseFlags & CellStyleData.Properties.Indent) == CellStyleData.Properties.None) { element.Indent = data2.Indent; } if ((this.UseFlags & CellStyleData.Properties.Rotation) == CellStyleData.Properties.None) { element.Rotation = data2.Rotation; } if ((this.UseFlags & CellStyleData.Properties.Locked) == CellStyleData.Properties.None) { element.Locked = data2.Locked; } if ((this.UseFlags & CellStyleData.Properties.FormulaHidden) == CellStyleData.Properties.None) { element.FormulaHidden = data2.FormulaHidden; } if ((this.UseFlags & CellStyleData.Properties.WrapText) == CellStyleData.Properties.None) { element.WrapText = data2.WrapText; } if ((this.UseFlags & CellStyleData.Properties.ShrinkToFit) == CellStyleData.Properties.None) { element.ShrinkToFit = data2.ShrinkToFit; } if ((this.UseFlags & CellStyleData.Properties.NumberFormat) == CellStyleData.Properties.None) { element.NumberFormat = data2.NumberFormat; } if ((this.UseFlags & CellStyleData.Properties.FontName) == CellStyleData.Properties.None) { element.FontData.Name = data2.FontData.Name; } if ((this.UseFlags & CellStyleData.Properties.FontColor) == CellStyleData.Properties.None) { element.FontData.Color = data2.FontData.Color; } if ((this.UseFlags & CellStyleData.Properties.FontWeight) == CellStyleData.Properties.None) { element.FontData.Weight = data2.FontData.Weight; } if ((this.UseFlags & CellStyleData.Properties.FontSize) == CellStyleData.Properties.None) { element.FontData.Size = data2.FontData.Size; } if ((this.UseFlags & CellStyleData.Properties.FontItalic) == CellStyleData.Properties.None) { element.FontData.Italic = data2.FontData.Italic; } if ((this.UseFlags & CellStyleData.Properties.FontStrikeout) == CellStyleData.Properties.None) { element.FontData.Strikeout = data2.FontData.Strikeout; } if ((this.UseFlags & CellStyleData.Properties.FontScriptPosition) == CellStyleData.Properties.None) { element.FontData.ScriptPosition = data2.FontData.ScriptPosition; } if ((this.UseFlags & CellStyleData.Properties.FontUnderlineStyle) == CellStyleData.Properties.None) { element.FontData.UnderlineStyle = data2.FontData.UnderlineStyle; } for (int i = 0; i < 4; i++) { if ((element.BordersUsed & CellBorder.MultipleFromIndividualBorder((IndividualBorder)i)) == MultipleBorders.None) { element.BorderColor[i] = data2.BorderColor[i]; element.BorderStyle[i] = data2.BorderStyle[i]; } } if ((element.BordersUsed & MultipleBorders.Diagonal) == MultipleBorders.None) { element.BorderColor[4] = data2.BorderColor[4]; element.BorderStyle[4] = data2.BorderStyle[4]; } element.BordersUsed |= data2.BordersUsed; this.UseFlags |= lowerPriority.UseFlags; }
internal void Consolidate() { this.element = (CellStyleData)this.element.FindExistingOrAddToCache(); }
private void CloneElement(WeakHashtable parentCollection) { this.element = (CellStyleData)this.element.Clone(parentCollection); }
internal CellStyle(CellStyleCachedCollection styleCollection) { this.UseFlags = CellStyleData.Properties.None; this.element = (CellStyleData)styleCollection.DefaultElement; }
public CellStyle() { this.UseFlags = CellStyleData.Properties.None; this.element = new CellStyleData(null, false); }