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 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 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); }