public static string GetSwitch(CommonFieldGeneralFormatting formatting) { return(formatting switch { CommonFieldGeneralFormatting.AlphabeticUppercase => GeneralFormattingSwitches.ALPHABETIC, CommonFieldGeneralFormatting.AlphabeticLowercase => GeneralFormattingSwitches.alphabetic, CommonFieldGeneralFormatting.Capitalized => GeneralFormattingSwitches.Caps, CommonFieldGeneralFormatting.FirstLetterCapitalized => GeneralFormattingSwitches.FirstCap, CommonFieldGeneralFormatting.Lowercase => GeneralFormattingSwitches.Lower, CommonFieldGeneralFormatting.Uppercase => GeneralFormattingSwitches.Upper, CommonFieldGeneralFormatting.DollarText => GeneralFormattingSwitches.DollarText, _ => throw new ArgumentOutOfRangeException(nameof(formatting), formatting, null) });
public IEnumerable <Run> AppendNumberOfDocumentPages(CommonFieldGeneralFormatting formatting, bool charFormat, bool mergeFormat) { return(AppendComplexField(FieldType.NumPages, "", $"\\* {GeneralFormattingSwitchHelper.GetSwitch(formatting)}", charFormat, mergeFormat, Run.Create(" ", ParentContainer))); }