using System; using System.ComponentModel; namespace VEPROMS.CSLA.Library { [Serializable] [TypeConverter(typeof(ExpandableObjectConverter))] public class ROImageConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged { #region DynamicTypeDescriptor internal override bool IsReadOnly => _ROImageInfo == null; #endregion #region XML private readonly XMLProperties _Xp; #endregion #region Constructors private readonly ROImageInfo _ROImageInfo; public ROImageConfig(ROImageInfo rOImageInfo) { _ROImageInfo = rOImageInfo; string xml = rOImageInfo.Config; if (xml == string.Empty) xml = ""; _Xp = new XMLProperties(xml); } public ROImageConfig() { string xml = ""; _Xp = new XMLProperties(xml); } internal string GetValue(string group, string item) => _Xp[group, item]; #endregion #region Local Properties [Category("Image")] [Browsable(false)] [DisplayName("Size")] [RefreshProperties(RefreshProperties.All)] [Description("Size")] public string Image_Size { get { return _Xp["Image", "Size"]; } set { _Xp["Image", "Size"] = value; OnPropertyChanged("Image_Size"); } } #endregion #region ToString public override string ToString() { string s = _Xp.ToString(); return s == "" || s == "" ? string.Empty : s; } #endregion } }