/// <summary>
 /// Get the text from the right section of the header.
 /// </summary>
 /// <param name="HeaderType">The header type.</param>
 /// <returns>The text.</returns>
 public string GetRightHeaderText(SLHeaderFooterTypeValues HeaderType)
 {
     return GetHeaderFooterText(true, HeaderType, SLHeaderFooterSectionValues.Right);
 }
 /// <summary>
 /// Get the text from the center section of the header.
 /// </summary>
 /// <param name="HeaderType">The header type.</param>
 /// <returns>The text.</returns>
 public string GetCenterHeaderText(SLHeaderFooterTypeValues HeaderType)
 {
     return GetHeaderFooterText(true, HeaderType, SLHeaderFooterSectionValues.Center);
 }
 /// <summary>
 /// Get the text from the right section of the footer.
 /// </summary>
 /// <param name="FooterType">The footer type.</param>
 /// <returns>The text.</returns>
 public string GetRightFooterText(SLHeaderFooterTypeValues FooterType)
 {
     return GetHeaderFooterText(false, FooterType, SLHeaderFooterSectionValues.Right);
 }
        private void SetHeaderFooterText(bool IsHeader, SLHeaderFooterTypeValues Type, SLHeaderFooterSectionValues Section, string Text)
        {
            string result = TranslateToInternalCode(Text);
            string sLeft = string.Empty, sCenter = string.Empty, sRight = string.Empty;
            if (IsHeader)
            {
                if (Type == SLHeaderFooterTypeValues.Even) this.SplitHeaderFooterText(this.EvenHeaderText, out sLeft, out sCenter, out sRight);
                else if (Type == SLHeaderFooterTypeValues.First) this.SplitHeaderFooterText(this.FirstHeaderText, out sLeft, out sCenter, out sRight);
                else this.SplitHeaderFooterText(this.OddHeaderText, out sLeft, out sCenter, out sRight);
            }
            else
            {
                if (Type == SLHeaderFooterTypeValues.Even) this.SplitHeaderFooterText(this.EvenFooterText, out sLeft, out sCenter, out sRight);
                else if (Type == SLHeaderFooterTypeValues.First) this.SplitHeaderFooterText(this.FirstFooterText, out sLeft, out sCenter, out sRight);
                else this.SplitHeaderFooterText(this.OddFooterText, out sLeft, out sCenter, out sRight);
            }

            if (Section == SLHeaderFooterSectionValues.Left) sLeft = result;
            else if (Section == SLHeaderFooterSectionValues.Right) sRight = result;
            else sCenter = result;

            result = string.Empty;

            if (sLeft.Length > 0) result += "&L" + sLeft;
            if (sCenter.Length > 0) result += "&C" + sCenter;
            if (sRight.Length > 0) result += "&R" + sRight;

            if (IsHeader)
            {
                if (Type == SLHeaderFooterTypeValues.Even) this.EvenHeaderText = result;
                else if (Type == SLHeaderFooterTypeValues.First) this.FirstHeaderText = result;
                else this.OddHeaderText = result;
            }
            else
            {
                if (Type == SLHeaderFooterTypeValues.Even) this.EvenFooterText = result;
                else if (Type == SLHeaderFooterTypeValues.First) this.FirstFooterText = result;
                else this.OddFooterText = result;
            }
        }
 /// <summary>
 /// Get the text from the center section of the footer.
 /// </summary>
 /// <param name="FooterType">The footer type.</param>
 /// <returns>The text.</returns>
 public string GetCenterFooterText(SLHeaderFooterTypeValues FooterType)
 {
     return GetHeaderFooterText(false, FooterType, SLHeaderFooterSectionValues.Center);
 }
        private string GetHeaderFooterText(bool IsHeader, SLHeaderFooterTypeValues Type, SLHeaderFooterSectionValues Section)
        {
            string result = string.Empty;
            string sLeft = string.Empty, sCenter = string.Empty, sRight = string.Empty;
            if (IsHeader)
            {
                if (Type == SLHeaderFooterTypeValues.Even) this.SplitHeaderFooterText(this.EvenHeaderText, out sLeft, out sCenter, out sRight);
                else if (Type == SLHeaderFooterTypeValues.First) this.SplitHeaderFooterText(this.FirstHeaderText, out sLeft, out sCenter, out sRight);
                else this.SplitHeaderFooterText(this.OddHeaderText, out sLeft, out sCenter, out sRight);
            }
            else
            {
                if (Type == SLHeaderFooterTypeValues.Even) this.SplitHeaderFooterText(this.EvenFooterText, out sLeft, out sCenter, out sRight);
                else if (Type == SLHeaderFooterTypeValues.First) this.SplitHeaderFooterText(this.FirstFooterText, out sLeft, out sCenter, out sRight);
                else this.SplitHeaderFooterText(this.OddFooterText, out sLeft, out sCenter, out sRight);
            }

            if (Section == SLHeaderFooterSectionValues.Left) result = sLeft;
            else if (Section == SLHeaderFooterSectionValues.Right) result = sRight;
            else result = sCenter;

            result = TranslateToUserFriendlyCode(result);

            return result;
        }
 /// <summary>
 /// Set the text of the right section of the header.
 /// </summary>
 /// <param name="HeaderType">The header type.</param>
 /// <param name="Text">The text.</param>
 public void SetRightHeaderText(SLHeaderFooterTypeValues HeaderType, string Text)
 {
     SetHeaderFooterText(true, HeaderType, SLHeaderFooterSectionValues.Right, Text);
 }
 /// <summary>
 /// Set the text of the right section of the footer.
 /// </summary>
 /// <param name="FooterType">The footer type.</param>
 /// <param name="Text">The text.</param>
 public void SetRightFooterText(SLHeaderFooterTypeValues FooterType, string Text)
 {
     SetHeaderFooterText(false, FooterType, SLHeaderFooterSectionValues.Right, Text);
 }
 /// <summary>
 /// Set the text of the center section of the header.
 /// </summary>
 /// <param name="HeaderType">The header type.</param>
 /// <param name="Text">The text.</param>
 public void SetCenterHeaderText(SLHeaderFooterTypeValues HeaderType, string Text)
 {
     SetHeaderFooterText(true, HeaderType, SLHeaderFooterSectionValues.Center, Text);
 }
 /// <summary>
 /// Set the text of the center section of the footer.
 /// </summary>
 /// <param name="FooterType">The footer type.</param>
 /// <param name="Text">The text.</param>
 public void SetCenterFooterText(SLHeaderFooterTypeValues FooterType, string Text)
 {
     SetHeaderFooterText(false, FooterType, SLHeaderFooterSectionValues.Center, Text);
 }