Files
SourceCode/PROMS/VEPROMS.CSLA.Library/Config/AnnotationConfig.cs
T
2026-08-28 11:15:35 -04:00

32 lines
943 B
C#

using System;
using System.ComponentModel;
namespace VEPROMS.CSLA.Library
{
//C2025-023 - Electronic Procedures - Modifications to PROMS
//new class to handle access of tblAnnotations.Config
[Serializable]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class AnnotationConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged
{
private readonly XMLProperties _Xp;
public AnnotationConfig(string xml)
{
if (xml == string.Empty) xml = "<Config/>";
_Xp = new XMLProperties(xml);
}
public AnnotationConfig() => _Xp = new XMLProperties();
public override string ToString()
{
string s = _Xp.ToString();
if (s == "<Config/>" || s == "<Config></Config>") return string.Empty;
return s;
}
public string GetValue(string group, string item) => _Xp[group, item];
public void SetValue(string group, string item, string newvalue) => _Xp[group, item] = newvalue;
}
}