This commit is contained in:
parent
dd571890fc
commit
155000586d
@ -9,16 +9,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||||
public class DocVersionConfig : DynamicTypeDescriptor, INotifyPropertyChanged
|
public class DocVersionConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
#region Events
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
|
||||||
private void OnPropertyChanged(String info)
|
|
||||||
{
|
|
||||||
if (PropertyChanged != null)
|
|
||||||
PropertyChanged(this, new PropertyChangedEventArgs(info));
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
#region DynamicTypeDescriptor
|
#region DynamicTypeDescriptor
|
||||||
internal override bool IsReadOnly
|
internal override bool IsReadOnly
|
||||||
{
|
{
|
||||||
|
@ -7,16 +7,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||||
public class DocumentConfig : DynamicTypeDescriptor, INotifyPropertyChanged
|
public class DocumentConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
#region Events
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
|
||||||
private void OnPropertyChanged(String info)
|
|
||||||
{
|
|
||||||
if (PropertyChanged != null)
|
|
||||||
PropertyChanged(this, new PropertyChangedEventArgs(info));
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
#region XML
|
#region XML
|
||||||
private XMLProperties _Xp;
|
private XMLProperties _Xp;
|
||||||
private XMLProperties Xp
|
private XMLProperties Xp
|
||||||
|
@ -8,9 +8,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public class DynamicPropertyDescriptor : PropertyDescriptor
|
public class DynamicPropertyDescriptor : PropertyDescriptor
|
||||||
{
|
{
|
||||||
private PropertyDescriptor _BasePropertyDescriptor;
|
private PropertyDescriptor _BasePropertyDescriptor;
|
||||||
private DynamicTypeDescriptor _Instance;
|
private ConfigDynamicTypeDescriptor _Instance;
|
||||||
|
|
||||||
public DynamicPropertyDescriptor(DynamicTypeDescriptor instance, PropertyDescriptor basePropertyDescriptor)
|
public DynamicPropertyDescriptor(ConfigDynamicTypeDescriptor instance, PropertyDescriptor basePropertyDescriptor)
|
||||||
: base(basePropertyDescriptor)
|
: base(basePropertyDescriptor)
|
||||||
{
|
{
|
||||||
_Instance = instance;
|
_Instance = instance;
|
||||||
@ -34,8 +34,23 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{ _BasePropertyDescriptor.SetValue(component, value); }
|
{ _BasePropertyDescriptor.SetValue(component, value); }
|
||||||
}
|
}
|
||||||
[Serializable()]
|
[Serializable()]
|
||||||
public class DynamicTypeDescriptor //: ICustomTypeDescriptor//, ISupportInitialize
|
public class ConfigDynamicTypeDescriptor //: ICustomTypeDescriptor//, ISupportInitialize
|
||||||
{
|
{
|
||||||
|
#region Events
|
||||||
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
protected void OnPropertyChanged(String info)
|
||||||
|
{
|
||||||
|
_IsDirty = true;
|
||||||
|
if (PropertyChanged != null)
|
||||||
|
PropertyChanged(this, new PropertyChangedEventArgs(info));
|
||||||
|
}
|
||||||
|
private bool _IsDirty = false;
|
||||||
|
public bool IsDirty
|
||||||
|
{
|
||||||
|
get { return _IsDirty; }
|
||||||
|
set { _IsDirty = value; }
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
[NonSerialized]
|
[NonSerialized]
|
||||||
private PropertyDescriptorCollection dynamicProps;
|
private PropertyDescriptorCollection dynamicProps;
|
||||||
private bool _IsReadOnly = false;
|
private bool _IsReadOnly = false;
|
||||||
@ -44,7 +59,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get { return _IsReadOnly; }
|
get { return _IsReadOnly; }
|
||||||
set { _IsReadOnly = value; }
|
set { _IsReadOnly = value; }
|
||||||
}
|
}
|
||||||
public DynamicTypeDescriptor() { }
|
public ConfigDynamicTypeDescriptor() { }
|
||||||
#region "TypeDescriptor Implementation"
|
#region "TypeDescriptor Implementation"
|
||||||
public String GetClassName()
|
public String GetClassName()
|
||||||
{ return TypeDescriptor.GetClassName(this, true); }
|
{ return TypeDescriptor.GetClassName(this, true); }
|
||||||
|
@ -10,16 +10,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
[Serializable]
|
[Serializable]
|
||||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||||
//public class FolderConfig : INotifyPropertyChanged
|
//public class FolderConfig : INotifyPropertyChanged
|
||||||
public class FolderConfig : DynamicTypeDescriptor, INotifyPropertyChanged
|
public class FolderConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
#region Events
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
|
||||||
private void OnPropertyChanged(String info)
|
|
||||||
{
|
|
||||||
if (PropertyChanged != null)
|
|
||||||
PropertyChanged(this, new PropertyChangedEventArgs(info));
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
#region DynamicTypeDescriptor
|
#region DynamicTypeDescriptor
|
||||||
internal override bool IsReadOnly
|
internal override bool IsReadOnly
|
||||||
{
|
{
|
||||||
|
@ -8,16 +8,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||||
public class ProcedureConfig : DynamicTypeDescriptor, INotifyPropertyChanged
|
public class ProcedureConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
#region Events
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
|
||||||
private void OnPropertyChanged(String info)
|
|
||||||
{
|
|
||||||
if (PropertyChanged != null)
|
|
||||||
PropertyChanged(this, new PropertyChangedEventArgs(info));
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
#region DynamicTypeDescriptor
|
#region DynamicTypeDescriptor
|
||||||
internal override bool IsReadOnly
|
internal override bool IsReadOnly
|
||||||
{
|
{
|
||||||
|
@ -8,16 +8,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||||
public class SectionConfig : DynamicTypeDescriptor, INotifyPropertyChanged
|
public class SectionConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
#region Events
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
|
||||||
private void OnPropertyChanged(String info)
|
|
||||||
{
|
|
||||||
if (PropertyChanged != null)
|
|
||||||
PropertyChanged(this, new PropertyChangedEventArgs(info));
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
#region DynamicTypeDescriptor
|
#region DynamicTypeDescriptor
|
||||||
internal override bool IsReadOnly
|
internal override bool IsReadOnly
|
||||||
{
|
{
|
||||||
|
178
PROMS/VEPROMS.CSLA.Library/Config/StepConfig.cs
Normal file
178
PROMS/VEPROMS.CSLA.Library/Config/StepConfig.cs
Normal file
@ -0,0 +1,178 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using DescriptiveEnum;
|
||||||
|
|
||||||
|
namespace VEPROMS.CSLA.Library
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||||
|
public class StepConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged
|
||||||
|
{
|
||||||
|
#region DynamicTypeDescriptor
|
||||||
|
internal override bool IsReadOnly
|
||||||
|
{
|
||||||
|
get { return false; }//_Section == null; }
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#region XML
|
||||||
|
private XMLProperties _Xp;
|
||||||
|
private XMLProperties Xp
|
||||||
|
{
|
||||||
|
get { return _Xp; }
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#region Constructors
|
||||||
|
//PROPGRID: Hide ParentLookup
|
||||||
|
[Browsable(false)]
|
||||||
|
public bool ParentLookup
|
||||||
|
{
|
||||||
|
get { return _Xp.ParentLookup; }
|
||||||
|
set { _Xp.ParentLookup = value; }
|
||||||
|
}
|
||||||
|
//PROPGRID: Had to comment out NonSerialized to hide AncestorLookup from Property Grid
|
||||||
|
//[NonSerialized]
|
||||||
|
private bool _AncestorLookup;
|
||||||
|
//PROPGRID: Hide AncestorLookup
|
||||||
|
[Browsable(false)]
|
||||||
|
public bool AncestorLookup
|
||||||
|
{
|
||||||
|
get { return _AncestorLookup; }
|
||||||
|
set { _AncestorLookup = value; }
|
||||||
|
}
|
||||||
|
private Step _Step;
|
||||||
|
private StepInfo _StepInfo;
|
||||||
|
public StepConfig(Step step)
|
||||||
|
{
|
||||||
|
_Step = step;
|
||||||
|
string xml = step.MyContent.Config;
|
||||||
|
if (xml == string.Empty) xml = "<config/>";
|
||||||
|
_Xp = new XMLProperties(xml);
|
||||||
|
}
|
||||||
|
public StepConfig(StepInfo stepInfo)
|
||||||
|
{
|
||||||
|
_StepInfo = stepInfo;
|
||||||
|
string xml = stepInfo.MyContent.Config;
|
||||||
|
if (xml == string.Empty) xml = "<config/>";
|
||||||
|
_Xp = new XMLProperties(xml);
|
||||||
|
}
|
||||||
|
public StepConfig(string xml)
|
||||||
|
{
|
||||||
|
if (xml == string.Empty) xml = "<config/>";
|
||||||
|
_Xp = new XMLProperties(xml);
|
||||||
|
}
|
||||||
|
public StepConfig()
|
||||||
|
{
|
||||||
|
_Xp = new XMLProperties();
|
||||||
|
}
|
||||||
|
internal string GetValue(string group, string item)
|
||||||
|
{
|
||||||
|
return _Xp[group, item];
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#region Local Properties
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
#region ToString
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
string s = _Xp.ToString();
|
||||||
|
if (s == "<config/>" || s == "<config></config>") return string.Empty;
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#region StepAttr
|
||||||
|
//[Category("Step Attributes")]
|
||||||
|
//[DisplayName("Step Continuous Action Summary")]
|
||||||
|
//[RefreshProperties(RefreshProperties.All)]
|
||||||
|
//[Description("Step Continuous Action Summary")]
|
||||||
|
public bool Step_CAS
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string s = _Xp["Step", "ContActSum"];
|
||||||
|
|
||||||
|
//If there is no value to get, then get the parent value (a.k.a. default value).
|
||||||
|
if (s == string.Empty) return false;
|
||||||
|
if (s == "True") return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
string s = _Xp["Step", "ContActSum"];
|
||||||
|
if (value.ToString() == s) return;
|
||||||
|
_Xp["Step", "ContActSum"] = value.ToString();
|
||||||
|
OnPropertyChanged("Step_CAS");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//[Category("Step Attributes")]
|
||||||
|
//[DisplayName("Step Check Off Index")]
|
||||||
|
//[RefreshProperties(RefreshProperties.All)]
|
||||||
|
//[Description("Step Check Off Index")]
|
||||||
|
public int Step_CheckOffIndex
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string s = _Xp["Step", "CheckOffIndex"];
|
||||||
|
|
||||||
|
if (s == string.Empty) return -1;
|
||||||
|
|
||||||
|
return int.Parse(s);
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
string s = _Xp["Step", "CheckOffIndex"];
|
||||||
|
if (value.ToString() == s) return;
|
||||||
|
_Xp["Step", "CheckOffIndex"] = value.ToString();
|
||||||
|
OnPropertyChanged("Step_CheckOffIndex");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//[Category("Step Attributes")]
|
||||||
|
//[DisplayName("Step Manual Pagebreak")]
|
||||||
|
//[RefreshProperties(RefreshProperties.All)]
|
||||||
|
//[Description("Step Manual Pagebreak")]
|
||||||
|
public bool Step_ManualPagebreak
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string s = _Xp["Step", "ManualPagebreak"];
|
||||||
|
|
||||||
|
if (s == string.Empty) return false;
|
||||||
|
if (s == "True") return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
string s = _Xp["Step", "ManualPagebreak"];
|
||||||
|
if (value.ToString() == s) return;
|
||||||
|
_Xp["Step", "ManualPagebreak"] = value.ToString();
|
||||||
|
OnPropertyChanged("Step_ManualPagebreak");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//[Category("Step Attributes")]
|
||||||
|
//[DisplayName("Step Change Bar Override")]
|
||||||
|
//[RefreshProperties(RefreshProperties.All)]
|
||||||
|
//[Description("Step Change Bar Override")]
|
||||||
|
public string Step_CBOverride
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string s = _Xp["Step", "CBOverride"];
|
||||||
|
|
||||||
|
if (s == string.Empty) return null;
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
string s = _Xp["Step", "CBOverride"];
|
||||||
|
|
||||||
|
if (value != null && value.ToString() == s) return;
|
||||||
|
if (value == null && s != null) _Xp["Step", "CBOverride"] = null;
|
||||||
|
else _Xp["Step", "CBOverride"] = value.ToString();
|
||||||
|
OnPropertyChanged("Step_CBOverride");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
@ -7,14 +7,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||||
public class UserConfig:INotifyPropertyChanged
|
public class UserConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
|
||||||
private void OnPropertyChanged(String info)
|
|
||||||
{
|
|
||||||
if (PropertyChanged != null)
|
|
||||||
PropertyChanged(this, new PropertyChangedEventArgs(info));
|
|
||||||
}
|
|
||||||
private XMLProperties _Xp;
|
private XMLProperties _Xp;
|
||||||
private XMLProperties Xp
|
private XMLProperties Xp
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user