public IXLHeaderFooter Clear(XLHFOccurrence occurrence = XLHFOccurrence.AllPages) { Left.Clear(occurrence); Right.Clear(occurrence); Center.Clear(occurrence); return this; }
public IXLHeaderFooter Clear(XLHFOccurrence occurrence = XLHFOccurrence.AllPages) { Left.Clear(occurrence); Right.Clear(occurrence); Center.Clear(occurrence); return(this); }
internal String SetInnerText(XLHFOccurrence occurrence, String text) { var parsedElements = ParseFormattedHeaderFooterText(text); if (parsedElements.Any(e => e.Position == 'L')) { this.Left.AddText(string.Join("\r\n", parsedElements.Where(e => e.Position == 'L').Select(e => e.Text).ToArray()), occurrence); } if (parsedElements.Any(e => e.Position == 'C')) { this.Center.AddText(string.Join("\r\n", parsedElements.Where(e => e.Position == 'C').Select(e => e.Text).ToArray()), occurrence); } if (parsedElements.Any(e => e.Position == 'R')) { this.Right.AddText(string.Join("\r\n", parsedElements.Where(e => e.Position == 'R').Select(e => e.Text).ToArray()), occurrence); } if (innerTexts.ContainsKey(occurrence)) { innerTexts[occurrence] = text; } else { innerTexts.Add(occurrence, text); } return(innerTexts[occurrence]); }
private void AddTextToOccurrence(XLHFText hfText, XLHFOccurrence occurrence) { if (texts.ContainsKey(occurrence)) texts[occurrence].Add(hfText); else texts.Add(occurrence, new List<XLHFText> { hfText }); }
private void ClearOccurrence(XLHFOccurrence occurrence) { if (texts.ContainsKey(occurrence)) { texts.Remove(occurrence); } }
public IXLRichString AddText(XLHFPredefinedText predefinedText, XLHFOccurrence occurrence) { String hfText; switch (predefinedText) { case XLHFPredefinedText.PageNumber: hfText = "&P"; break; case XLHFPredefinedText.NumberOfPages: hfText = "&N"; break; case XLHFPredefinedText.Date: hfText = "&D"; break; case XLHFPredefinedText.Time: hfText = "&T"; break; case XLHFPredefinedText.Path: hfText = "&Z"; break; case XLHFPredefinedText.File: hfText = "&F"; break; case XLHFPredefinedText.SheetName: hfText = "&A"; break; case XLHFPredefinedText.FullPath: hfText = "&Z&F"; break; default: throw new NotImplementedException(); } return(AddText(hfText, occurrence)); }
internal String SetInnerText(XLHFOccurrence occurrence, String text) { if (innerTexts.ContainsKey(occurrence)) innerTexts[occurrence] = text; else innerTexts.Add(occurrence, text); return innerTexts[occurrence]; }
public String GetText(XLHFOccurrence occurrence) { var sb = new StringBuilder(); if(texts.ContainsKey(occurrence)) { foreach (var hfText in texts[occurrence]) sb.Append(hfText.GetHFText(sb.ToString())); } return sb.ToString(); }
private void AddTextToOccurrence(XLHFText hfText, XLHFOccurrence occurrence) { if (texts.ContainsKey(occurrence)) { texts[occurrence].Add(hfText); } else { texts.Add(occurrence, new List <XLHFText> { hfText }); } }
internal String SetInnerText(XLHFOccurrence occurrence, String text) { if (innerTexts.ContainsKey(occurrence)) { innerTexts[occurrence] = text; } else { innerTexts.Add(occurrence, text); } return(innerTexts[occurrence]); }
public void Clear(XLHFOccurrence occurrence = XLHFOccurrence.AllPages) { if (occurrence == XLHFOccurrence.AllPages) { ClearOccurrence(XLHFOccurrence.EvenPages); ClearOccurrence(XLHFOccurrence.FirstPage); ClearOccurrence(XLHFOccurrence.OddPages); } else { ClearOccurrence(occurrence); } }
public String GetText(XLHFOccurrence occurrence) { var sb = new StringBuilder(); if (texts.ContainsKey(occurrence)) { foreach (var hfText in texts[occurrence]) { sb.Append(hfText.GetHFText(sb.ToString())); } } return(sb.ToString()); }
public String GetText(XLHFOccurrence occurrence) { var sb = new StringBuilder(); if (texts.TryGetValue(occurrence, out List <XLHFText> hfTexts)) { foreach (var hfText in hfTexts) { sb.Append(hfText.GetHFText(sb.ToString())); } } return(sb.ToString()); }
private void AddTextToOccurrence(XLHFText hfText, XLHFOccurrence occurrence) { if (texts.TryGetValue(occurrence, out List <XLHFText> hfTexts)) { hfTexts.Add(hfText); } else { texts.Add(occurrence, new List <XLHFText> { hfText }); } this.HeaderFooter.Changed = true; }
public String GetText(XLHFOccurrence occurrence) { if (innerTexts.ContainsKey(occurrence)) return innerTexts[occurrence]; var retVal = String.Empty; var leftText = Left.GetText(occurrence); var centerText = Center.GetText(occurrence); var rightText = Right.GetText(occurrence); retVal += leftText.Length > 0 ? "&L" + leftText : String.Empty; retVal += centerText.Length > 0 ? "&C" + centerText : String.Empty; retVal += rightText.Length > 0 ? "&R" + rightText : String.Empty; if (retVal.Length > 255) throw new ArgumentOutOfRangeException("Headers and Footers cannot be longer than 255 characters (including style markups)"); return retVal; }
private void AddTextToOccurrence(XLHFText hfText, XLHFOccurrence occurrence) { if (texts.ContainsKey(occurrence)) { texts[occurrence].Add(hfText); } else { texts.Add(occurrence, new List <XLHFText> { hfText }); } this.HeaderFooter.Changed = true; }
public IXLRichString AddText(XLHFPredefinedText predefinedText, XLHFOccurrence occurrence) { String hfText; switch (predefinedText) { case XLHFPredefinedText.PageNumber: hfText = "&P"; break; case XLHFPredefinedText.NumberOfPages : hfText = "&N"; break; case XLHFPredefinedText.Date : hfText = "&D"; break; case XLHFPredefinedText.Time : hfText = "&T"; break; case XLHFPredefinedText.Path : hfText = "&Z"; break; case XLHFPredefinedText.File : hfText = "&F"; break; case XLHFPredefinedText.SheetName : hfText = "&A"; break; case XLHFPredefinedText.FullPath: hfText = "&Z&F"; break; default: throw new NotImplementedException(); } return AddText(hfText, occurrence); }
public IXLRichString AddText(String text, XLHFOccurrence occurrence) { XLRichString richText = new XLRichString(text, XLWorkbook.DefaultStyle.Font, this); var hfText = new XLHFText(richText, _worksheet); if (occurrence == XLHFOccurrence.AllPages) { AddTextToOccurrence(hfText, XLHFOccurrence.EvenPages); AddTextToOccurrence(hfText, XLHFOccurrence.FirstPage); AddTextToOccurrence(hfText, XLHFOccurrence.OddPages); } else { AddTextToOccurrence(hfText, occurrence); } return richText; }
public String GetText(XLHFOccurrence occurrence) { //if (innerTexts.ContainsKey(occurrence)) return innerTexts[occurrence]; var retVal = String.Empty; var leftText = Left.GetText(occurrence); var centerText = Center.GetText(occurrence); var rightText = Right.GetText(occurrence); retVal += leftText.Length > 0 ? "&L" + leftText : String.Empty; retVal += centerText.Length > 0 ? "&C" + centerText : String.Empty; retVal += rightText.Length > 0 ? "&R" + rightText : String.Empty; if (retVal.Length > 255) { throw new ArgumentOutOfRangeException("Headers and Footers cannot be longer than 255 characters (including style markups)"); } return(retVal); }
public IXLRichString AddText(String text, XLHFOccurrence occurrence) { XLRichString richText = new XLRichString(text, XLWorkbook.DefaultStyle.Font, this); var hfText = new XLHFText(richText, _worksheet); if (occurrence == XLHFOccurrence.AllPages) { AddTextToOccurrence(hfText, XLHFOccurrence.EvenPages); AddTextToOccurrence(hfText, XLHFOccurrence.FirstPage); AddTextToOccurrence(hfText, XLHFOccurrence.OddPages); } else { AddTextToOccurrence(hfText, occurrence); } return(richText); }
public IXLRichString AddImage(String imagePath, XLHFOccurrence occurrence = XLHFOccurrence.AllPages) { throw new NotImplementedException(); }
private void ClearOccurrence(XLHFOccurrence occurrence) { if (texts.ContainsKey(occurrence)) texts.Remove(occurrence); }
public void FooterLeft(XLHFPredefinedText _text, XLHFOccurrence _xlhfOccurence) { ws.PageSetup.Footer.Left.AddText(_text, _xlhfOccurence); }
public void FooterLeft(string _text, XLHFOccurrence _xlhfOccurence) { ws.PageSetup.Footer.Left.AddText(_text, _xlhfOccurence); }
public void FooterCenter(string _text, XLHFOccurrence _xlhfOccurence) { ws.PageSetup.Footer.Center.AddText(_text, _xlhfOccurence); }