CSLA Config cleanup

This commit is contained in:
2026-08-28 11:15:35 -04:00
parent d0587706a2
commit f88f8a1c75
27 changed files with 566 additions and 2412 deletions
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace VEPROMS.CSLA.Library
@@ -9,21 +7,14 @@ namespace VEPROMS.CSLA.Library
[TypeConverter(typeof(ExpandableObjectConverter))]
public class AssociationConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged
{
#region DynamicTypeDescriptor
internal override bool IsReadOnly
{
get { return _Association == null; }
}
#endregion
#region XML
private XMLProperties _Xp;
private XMLProperties Xp
{
get { return _Xp; }
}
#region DynamicTypeDescriptor
internal override bool IsReadOnly => _Association == null;
#endregion
#region XML
private readonly XMLProperties _Xp;
#endregion
#region Constructors
private Association _Association;
private readonly Association _Association;
public AssociationConfig(Association association)
{
_Association = association;
@@ -31,7 +22,7 @@ namespace VEPROMS.CSLA.Library
if (xml == string.Empty) xml = "<Config/>";
_Xp = new XMLProperties(xml);
}
private AssociationInfo _AssociationInfo;
private readonly AssociationInfo _AssociationInfo;
public AssociationConfig(AssociationInfo association)
{
_AssociationInfo = association;
@@ -39,24 +30,17 @@ namespace VEPROMS.CSLA.Library
if (xml == string.Empty) xml = "<Config/>";
_Xp = new XMLProperties(xml);
}
public AssociationConfig(string xml)
{
_Xp = new XMLProperties(xml);
}
public AssociationConfig()
public AssociationConfig(string xml) => _Xp = new XMLProperties(xml);
public AssociationConfig()
{
string xml = "<Config/>";
_Xp = new XMLProperties(xml);
}
internal string GetValue(string group, string item)
{
return _Xp[group, item];
}
#endregion
public Association MyAssociation
{ get { return _Association; } }
#region RODefaults // From proc.ini
[Category("Referenced Objects")]
internal string GetValue(string group, string item) => _Xp[group, item];
#endregion
public Association MyAssociation => _Association;
#region RODefaults // From proc.ini
[Category("Referenced Objects")]
[DisplayName("Default RO Prefix")]
[RefreshProperties(RefreshProperties.All)]
[Description("Setpoint Prefix")]
@@ -146,9 +130,8 @@ namespace VEPROMS.CSLA.Library
public override string ToString()
{
string s = _Xp.ToString();
if (s == "<Config/>" || s == "<Config></config>") return string.Empty;
return s;
}
#endregion
}
return s == "<Config/>" || s == "<Config></config>" ? string.Empty : s;
}
#endregion
}
}