//
// BwgBurn - CD-R/CD-RW/DVD-R/DVD-RW burning program for Windows XP
//
// Copyright (C) 2006 by Jack W. Griffin (butchg@comcast.net)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the
//
// Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330,
// Boston, MA 02111-1307 USA
//
using System;
using System.Collections.Generic;
using System.Text;
namespace Bwg.Logging
{
///
/// A message to be logged to the u
///
public class UserMessage
{
#region Public Types
///
/// Message types
///
public enum Category
{
///
/// An error occurred
///
Error,
///
/// A warning occurred
///
Warning,
///
/// Information about the process
///
Info,
///
/// Debugging information
///
Debug
} ;
#endregion
#region Public Data Members
///
/// The category for the message (error, warning, info, debug)
///
public readonly Category MType ;
///
/// The numeric error code
///
public readonly uint Code ;
///
/// The text for the error message
///
public readonly string Text;
///
/// The level for the message, used to filter out messages
///
public readonly uint Level;
///
/// This member contains a time stamp for the message
///
public readonly DateTime When;
#endregion
#region constructor
///
/// Constructor for a message
///
/// Category of the message
/// Level of the message
/// Text of the message
public UserMessage(Category t, uint level, string s)
{
MType = t;
Text = s;
Level = level;
When = DateTime.Now;
}
#endregion
#region public member functions
///
/// This method converts a user message to a single string
///
/// the string that represnts the message
public override string ToString()
{
return When.ToLongDateString() + " " + When.ToLongTimeString() + " : " + MType.ToString() + " : Level " + Level.ToString() + " : " + Text;
}
#endregion
}
}