forked from JasonLautzenheiser/trizbort
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRegion.cs
48 lines (41 loc) · 964 Bytes
/
Region.cs
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
41
42
43
44
45
46
47
48
using System;
using System.Drawing;
using System.Linq;
using System.Xml;
namespace Trizbort
{
public class Region
{
public Region()
{
RColor = Color.White;
TextColor = Color.Blue;
RegionName = DefaultRegion;
RegionID =new Guid();
}
public Guid RegionID { get; set; }
public string RegionName { get; set; }
public Color RColor { get; set; }
public Color TextColor { get; set; }
public static string DefaultRegion
{
get { return "NoRegion"; }
}
public static bool ValidRegionName(string name)
{
if (string.IsNullOrWhiteSpace(name))
return false;
return true;
}
public string ClearRegionNameObfuscation()
{
return RegionName.Replace("____", " ");
}
public string FixupRegionNameForSave()
{
var s = RegionName.Replace(" ", "____");
var validXmlChars =XmlConvert.EncodeName(s);
return validXmlChars;
}
}
}