-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTag.cs
More file actions
37 lines (31 loc) · 896 Bytes
/
Tag.cs
File metadata and controls
37 lines (31 loc) · 896 Bytes
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
// Copyright Bastian Eicher
// Licensed under the MIT License
using System;
using System.ComponentModel;
using System.Drawing;
using System.Xml.Serialization;
using NanoByte.Common;
namespace NanoByte.LightTag
{
public class Tag : INamed, IHighlightColor
{
[XmlAttribute]
public string Name { get; set; }
[XmlIgnore]
public Color HighlightColor { get; set; }
[XmlAttribute, Browsable(false)]
public string Color
{
get => ColorTranslator.ToHtml(HighlightColor);
set => HighlightColor = ColorTranslator.FromHtml(value);
}
public override string ToString()
{
return Name;
}
public int CompareTo(Tag other)
{
return string.Compare(Name, other.Name, StringComparison.Ordinal);
}
}
}