/// <summary> /// Append a format code to the first page footer. /// </summary> /// <param name="Code">The format code.</param> public void AppendFirstFooter(SLHeaderFooterFormatCodeValues Code) { if (this.HFSection != SLHeaderFooterSection.FirstFooter) ResetSwitches(); this.FirstFooterText += this.TextToAppend(Code); this.HFSection = SLHeaderFooterSection.FirstFooter; }
private string TextToAppend(SLHeaderFooterFormatCodeValues Code) { string result = string.Empty; switch (Code) { case SLHeaderFooterFormatCodeValues.Left: result = "&L"; ResetSwitches(); break; case SLHeaderFooterFormatCodeValues.Center: result = "&C"; ResetSwitches(); break; case SLHeaderFooterFormatCodeValues.Right: result = "&R"; ResetSwitches(); break; case SLHeaderFooterFormatCodeValues.PageNumber: result = "&P"; break; case SLHeaderFooterFormatCodeValues.NumberOfPages: result = "&N"; break; case SLHeaderFooterFormatCodeValues.Date: result = "&D"; break; case SLHeaderFooterFormatCodeValues.Time: result = "&T"; break; case SLHeaderFooterFormatCodeValues.FilePath: result = "&Z"; break; case SLHeaderFooterFormatCodeValues.FileName: result = "&F"; break; case SLHeaderFooterFormatCodeValues.SheetName: result = "&A"; break; case SLHeaderFooterFormatCodeValues.ResetFont: if (this.FontStyleSwitch) result += "&\"-,Regular\""; if (this.FontSizeSwitch) result += string.Format("&{0}", (int)SLConstants.DefaultFontSize); if (this.StrikeSwitch) result += "&S"; if (this.SuperscriptSwitch) result += "&X"; if (this.SubscriptSwitch) result += "&Y"; if (this.UnderlineSwitch) result += "&U"; if (this.DoubleUnderlineSwitch) result += "&E"; if (this.FontColorSwitch) result += "&K01+000"; ResetSwitches(); break; } return result; }