aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Logging/MessageLogItem.cs
blob: b0b3e24ae84f5357a38c4196293a796b191f7403 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.Logging
{
    /// <summary>
    /// Represents an exception log item.
    /// </summary>
    [Serializable]
    public class MessageLogItem : LogItemBase
    {
        private String _message;
        /// <summary>
        /// Gets or sets the log message.
        /// </summary>
        public override string Message
        {
            get
            {
                return _message;
            }
            set
            {
                _message = value;
            }
        }

        /// <summary>
        /// Returns a formatted string of the log item.
        /// </summary>
        public override string ToString()
        {
            return String.Format("[{0}] [{5}] [{1}] [{2}] [{3}]: {4}", TimeStamp.ToString("HH:mm:ss.ff"), GetRelativeCallerFilePath(), CallerMethodName, CallerLineNumber, Message, Category);
        }
    }
}
ExplorerFileDefinition() { Icon = ResourceHelper.GetImageFromResources("/Images/folder.png") }; public static ExplorerFileDefinition File => new ExplorerFileDefinition() { Icon = ResourceHelper.GetImageFromResources("/Images/file.png"), Description = "Unknown Type" }; public static ExplorerFileDefinition Job => new ExplorerFileDefinition() { Icon = ResourceHelper.GetImageFromResources("/Images/job.png"), Description = "Tango Job Definition", Extension = ".job", }; public static ExplorerFileDefinition Pulse => new ExplorerFileDefinition() { Icon = ResourceHelper.GetImageFromResources("/Images/pulse.png"), Description = "Twine Embroidery Design", Extension = ".twn", }; public static ExplorerFileDefinition Update => new ExplorerFileDefinition() { Icon = ResourceHelper.GetImageFromResources("/Images/update.png"), Description = "Tango Software Update Package", Extension = ".tup", }; public static ExplorerFileDefinition ColorProfile => new ExplorerFileDefinition() { Icon = ResourceHelper.GetImageFromResources("/Images/color.png"), Description = "Tango Color Profile", Extension = ".ccp", }; static ExplorerFileDefinition() { _definitions = typeof(ExplorerFileDefinition).GetProperties(BindingFlags.Public | BindingFlags.Static).Where(x => x.PropertyType == typeof(ExplorerFileDefinition)).ToList().Select(x => x.GetValue(null,null) as ExplorerFileDefinition).ToList(); } public static ExplorerFileDefinition GetByExtension(String ext) { return _definitions.Where(x => x.Extension != null).SingleOrDefault(x => x.Extension.ToLower() == ext.ToLower()); //switch (ext.ToLower()) //{ // case ".job": // return Job; // case ".twn": // return Pulse; // case ".tup": // return Update; // case ".ccp": // return ColorProfile; // default: // return File; //} } public static List<String> GetSupportedExtensions() { return _definitions.Where(x => x.Extension != null).Select(x => x.Extension).ToList(); } } }