This commit is contained in:
105
PROMS/VEPROMS.CSLA.Library/Config/UserConfig.cs
Normal file
105
PROMS/VEPROMS.CSLA.Library/Config/UserConfig.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
[Serializable]
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public class UserConfig:INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
private void OnPropertyChanged(String info)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(info));
|
||||
}
|
||||
private XMLProperties _Xp;
|
||||
private XMLProperties Xp
|
||||
{
|
||||
get { return _Xp; }
|
||||
}
|
||||
public UserConfig(string xml)
|
||||
{
|
||||
if (xml == string.Empty) xml = "<config/>";
|
||||
_Xp = new XMLProperties(xml);
|
||||
}
|
||||
public UserConfig()
|
||||
{
|
||||
_Xp = new XMLProperties();
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
string s = _Xp.ToString();
|
||||
if (s == "<config/>" || s == "<config></config>") return string.Empty;
|
||||
return s;
|
||||
}
|
||||
#region UserCategory // from user.cfg
|
||||
[Category("User")]
|
||||
[DisplayName("User Location1")]
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
[Description("User Location1")]
|
||||
public string User_UserLoc1
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Xp["user", "UserLoc1"];
|
||||
}
|
||||
set
|
||||
{
|
||||
_Xp["user", "UserLoc1"] = value;
|
||||
OnPropertyChanged("User_UserLoc1");
|
||||
}
|
||||
}
|
||||
[Category("User")]
|
||||
[DisplayName("User Location2")]
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
[Description("User Location2")]
|
||||
public string User_UserLoc2
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Xp["user", "UserLoc2"];
|
||||
}
|
||||
set
|
||||
{
|
||||
_Xp["user", "UserLoc2"] = value;
|
||||
OnPropertyChanged("User_UserLoc2");
|
||||
}
|
||||
}
|
||||
[Category("User")]
|
||||
[DisplayName("User Phone1")]
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
[Description("User Phone1")]
|
||||
public string User_UserPhone1
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Xp["user", "UserPhone1"];
|
||||
}
|
||||
set
|
||||
{
|
||||
_Xp["user", "UserPhone1"] = value;
|
||||
OnPropertyChanged("User_UserPhone1");
|
||||
}
|
||||
}
|
||||
[Category("User")]
|
||||
[DisplayName("User Phone2")]
|
||||
[RefreshProperties(RefreshProperties.All)]
|
||||
[Description("User Phone2")]
|
||||
public string User_UserPhone2
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Xp["user", "UserPhone2"];
|
||||
}
|
||||
set
|
||||
{
|
||||
_Xp["user", "UserPhone2"] = value;
|
||||
OnPropertyChanged("User_UserPhone2");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user