John a8a0b37a32 Added titles to message boxes used during the check of the RO.fst B2017-125
Add LoadingFigures to save status of loading the figures during Update RO Values B2017-125
Added checks to see if the RO Figures need loaded B2017-125
Added checks to see if the RO Figures need loaded and set the status during the loading figures part of updating RO values B2017-125
Make the progress bar text visible B2017-125
Added titles to message boxes used during the check of the RO.fst and make the progress bar text visible B2017-125
2017-06-23 20:02:34 +00:00

138 lines
3.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace VEPROMS.CSLA.Library
{
[Serializable]
[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; }
}
#endregion
#region Constructors
private Association _Association;
public AssociationConfig(Association association)
{
_Association = association;
string xml = association.Config;
if (xml == string.Empty) xml = "<Config/>";
_Xp = new XMLProperties(xml);
}
private AssociationInfo _AssociationInfo;
public AssociationConfig(AssociationInfo association)
{
_AssociationInfo = association;
string xml = association.Config;
if (xml == string.Empty) xml = "<Config/>";
_Xp = new XMLProperties(xml);
}
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")]
[DisplayName("Default RO Prefix")]
[RefreshProperties(RefreshProperties.All)]
[Description("Setpoint Prefix")]
public string RODefaults_setpointprefix
{
get
{
string s = _Xp["RODefaults", "Setpoint"];// get the saved value
return s;
}
set
{
_Xp["RODefaults", "Setpoint"] = value; // save selected value
OnPropertyChanged("RODefaults_setpointprefix");
}
}
[Category("Referenced Objects")]
[DisplayName("Default Graphics Prefix")]
[RefreshProperties(RefreshProperties.All)]
[Description("Graphics Prefix")]
public string RODefaults_graphicsprefix
{
get
{
string s = _Xp["RODefaults", "Graphics"];// get the saved value
return s;
}
set
{
_Xp["RODefaults", "Graphics"] = value; // save selected value
}
}
#endregion
#region ROUpdate
[Category("RO Update")]
[DisplayName("Last Completed")]
[RefreshProperties(RefreshProperties.All)]
[Description("Last RO Update Completed")]
public string ROUpdate_LastCompleted
{
get
{
string s = _Xp["ROUpdate", "LastCompleted"];// get the saved value
return s;
}
set
{
_Xp["ROUpdate", "LastCompleted"] = value; // save selected value
}
}
// B2017-125 save status of loading RO Figues
[Category("RO Update")]
[DisplayName("Loading Figures")]
[RefreshProperties(RefreshProperties.All)]
[Description("Loading Figures Status")]
public string ROUpdate_LoadingFigures
{
get
{
string s = _Xp["ROUpdate", "LoadingFigures"];// get the saved value
return s;
}
set
{
_Xp["ROUpdate", "LoadingFigures"] = value; // save selected value
}
}
#endregion // ROUpdate
#region ToString
public override string ToString()
{
string s = _Xp.ToString();
if (s == "<Config/>" || s == "<Config></config>") return string.Empty;
return s;
}
#endregion
}
}