Table of Contents

Class CustomFormatterData

Namespace
Microsoft.Practices.EnterpriseLibrary.Logging.Configuration
Assembly
Microsoft.Practices.EnterpriseLibrary.Logging.dll

Configuration object for custom log formatters.

public class CustomFormatterData : FormatterData, IHelperAssistedCustomConfigurationData<CustomFormatterData>, ICustomProviderData
Inheritance
CustomFormatterData
Implements
IHelperAssistedCustomConfigurationData<CustomFormatterData>
ICustomProviderData

Constructors

CustomFormatterData()

Initializes with default values.

public CustomFormatterData()

CustomFormatterData(string, string)

Initializes with name and provider type.

public CustomFormatterData(string name, string typeName)

Parameters

name string
typeName string

CustomFormatterData(string, Type)

Initializes with name and provider type.

public CustomFormatterData(string name, Type type)

Parameters

name string
type Type

Properties

Attributes

Gets or sets custom configuration attributes.

public NameValueCollection Attributes { get; }

Property Value

NameValueCollection

Properties

Gets a System.Configuration.ConfigurationPropertyCollection of the properties that are defined for this configuration element when implemented in a derived class.

protected override ConfigurationPropertyCollection Properties { get; }

Property Value

ConfigurationPropertyCollection

A System.Configuration.ConfigurationPropertyCollection of the properties that are defined for this configuration element when implemented in a derived class.

TypeName

Overridden in order to apply BrowsableAttribute.

[Browsable(true)]
public override string TypeName { get; set; }

Property Value

string

Methods

BuildFormatter()

Builds the ILogFormatter object represented by this configuration object.

public override ILogFormatter BuildFormatter()

Returns

ILogFormatter

A formatter.

IsModified()

Indicates whether this configuration element has been modified since it was last saved or loaded when implemented in a derived class.

protected override bool IsModified()

Returns

bool

true if the element has been modified; otherwise, false.

OnDeserializeUnrecognizedAttribute(string, string)

Called when an unknown attribute is encountered while deserializing the CustomFormatterData object.

protected override bool OnDeserializeUnrecognizedAttribute(string name, string value)

Parameters

name string

The name of the unrecognized attribute.

value string

The value of the unrecognized attribute.

Returns

bool

true if the processing of the element should continue; otherwise, false.

Reset(ConfigurationElement)

Resets the internal state of the CustomFormatterData object, including the locks and the properties collection.

protected override void Reset(ConfigurationElement parentElement)

Parameters

parentElement ConfigurationElement

The parent element.

SetAttributeValue(string, string)

Sets the attribute value for a key.

public void SetAttributeValue(string key, string value)

Parameters

key string

The attribute name.

value string

The attribute value.

Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

Modifies the CustomFormatterData object to remove all values that should not be saved.

protected override void Unmerge(ConfigurationElement sourceElement, ConfigurationElement parentElement, ConfigurationSaveMode saveMode)

Parameters

sourceElement ConfigurationElement

A System.Configuration.ConfigurationElement object at the current level containing a merged view of the properties.

parentElement ConfigurationElement

A parent System.Configuration.ConfigurationElement object or null if this is the top level.

saveMode ConfigurationSaveMode

One of the System.Configuration.ConfigurationSaveMode values.