Click or drag to resize

MailSmartFormatter Class

The formatter used by MailMergeLib for replacing placeholders with variables' content.
Inheritance Hierarchy
SystemObject
  SmartFormatter
    MailMergeLibMailSmartFormatter

Namespace:  MailMergeLib
Assembly:  MailMergeLib (in MailMergeLib.dll) Version: 5.6.1.0
Syntax
public class MailSmartFormatter : SmartFormatter

The MailSmartFormatter type exposes the following members.

Constructors
  NameDescription
Protected methodMailSmartFormatter
Initializes a new instance of the MailSmartFormatter class
Protected methodMailSmartFormatter(SmartFormatterConfig)
CTOR. Create an instance which loads the Formatters and Source extensions required by MailMergeLib. Error actions are SmartFormatters defaults.
Top
Properties
  NameDescription
Public propertyErrorAction Obsolete. (Inherited from SmartFormatter.)
Public propertyFormatterExtensions (Inherited from SmartFormatter.)
Public propertyParser (Inherited from SmartFormatter.)
Public propertySettings (Inherited from SmartFormatter.)
Public propertySourceExtensions (Inherited from SmartFormatter.)
Protected propertyTemplates
Gets or sets the TemplateFormatter where the templates can be registered later on.
Top
Methods
  NameDescription
Public methodAddExtensions(ISource) (Inherited from SmartFormatter.)
Public methodAddExtensions(IFormatter) (Inherited from SmartFormatter.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFormat(FormattingInfo) (Inherited from SmartFormatter.)
Public methodFormat(String, Object) (Inherited from SmartFormatter.)
Public methodFormat(IFormatProvider, String, Object) (Inherited from SmartFormatter.)
Public methodFormatInto (Inherited from SmartFormatter.)
Public methodFormatWithCache (Inherited from SmartFormatter.)
Public methodFormatWithCacheInto (Inherited from SmartFormatter.)
Public methodGetFormatterExtension``1 (Inherited from SmartFormatter.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetNotEmptyFormatterExtensionNames (Inherited from SmartFormatter.)
Public methodGetSourceExtension``1 (Inherited from SmartFormatter.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodSetConfig
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Events
  NameDescription
Public eventOnFormattingFailure (Inherited from SmartFormatter.)
Top
Examples
Assume an object x with property "Name" a) Format depending on Name is null or string.Empty or other: Format("{Name:choose(null|):N/A|empty|{Name}}", x); b) Format DateTime requires the "named formatter" with name "default" because of the additional colons in the time format: SmartFormatter.Format("{Now:default:dd.MM.yyyy hh:mm:ss}", DateTime.Now);
See Also