/// <summary> /// Default constructor /// </summary> public Style() { CurrentBorder = new Border(); CurrentCellXf = new CellXf(); CurrentFill = new Fill(); CurrentFont = new Font(); CurrentNumberFormat = new NumberFormat(); styleNameDefined = false; name = this.GetHashCode().ToString(); }
/// <summary> /// Constructor with parameters /// </summary> /// <param name="name">Name of the style</param> public Style(string name) { CurrentBorder = new Border(); CurrentCellXf = new CellXf(); CurrentFill = new Fill(); CurrentFont = new Font(); CurrentNumberFormat = new NumberFormat(); styleNameDefined = false; this.name = name; }
/// <summary> /// Constructor with parameters (internal use) /// </summary> /// <param name="name">Name of the style</param> /// <param name="forcedOrder">Number of the style for sorting purpose. Style will be placed to this position (internal use only)</param> /// <param name="internalStyle">If true, the style is marked as internal</param> public Style(string name, int forcedOrder, bool internalStyle) { CurrentBorder = new Border(); CurrentCellXf = new CellXf(); CurrentFill = new Fill(); CurrentFont = new Font(); CurrentNumberFormat = new NumberFormat(); this.name = name; InternalID = forcedOrder; this.internalStyle = internalStyle; styleNameDefined = true; }
/// <summary> /// Method to copy the current object to a new one without casting /// </summary> /// <returns>Copy of the current object without the internal ID</returns> public override AbstractStyle Copy() { CellXf copy = new CellXf(); copy.HorizontalAlign = HorizontalAlign; copy.Alignment = Alignment; copy.TextDirection = TextDirection; copy.TextRotation = TextRotation; copy.VerticalAlign = VerticalAlign; copy.ForceApplyAlignment = ForceApplyAlignment; copy.Locked = Locked; copy.Hidden = Hidden; copy.Indent = Indent; return(copy); }