public XMLStyleModel(CT_Xf xf, StyleManager manager, bool setVerticalAlignment) { this._xf = xf; this._manager = manager; this._font = (((bool)this._xf.ApplyFont_Attr) ? this._manager.GetFont(this._xf.FontId_Attr) : new XMLFontModel(this._manager.Palette)); this._border = (((bool)this._xf.ApplyBorder_Attr) ? this._manager.GetBorder(this._xf.BorderId_Attr) : new XMLBorderModel(this._manager.Palette)); this._fill = (((bool)this._xf.ApplyFill_Attr) ? this._manager.GetFill(this._xf.FillId_Attr).DeepClone() : new XMLFillModel(this._manager.Palette)); if (setVerticalAlignment) { this.Alignment.Vertical_Attr = ST_VerticalAlignment.top; this.Alignment.WrapText_Attr = true; } }
private void Copy(IStyleModel srcStyle) { XMLStyleModel xMLStyleModel = (XMLStyleModel)srcStyle; this._hasBeenModified = xMLStyleModel._hasBeenModified; this._xf.ApplyAlignment_Attr = xMLStyleModel._xf.ApplyAlignment_Attr; this._xf.ApplyBorder_Attr = xMLStyleModel._xf.ApplyBorder_Attr; this._xf.ApplyFill_Attr = xMLStyleModel._xf.ApplyFill_Attr; this._xf.ApplyFont_Attr = xMLStyleModel._xf.ApplyFont_Attr; this._xf.ApplyNumberFormat_Attr = xMLStyleModel._xf.ApplyNumberFormat_Attr; this._xf.ApplyProtection_Attr = xMLStyleModel._xf.ApplyProtection_Attr; this._xf.NumFmtId_Attr = xMLStyleModel._xf.NumFmtId_Attr; if (xMLStyleModel._xf.BorderId_Attr_Is_Specified) { this._xf.BorderId_Attr = xMLStyleModel._xf.BorderId_Attr; } if (xMLStyleModel._xf.FillId_Attr_Is_Specified) { this._xf.FillId_Attr = xMLStyleModel._xf.FillId_Attr; } if (xMLStyleModel._xf.FontId_Attr_Is_Specified) { this._xf.FontId_Attr = xMLStyleModel._xf.FontId_Attr; } if (xMLStyleModel._xf.Alignment != null) { if (xMLStyleModel._xf.Alignment.Vertical_Attr_Is_Specified) { this.Alignment.Vertical_Attr = xMLStyleModel._xf.Alignment.Vertical_Attr; } if (xMLStyleModel.Alignment.Horizontal_Attr_Is_Specified) { this.Alignment.Horizontal_Attr = xMLStyleModel._xf.Alignment.Horizontal_Attr; } if (xMLStyleModel.Alignment.ReadingOrder_Attr_Is_Specified) { this.Alignment.ReadingOrder_Attr = xMLStyleModel._xf.Alignment.ReadingOrder_Attr; } if (xMLStyleModel.Alignment.WrapText_Attr_Is_Specified) { this.Alignment.WrapText_Attr = xMLStyleModel._xf.Alignment.WrapText_Attr; } if (xMLStyleModel.Alignment.ShrinkToFit_Attr_Is_Specified) { this.Alignment.ShrinkToFit_Attr = xMLStyleModel._xf.Alignment.ShrinkToFit_Attr; } if (xMLStyleModel.Alignment.Indent_Attr_Is_Specified) { this.Alignment.Indent_Attr = xMLStyleModel._xf.Alignment.Indent_Attr; } if (xMLStyleModel.Alignment.JustifyLastLine_Attr_Is_Specified) { this.Alignment.JustifyLastLine_Attr = xMLStyleModel._xf.Alignment.JustifyLastLine_Attr; } if (xMLStyleModel.Alignment.TextRotation_Attr_Is_Specified) { this.Alignment.TextRotation_Attr = xMLStyleModel._xf.Alignment.TextRotation_Attr; } } if (xMLStyleModel._numberformat != null) { this._numberformat = xMLStyleModel._numberformat; } if (xMLStyleModel._font != null) { this.Font = (XMLFontModel)xMLStyleModel._font.Clone(); } if (xMLStyleModel._fill != null) { this.Fill = xMLStyleModel._fill.DeepClone(); } if (xMLStyleModel._border != null) { this._border = xMLStyleModel._border.DeepClone(); } }
public uint AddBorder(XMLBorderModel model) { return(this._borders.Add(model)); }