|
//===============================================================================
// Microsoft patterns & practices Enterprise Library
// Logging Application Block
//===============================================================================
// Copyright � Microsoft Corporation. All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing.Design;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design.Validation;
using Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.Design.Properties;
using Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.Design.Formatters;
namespace Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.Design.TraceListeners
{
/// <summary>
/// Represents a <see cref="TraceListenerData"/> configuration element. This class is abstract.
/// </summary>
[Image(typeof (TraceListenerNode))]
[SelectedImage(typeof (TraceListenerNode))]
public abstract class TraceListenerNode : ConfigurationNode
{
private TraceOptions traceOptions;
/// <summary>
/// Initialize a new instance of the <see cref="TraceListenerNode"/> class.
/// </summary>
protected TraceListenerNode()
{
}
/// <summary>
/// Gets or sets the trace options.
/// </summary>
/// <value>
/// One of the <see cref="TraceOptions"/> value.
/// </value>
[SRCategory("CategoryGeneral", typeof(Resources))]
[SRDescription("TraceOutputOptionsDescription", typeof(Resources))]
public TraceOptions TraceOutputOptions
{
get { return traceOptions; }
set { traceOptions = value; }
}
/// <summary>
/// Gets the <see cref="TraceListenerData"/> this node represents.
/// </summary>
/// <returns>The <see cref="TraceListenerData"/> this node represents..</returns>
[Browsable(false)]
public abstract TraceListenerData TraceListenerData { get; }
/// <summary>
/// Enumerates the formatters and allows a node to set it's formatter reference.
/// </summary>
/// <param name="formatters">A collection of formatter nodes.</param>
public void SetFormatter(ConfigurationNode formatters)
{
if (formatters == null) return;
formatters.Nodes.ForEach(new Action<ConfigurationNode>(SetFormatterReference));
}
/// <summary>
/// Sets the formatter to use for this listener.
/// </summary>
/// <param name="formatterNodeReference">
/// A <see cref="FormatterNode"/> reference or <see langword="null"/> if no formatter is defined.
/// </param>
protected virtual void SetFormatterReference(ConfigurationNode formatterNodeReference)
{
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.