Convert INI format colors to standard System.Drawing.Color
Use Generic Color Configuration Support
This commit is contained in:
@@ -1051,21 +1051,11 @@ namespace VEPROMS.CSLA.Library
|
||||
get
|
||||
{
|
||||
string sColor = _Xp["default", "BkColor"];
|
||||
if (sColor == string.Empty) sColor = "White";
|
||||
if (sColor[0] == '[')
|
||||
{
|
||||
string[] parts = sColor.Substring(1, sColor.Length - 2).Split(",".ToCharArray());
|
||||
return Color.FromArgb(Int32.Parse(parts[0]), Int32.Parse(parts[1]), Int32.Parse(parts[2]));
|
||||
}
|
||||
else return Color.FromName(sColor);
|
||||
return ColorConfig.ColorFromString(sColor);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value.IsNamedColor) _Xp["default", "BkColor"] = value.Name;
|
||||
else
|
||||
{
|
||||
_Xp["default", "BkColor"] = string.Format("[{0},{1},{2}]", value.R, value.G, value.B);
|
||||
}
|
||||
_Xp["default", "BkColor"] = value.ToString();
|
||||
OnPropertyChanged("Default_BkColor");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user