CSLA Config cleanup
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Drawing;
|
||||
|
||||
@@ -8,9 +7,9 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
public static class ColorConfig
|
||||
{
|
||||
private static Regex byARGB = new Regex(@"Color \[A=([0-9]*), R=([0-9]*), G=([0-9]*), B=([0-9]*)\]");
|
||||
private static Regex byName = new Regex(@"Color \[(.*)\]");
|
||||
private static Regex byRGB = new Regex(@"[0-9]*,[0-9]*,[0-9]*");
|
||||
private static readonly Regex byARGB = new Regex(@"Color \[A=([0-9]*), R=([0-9]*), G=([0-9]*), B=([0-9]*)\]");
|
||||
private static readonly Regex byName = new Regex(@"Color \[(.*)\]");
|
||||
private static readonly Regex byRGB = new Regex(@"[0-9]*,[0-9]*,[0-9]*");
|
||||
public static Color ColorFromString(string sColor)
|
||||
{
|
||||
if (sColor == string.Empty) return Color.Empty;
|
||||
@@ -59,12 +58,7 @@ namespace VEPROMS.CSLA.Library
|
||||
return ConvertRGBToName[tmp.Name];
|
||||
return tmp;
|
||||
}
|
||||
public static Color FindKnownColor(Color tmp)
|
||||
{
|
||||
if (ConvertRGBToName.ContainsKey(tmp.Name))
|
||||
return ConvertRGBToName[tmp.Name];
|
||||
return tmp;
|
||||
}
|
||||
public static Color FindKnownColor(Color tmp) => ConvertRGBToName.ContainsKey(tmp.Name) ? ConvertRGBToName[tmp.Name] : tmp;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user