|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace App.Logger.Targets.ObjectHistoryLogger
{
/// <summary>
/// Attribute to define a property as loggable
/// </summary>
[global::System.AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
public sealed class LogPropertyAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="LogAttribute"/> class.
/// </summary>
public LogPropertyAttribute()
{
MappedName = string.Empty;
Description = string.Empty;
}
/// <summary>
/// Initializes a new instance of the <see cref="LogAttribute"/> class.
/// </summary>
/// <param name="mappedName">The logged object mapped name.</param>
/// <param name="description">The logged object description.</param>
public LogPropertyAttribute(string mappedName, string description)
{
MappedName = mappedName;
Description = description;
}
/// <summary>
/// Gets the name to be mapped on the target.
/// With this a logged object can have a different name on the log.
/// </summary>
/// <value>The logged object mapped name.</value>
public string MappedName { get; private set; }
/// <summary>
/// Gets the description associated with the logged object.
/// This is meant to add addicional data to the logged object.
/// </summary>
/// <value>The logged object description.</value>
public string Description { get; private set; }
}
}
|
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.