100 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			100 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
using System;
 | 
						|
using System.Collections.Generic;
 | 
						|
using System.Text;
 | 
						|
using System.ComponentModel;
 | 
						|
 | 
						|
namespace VEPROMS.CSLA.Library
 | 
						|
{
 | 
						|
	[Serializable]
 | 
						|
	[TypeConverter(typeof(ExpandableObjectConverter))]
 | 
						|
	public class UserConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged
 | 
						|
	{
 | 
						|
		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
 | 
						|
    }
 | 
						|
}
 |