Better handling of parent information in Get and Set

This commit is contained in:
Jsj 2008-03-26 18:26:01 +00:00
parent 6acc548cf3
commit 1108280311
3 changed files with 1346 additions and 705 deletions

View File

@ -26,12 +26,16 @@ namespace VEPROMS.CSLA.Library
{ {
get { return _Xp; } get { return _Xp; }
} }
//PROPGRID: Hide ParentLookup
[Browsable(false)]
public bool ParentLookup public bool ParentLookup
{ {
get { return _Xp.ParentLookup; } get { return _Xp.ParentLookup; }
set { _Xp.ParentLookup = value; } set { _Xp.ParentLookup = value; }
} }
private bool _AncestorLookup; private bool _AncestorLookup;
//PROPGRID: Hide AncestorLookup
[Browsable(false)]
public bool AncestorLookup public bool AncestorLookup
{ {
get { return _AncestorLookup; } get { return _AncestorLookup; }
@ -91,7 +95,6 @@ namespace VEPROMS.CSLA.Library
{ {
return _Xp[group, item]; return _Xp[group, item];
} }
//[Category("Identification")]
[Category("General")] [Category("General")]
[DisplayName("Name")] [DisplayName("Name")]
[Description("Name")] [Description("Name")]
@ -100,8 +103,9 @@ namespace VEPROMS.CSLA.Library
get { return (_DocVersion != null ? _DocVersion.Name : _DocVersionInfo.Name); } get { return (_DocVersion != null ? _DocVersion.Name : _DocVersionInfo.Name); }
set { if (_DocVersion != null) _DocVersion.Name = value; } set { if (_DocVersion != null) _DocVersion.Name = value; }
} }
//[Category("Identification")]
[Category("General")] [Category("General")]
//PROPGRID: Hide Title
[Browsable(false)]
[DisplayName("Title")] [DisplayName("Title")]
[Description("Title")] [Description("Title")]
public string Title public string Title
@ -109,7 +113,6 @@ namespace VEPROMS.CSLA.Library
get { return (_DocVersion != null ? _DocVersion.Title : _DocVersionInfo.Title); } get { return (_DocVersion != null ? _DocVersion.Title : _DocVersionInfo.Title); }
set { if (_DocVersion != null) _DocVersion.Title = value; } set { if (_DocVersion != null) _DocVersion.Title = value; }
} }
//[Category("Format")]
[Category("Format Settings")] [Category("Format Settings")]
[DisplayName("Format")] [DisplayName("Format")]
[Description("Format")] [Description("Format")]
@ -118,8 +121,6 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
//if (_DocVersion != null) return FormatList.ToString(_DocVersion.FormatID);
//if (_DocVersionInfo != null) return FormatList.ToString(_DocVersionInfo.FormatID);
if (_DocVersion != null && _DocVersion.MyFormat != null) return _DocVersion.MyFormat.PlantFormat.FormatData.Name; if (_DocVersion != null && _DocVersion.MyFormat != null) return _DocVersion.MyFormat.PlantFormat.FormatData.Name;
if (_DocVersionInfo != null && _DocVersionInfo.MyFormat != null) return _DocVersionInfo.MyFormat.PlantFormat.FormatData.Name; if (_DocVersionInfo != null && _DocVersionInfo.MyFormat != null) return _DocVersionInfo.MyFormat.PlantFormat.FormatData.Name;
return null; return null;
@ -129,17 +130,14 @@ namespace VEPROMS.CSLA.Library
if (_DocVersion != null) _DocVersion.MyFormat = FormatList.ToFormat(value); // Can only be set if _DocVersion is set if (_DocVersion != null) _DocVersion.MyFormat = FormatList.ToFormat(value); // Can only be set if _DocVersion is set
} }
} }
//[Category("Format")]
[Category("Format Settings")] [Category("Format Settings")]
[DisplayName("Default Format")] [DisplayName("Default Format")]
[Description("Format")] [Description("Default Format")]
[TypeConverter(typeof(FormatList))] [TypeConverter(typeof(FormatList))]
public string DefaultFormatSelection public string DefaultFormatSelection
{ {
get get
{ {
//if (_DocVersion != null) return FormatList.ToString(_DocVersion.FormatID);
//if (_DocVersionInfo != null) return FormatList.ToString(_DocVersionInfo.FormatID);
if (_DocVersion != null && _DocVersion.MyFolder != null && _DocVersion.MyFolder.ActiveParent != null) return _DocVersion.MyFolder.ActiveFormat.PlantFormat.FormatData.Name; if (_DocVersion != null && _DocVersion.MyFolder != null && _DocVersion.MyFolder.ActiveParent != null) return _DocVersion.MyFolder.ActiveFormat.PlantFormat.FormatData.Name;
if (_DocVersionInfo != null && _DocVersionInfo.MyFolder != null && _DocVersionInfo.MyFolder.ActiveParent != null) return _DocVersionInfo.MyFolder.ActiveFormat.PlantFormat.FormatData.Name; if (_DocVersionInfo != null && _DocVersionInfo.MyFolder != null && _DocVersionInfo.MyFolder.ActiveParent != null) return _DocVersionInfo.MyFolder.ActiveFormat.PlantFormat.FormatData.Name;
return null; return null;
@ -155,9 +153,7 @@ namespace VEPROMS.CSLA.Library
//<Config><RODefaults Setpoint="SP1" Graphics="IG1" ROPATH="g:\ops\vehlp\ro" /><PrintSettings ChangeBar="3" ChangeBarLoc="1" ChangeBarText="3" numcopies="1" Watermark="1" userformat=" " disableduplex="False" /><format plant="OHLP" /></Config> //<Config><RODefaults Setpoint="SP1" Graphics="IG1" ROPATH="g:\ops\vehlp\ro" /><PrintSettings ChangeBar="3" ChangeBarLoc="1" ChangeBarText="3" numcopies="1" Watermark="1" userformat=" " disableduplex="False" /><format plant="OHLP" /></Config>
#region RODefaults // From proc.ini #region RODefaults // From proc.ini
//[Category("RODefaults")]
[Category("Referenced Objects")] [Category("Referenced Objects")]
//[DisplayName("Setpoint Prefix")]
[DisplayName("Default RO Prefix")] [DisplayName("Default RO Prefix")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Setpoint Prefix")] [Description("Setpoint Prefix")]
@ -165,17 +161,36 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
return _Xp["RODefaults", "Setpoint"]; string s = _Xp["RODefaults", "Setpoint"];// get the saved value
//If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("RODefaults", "Setpoint"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
s = "SP1";// default to volian default
return s;
} }
set set
{ {
_Xp["RODefaults", "Setpoint"] = value; // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("RODefaults", "Setpoint"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "SP1";
if (parval.Equals(value))
_Xp["RODefaults", "Setpoint"] = string.Empty; // reset to parent value
else
_Xp["RODefaults", "Setpoint"] = value; // save selected value
OnPropertyChanged("RODefaults_setpointprefix"); OnPropertyChanged("RODefaults_setpointprefix");
} }
} }
//[Category("RODefaults")]
[Category("Referenced Objects")] [Category("Referenced Objects")]
//[DisplayName("Graphics Prefix")]
[DisplayName("Default Graphics Prefix")] [DisplayName("Default Graphics Prefix")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Graphics Prefix")] [Description("Graphics Prefix")]
@ -183,17 +198,36 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
return _Xp["RODefaults", "Graphics"]; string s = _Xp["RODefaults", "Graphics"];// get the saved value
//If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("RODefaults", "Graphics"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
s = "IG1";// default to volian default
return s;
} }
set set
{ {
_Xp["RODefaults", "Graphics"] = value; // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("RODefaults", "Graphics"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "IG1";
if (parval.Equals(value))
_Xp["RODefaults", "Graphics"] = string.Empty; // reset to parent value
else
_Xp["RODefaults", "Graphics"] = value; // save selected value
OnPropertyChanged("RODefaults_graphicsprefix"); OnPropertyChanged("RODefaults_graphicsprefix");
} }
} }
//[Category("Graphics")]
[Category("Referenced Objects")] [Category("Referenced Objects")]
//[DisplayName("Default File Extension")]
[DisplayName("Graphic File Extension")] [DisplayName("Graphic File Extension")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Default File Extension")] [Description("Default File Extension")]
@ -201,17 +235,40 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
return _Xp["Graphics", "defaultext"]; string s = _Xp["Graphics", "defaultext"];// get the saved value
//If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("Graphics", "defaultext"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return s = "TIF";// default to volian default
return s;
} }
set set
{ {
_Xp["Graphics", "defaultext"] = value; // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("Graphics", "defaultext"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "TIF";
if (parval.Equals(value))
_Xp["Graphics", "defaultext"] = string.Empty; // reset to parent value
else
_Xp["Graphics", "defaultext"] = value; // save selected value
OnPropertyChanged("Graphics_defaultext"); OnPropertyChanged("Graphics_defaultext");
} }
} }
#endregion #endregion
#region PrintSettingsCategory // From curset.dat #region PrintSettingsCategory // From curset.dat
[Category("Print Settings")] [Category("Print Settings")]
//PROPGRID: Hide Printer
[Browsable(false)]
[DisplayName("Number of Copies")] [DisplayName("Number of Copies")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Number of Copies")] [Description("Number of Copies")]
@ -230,6 +287,8 @@ namespace VEPROMS.CSLA.Library
} }
} }
[Category("Print Settings")] [Category("Print Settings")]
//PROPGRID: Hide Printer
[Browsable(false)]
[DisplayName("Printer")] [DisplayName("Printer")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Printer")] [Description("Printer")]
@ -246,12 +305,6 @@ namespace VEPROMS.CSLA.Library
OnPropertyChanged("Print_Printer"); OnPropertyChanged("Print_Printer");
} }
} }
//public enum PrintWatermark : int
//{
// None = 0, Reference, Draft, Master, Sample,
// [Description("Information Only")]
// InformationOnly
//}
[TypeConverter(typeof(EnumDescConverter))] [TypeConverter(typeof(EnumDescConverter))]
public enum PrintWatermark : int public enum PrintWatermark : int
{ {
@ -259,7 +312,6 @@ namespace VEPROMS.CSLA.Library
[Description("Information Only")] [Description("Information Only")]
InformationOnly InformationOnly
} }
//[TypeConverter(typeof(EnumDescConverter))]
[Category("Print Settings")] [Category("Print Settings")]
[DisplayName("Watermark")] [DisplayName("Watermark")]
@ -270,18 +322,35 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "Watermark"]; string s = _Xp["PrintSettings", "Watermark"];
if (s == string.Empty || s.Equals("-1")) return PrintWatermark.Draft;
return (PrintWatermark)int.Parse(_Xp["PrintSettings", "Watermark"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "Watermark"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintWatermark.Draft;// default to volian default
return (PrintWatermark)int.Parse(s);
} }
set set
{ {
if (value == PrintWatermark.Draft) _Xp["PrintSettings", "Watermark"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
else _Xp["PrintSettings", "Watermark"] = ((int)value).ToString(); // reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "Watermark"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintWatermark.Draft)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "Watermark"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "Watermark"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_Watermark"); OnPropertyChanged("Print_Watermark");
} }
} }
[Category("Print Settings")] [Category("Print Settings")]
//[DisplayName("Disable Duplex Printing")]
[DisplayName("Disable Automatic Duplexing")] [DisplayName("Disable Automatic Duplexing")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Disable Duplex Printing")] [Description("Disable Duplex Printing")]
@ -290,12 +359,31 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "disableduplex"]; string s = _Xp["PrintSettings", "disableduplex"];
if (s == string.Empty) return false;
return bool.Parse(_Xp["PrintSettings", "disableduplex"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "disableduplex"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
s = "false";// default to volian default
return bool.Parse(s);
} }
set set
{ {
_Xp["PrintSettings", "disableduplex"] = value.ToString(); // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "disableduplex"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "false";
if (parval.Equals(value.ToString()))
_Xp["PrintSettings", "disableduplex"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "disableduplex"] = value.ToString(); // save selected value
OnPropertyChanged("Print_DisableDuplex"); OnPropertyChanged("Print_DisableDuplex");
} }
} }
@ -304,10 +392,6 @@ namespace VEPROMS.CSLA.Library
// Without Change Bars // Without Change Bars
// With Default Change Bars // With Default Change Bars
// With User Specified Change Bars // With User Specified Change Bars
//public enum PrintChangeBar : int
//{
// NoDefault = 0, Without, WithDefault, WithUserSpecified
//}
[TypeConverter(typeof(EnumDescConverter))] [TypeConverter(typeof(EnumDescConverter))]
public enum PrintChangeBar : int public enum PrintChangeBar : int
{ {
@ -321,9 +405,7 @@ namespace VEPROMS.CSLA.Library
WithUserSpecified WithUserSpecified
} }
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
//[DisplayName("Change Bar")]
[DisplayName("Change Bars")] [DisplayName("Change Bars")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Change Bar Use")] [Description("Change Bar Use")]
@ -332,28 +414,34 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "ChangeBar"]; string s = _Xp["PrintSettings", "ChangeBar"];
if (s == string.Empty || s.Equals("-1")) return PrintChangeBar.SelectBeforePrinting;//PrintChangeBar.NoDefault;
return (PrintChangeBar)int.Parse(_Xp["PrintSettings", "ChangeBar"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "ChangeBar"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintChangeBar.SelectBeforePrinting;// default to volian default
return (PrintChangeBar)int.Parse(s);
} }
set set
{ {
//if (value == PrintChangeBar.NoDefault) _Xp["PrintSettings", "ChangeBar"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
if (value == PrintChangeBar.SelectBeforePrinting) _Xp["PrintSettings", "ChangeBar"] = string.Empty; // reset the data to use the parent value.
else _Xp["PrintSettings", "ChangeBar"] = ((int)value).ToString();
string parval = _Xp.ParentValue("PrintSettings", "ChangeBar"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintChangeBar.SelectBeforePrinting)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "ChangeBar"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "ChangeBar"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_ChangeBar"); OnPropertyChanged("Print_ChangeBar");
} }
} }
//public string Print_ChangeBarstr
//{
// get
// {
// return EnumDescConverter.GetEnumDescription(
// string s = _Xp["PrintSettings", "ChangeBar"];
// if (s == string.Empty) return PrintChangeBar.SelectBeforePrinting;//PrintChangeBar.NoDefault;
// return (PrintChangeBar)int.Parse(_Xp["PrintSettings", "ChangeBar"]);
// }
//}
// User Specified Change Bar Location from16-bit code: // User Specified Change Bar Location from16-bit code:
// With Text // With Text
// Outside Box // Outside Box
@ -371,9 +459,7 @@ namespace VEPROMS.CSLA.Library
[Description("To the Left of the Text")] [Description("To the Left of the Text")]
LeftOfText LeftOfText
} }
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
//[DisplayName("Change Bar Location")]
[DisplayName("Change Bar Position")] [DisplayName("Change Bar Position")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("User Specified Change Bar Location")] [Description("User Specified Change Bar Location")]
@ -382,13 +468,31 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "ChangeBarLoc"]; string s = _Xp["PrintSettings", "ChangeBarLoc"];
if (s == string.Empty || s.Equals("-1")) return PrintChangeBarLoc.WithText;
return (PrintChangeBarLoc)int.Parse(_Xp["PrintSettings", "ChangeBarLoc"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "ChangeBarLoc"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintChangeBarLoc.WithText;// default to volian default
return (PrintChangeBarLoc)int.Parse(s);
} }
set set
{ {
if (value == PrintChangeBarLoc.WithText) _Xp["PrintSettings", "ChangeBarLoc"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
else _Xp["PrintSettings", "ChangeBarLoc"] = ((int)value).ToString(); // reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "ChangeBarLoc"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintChangeBarLoc.WithText)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "ChangeBarLoc"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "ChangeBarLoc"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_ChangeBarLoc"); OnPropertyChanged("Print_ChangeBarLoc");
} }
} }
@ -399,10 +503,6 @@ namespace VEPROMS.CSLA.Library
// Change ID // Change ID
// No Change Bar Message // No Change Bar Message
// User Defined Message // User Defined Message
//public enum PrintChangeBarText : int
//{
// DateChgID = 0, RevNum, ChgID, None, UserDef
//}
[TypeConverter(typeof(EnumDescConverter))] [TypeConverter(typeof(EnumDescConverter))]
public enum PrintChangeBarText : int public enum PrintChangeBarText : int
{ {
@ -417,9 +517,7 @@ namespace VEPROMS.CSLA.Library
[Description("Custom Change Bar Text")] [Description("Custom Change Bar Text")]
UserDef UserDef
} }
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
//[DisplayName("Change Bar Text")]
[DisplayName("Change Bar Text Type")] [DisplayName("Change Bar Text Type")]
[Description("Change Bar Text")] [Description("Change Bar Text")]
public PrintChangeBarText Print_ChangeBarText public PrintChangeBarText Print_ChangeBarText
@ -427,19 +525,35 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "ChangeBarText"]; string s = _Xp["PrintSettings", "ChangeBarText"];
if (s == string.Empty || s.Equals("-1")) return PrintChangeBarText.DateChgID;
return (PrintChangeBarText)int.Parse(_Xp["PrintSettings", "ChangeBarText"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "ChangeBarText"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintChangeBarText.DateChgID;// default to volian default
return (PrintChangeBarText)int.Parse(s);
} }
set set
{ {
if (value == PrintChangeBarText.DateChgID) _Xp["PrintSettings", "ChangeBarText"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
else _Xp["PrintSettings", "ChangeBarText"] = ((int)value).ToString(); // reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "ChangeBarText"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintChangeBarText.DateChgID)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "ChangeBarText"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "ChangeBarText"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_ChangeBarText"); OnPropertyChanged("Print_ChangeBarText");
} }
} }
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
//[DisplayName("User Change Bar Message1")]
[DisplayName("Custom Change Bar Message Line One")] [DisplayName("Custom Change Bar Message Line One")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("User Change Bar Message1")] [Description("User Change Bar Message1")]
@ -447,17 +561,36 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
return _Xp["PrintSettings", "usercbmess1"]; string s = _Xp["PrintSettings", "usercbmess1"];// get the saved value
//If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "usercbmess1"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return "";// default to volian default
return s;
} }
set set
{ {
_Xp["PrintSettings", "usercbmess1"] = value; // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "usercbmess1"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "";
if (parval.Equals(value))
_Xp["PrintSettings", "usercbmess1"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "usercbmess1"] = value; // save selected value
OnPropertyChanged("Print_UserCBMess1"); OnPropertyChanged("Print_UserCBMess1");
} }
} }
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
//[DisplayName("User Change Bar Message2")]
[DisplayName("Custom Change Bar Message Line Two")] [DisplayName("Custom Change Bar Message Line Two")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("User Change Bar Message2")] [Description("User Change Bar Message2")]
@ -465,15 +598,38 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
return _Xp["PrintSettings", "usercbmess2"]; string s = _Xp["PrintSettings", "usercbmess2"];// get the saved value
//If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "usercbmess2"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return "";// default to volian default
return s;
} }
set set
{ {
_Xp["PrintSettings", "usercbmess2"] = value; // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "usercbmess2"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "";
if (parval.Equals(value))
_Xp["PrintSettings", "usercbmess2"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "usercbmess2"] = value; // save selected value
OnPropertyChanged("Print_UserCBMess2"); OnPropertyChanged("Print_UserCBMess2");
} }
} }
[Category("Print Settings")] [Category("Print Settings")]
//PROPGRID: Hide User Format
[Browsable(false)]
[DisplayName("User Format")] [DisplayName("User Format")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("User Format")] [Description("User Format")]
@ -502,17 +658,36 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "Pagination"]; string s = _Xp["PrintSettings", "Pagination"];
if (s == string.Empty || s.Equals("-1")) return PrintPagination.Auto;
return (PrintPagination)int.Parse(_Xp["PrintSettings", "Pagination"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "Pagination"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintPagination.Auto;// default to volian default
return (PrintPagination)int.Parse(s);
} }
set set
{ {
if (value == PrintPagination.Auto) _Xp["PrintSettings", "Pagination"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
else _Xp["PrintSettings", "Pagination"] = ((int)value).ToString(); // reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "Pagination"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintPagination.Auto)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "Pagination"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "Pagination"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_Pagination"); OnPropertyChanged("Print_Pagination");
} }
} }
#endregion #endregion
#region DELETE_ME
/* /*
#region ColorCategory // From veproms.ini #region ColorCategory // From veproms.ini
// Note that not all possibilities from 16-bit will be added here, until // Note that not all possibilities from 16-bit will be added here, until
@ -1050,5 +1225,6 @@ OnPropertyChanged("Default_BkColor");
} }
} }
*/ */
#endregion
} }
} }

View File

@ -27,13 +27,19 @@ namespace VEPROMS.CSLA.Library
{ {
get { return _Xp; } get { return _Xp; }
} }
//PROPGRID: Hide ParentLookup
[Browsable(false)]
public bool ParentLookup public bool ParentLookup
{ {
get { return _Xp.ParentLookup; } get { return _Xp.ParentLookup; }
set { _Xp.ParentLookup = value; } set { _Xp.ParentLookup = value; }
} }
[NonSerialized] //PROPGRID: Hide AncestorLookup
//PROPGRID: Needed to comment out [NonSerialized] in order to hide this field from the property grid
//[NonSerialized]
[Browsable(false)]
private bool _AncestorLookup; private bool _AncestorLookup;
[Browsable(false)]
public bool AncestorLookup public bool AncestorLookup
{ {
get { return _AncestorLookup; } get { return _AncestorLookup; }
@ -51,16 +57,21 @@ namespace VEPROMS.CSLA.Library
} }
private string Xp_LookInAncestorFolder(object sender, XMLPropertiesArgs args) private string Xp_LookInAncestorFolder(object sender, XMLPropertiesArgs args)
{ {
if (_AncestorLookup || ParentLookup) if (_AncestorLookup || ParentLookup || args.AncestorLookup)
return GetParentValue(args.Group, args.Item);
return string.Empty;
}
public string GetParentValue(string group, string item)
{ {
for (Folder folder = _Folder.MyParent; folder != null; folder = folder.MyParent) for (Folder folder = _Folder.MyParent; folder != null; folder = folder.MyParent)
{ {
string retval = folder.FolderConfig.GetValue( args.Group, args.Item); string retval = folder.FolderConfig.GetValue(group, item);
if (retval != string.Empty) return retval; if (retval != string.Empty) return retval;
} }
}
return string.Empty; return string.Empty;
} }
private string Xp_LookInAncestorFolderInfo(object sender, XMLPropertiesArgs args) private string Xp_LookInAncestorFolderInfo(object sender, XMLPropertiesArgs args)
{ {
if (_AncestorLookup || ParentLookup) if (_AncestorLookup || ParentLookup)
@ -93,7 +104,6 @@ namespace VEPROMS.CSLA.Library
{ {
return _Xp[group, item]; return _Xp[group, item];
} }
//[Category("Identification")]
[Category("General")] [Category("General")]
[DisplayName("Name")] [DisplayName("Name")]
[Description("Name")] [Description("Name")]
@ -102,8 +112,9 @@ namespace VEPROMS.CSLA.Library
get { return (_Folder != null ? _Folder.Name : _FolderInfo.Name); } get { return (_Folder != null ? _Folder.Name : _FolderInfo.Name); }
set { if (_Folder != null)_Folder.Name = value; } set { if (_Folder != null)_Folder.Name = value; }
} }
//[Category("Identification")] //PROPGRID: Hide Title
[Category("General")] [Category("General")]
[Browsable(false)]
[DisplayName("Title")] [DisplayName("Title")]
[Description("Title")] [Description("Title")]
public string Title public string Title
@ -111,8 +122,9 @@ namespace VEPROMS.CSLA.Library
get { return (_Folder != null ? _Folder.Title : _FolderInfo.Title); } get { return (_Folder != null ? _Folder.Title : _FolderInfo.Title); }
set { _Folder.Title = value; } set { _Folder.Title = value; }
} }
//[Category("Identification")] //PROPGRID: Hide Short Name
[Category("General")] [Category("General")]
[Browsable(false)]
[DisplayName("Short Name")] [DisplayName("Short Name")]
[Description("Short Name")] [Description("Short Name")]
public string ShortName public string ShortName
@ -120,7 +132,6 @@ namespace VEPROMS.CSLA.Library
get { return (_Folder != null ? _Folder.ShortName : _FolderInfo.ShortName); } get { return (_Folder != null ? _Folder.ShortName : _FolderInfo.ShortName); }
set { if (_Folder != null)_Folder.ShortName = value; } set { if (_Folder != null)_Folder.ShortName = value; }
} }
//[Category("Format")]
[Category("Format Settings")] [Category("Format Settings")]
[DisplayName("Format")] [DisplayName("Format")]
[Description("Format")] [Description("Format")]
@ -129,8 +140,6 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
//if (_Folder != null) return FormatList.ToString(_Folder.FormatID);
//if (_FolderInfo != null) return FormatList.ToString(_FolderInfo.FormatID);
if (_Folder != null && _Folder.MyFormat != null) return _Folder.MyFormat.PlantFormat.FormatData.Name; if (_Folder != null && _Folder.MyFormat != null) return _Folder.MyFormat.PlantFormat.FormatData.Name;
if (_FolderInfo != null && _FolderInfo.MyFormat != null) return _FolderInfo.MyFormat.PlantFormat.FormatData.Name; if (_FolderInfo != null && _FolderInfo.MyFormat != null) return _FolderInfo.MyFormat.PlantFormat.FormatData.Name;
return null; return null;
@ -140,18 +149,14 @@ namespace VEPROMS.CSLA.Library
if (_Folder != null) _Folder.MyFormat = FormatList.ToFormat(value); if (_Folder != null) _Folder.MyFormat = FormatList.ToFormat(value);
} }
} }
//[Category("Format")]
[Category("Format Settings")] [Category("Format Settings")]
[DisplayName("Default Format")] [DisplayName("Default Format")]
//[DisplayName("Format")] [Description("Default Format")]
[Description("Format")]
[TypeConverter(typeof(FormatList))] [TypeConverter(typeof(FormatList))]
public string DefaultFormatSelection public string DefaultFormatSelection
{ {
get get
{ {
//if (_Folder != null) return FormatList.ToString(_Folder.FormatID);
//if (_FolderInfo != null) return FormatList.ToString(_FolderInfo.FormatID);
if (_Folder != null && _Folder.MyParent != null && _Folder.MyParent.ActiveFormat != null) return _Folder.MyParent.ActiveFormat.PlantFormat.FormatData.Name; if (_Folder != null && _Folder.MyParent != null && _Folder.MyParent.ActiveFormat != null) return _Folder.MyParent.ActiveFormat.PlantFormat.FormatData.Name;
if (_FolderInfo != null && _FolderInfo.MyParent != null && _FolderInfo.MyParent.ActiveFormat != null) return _FolderInfo.MyParent.ActiveFormat.PlantFormat.FormatData.Name; if (_FolderInfo != null && _FolderInfo.MyParent != null && _FolderInfo.MyParent.ActiveFormat != null) return _FolderInfo.MyParent.ActiveFormat.PlantFormat.FormatData.Name;
return null; return null;
@ -168,31 +173,53 @@ namespace VEPROMS.CSLA.Library
{ {
return true; return true;
} }
//[Category("Graphics")]
[Category("Referenced Objects")] [Category("Referenced Objects")]
[DisplayName("Graphic File Extension")] [DisplayName("Graphic File Extension")]
//[DisplayName("Default File Extension")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Default File Extension")] [Description("Default File Extension")]
public string Graphics_defaultext public string Graphics_defaultext
{ {
get get
{ {
return _Xp["Graphics", "defaultext"]; string s = _Xp["Graphics", "defaultext"];// get the saved value
//If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("Graphics", "defaultext"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
s = "TIF";// default to volian default
return s;
} }
set set
{ {
_Xp["Graphics", "defaultext"] = value; // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("Graphics", "defaultext"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "TIF";
if (parval.Equals(value))
_Xp["Graphics", "defaultext"] = string.Empty; // reset to parent value
else
_Xp["Graphics", "defaultext"] = value; // save selected value
OnPropertyChanged("Graphics_defaultext"); OnPropertyChanged("Graphics_defaultext");
} }
} }
#endregion #endregion
#region ColorCategory // From veproms.ini #region ColorCategory // From veproms.ini
// Note that not all possibilities from 16-bit will be added here, until // ** Note that not all possibilities from 16-bit will be added here, until
// it is determined how these will be used // ** it is determined how these will be used
//[Category("Color")] // ** If this is used (unhidden), then we need to add logic to blank setting if the value
// ** we are saving is the same as the parent's value.
//PROPGRID: Hide Editor Color for ROs
[Category("Editor Settings")] [Category("Editor Settings")]
//[DisplayName("Referenced Object Highlight")] [Browsable(false)]
[DisplayName("Step Editor Colors - Referenced Objects")] [DisplayName("Step Editor Colors - Referenced Objects")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Color used to highlight an RO in procedure text")] [Description("Color used to highlight an RO in procedure text")]
@ -208,9 +235,9 @@ namespace VEPROMS.CSLA.Library
OnPropertyChanged("Color_ro"); OnPropertyChanged("Color_ro");
} }
} }
//[Category("Color")] //PROPGRID: Hide Editor Color for Transitions
[Category("Editor Settings")] [Category("Editor Settings")]
//[DisplayName("Transition Highlight")] [Browsable(false)]
[DisplayName("Step Editor Colors - Transitions")] [DisplayName("Step Editor Colors - Transitions")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Color used to highlight a Transition in procedure text")] [Description("Color used to highlight a Transition in procedure text")]
@ -226,9 +253,9 @@ namespace VEPROMS.CSLA.Library
OnPropertyChanged("Color_transition"); OnPropertyChanged("Color_transition");
} }
} }
//[Category("Color")] //PROPGRID: Hide Active Text Background Color
[Category("Editor Settings")] [Category("Editor Settings")]
//[DisplayName("editbackground")] [Browsable(false)]
[DisplayName("Step Editor Colors - Active Background")] [DisplayName("Step Editor Colors - Active Background")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("editbackground")] [Description("editbackground")]
@ -244,7 +271,9 @@ namespace VEPROMS.CSLA.Library
OnPropertyChanged("Color_editbackground"); OnPropertyChanged("Color_editbackground");
} }
} }
//PROPGRID: Hide color setting for Black
[Category("Color")] [Category("Color")]
[Browsable(false)]
[DisplayName("black")] [DisplayName("black")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("black")] [Description("black")]
@ -260,7 +289,9 @@ namespace VEPROMS.CSLA.Library
OnPropertyChanged("Color_black"); OnPropertyChanged("Color_black");
} }
} }
//PROPGRID: Hide Color Setting for Blue
[Category("Color")] [Category("Color")]
[Browsable(false)]
[DisplayName("blue")] [DisplayName("blue")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("blue")] [Description("blue")]
@ -278,10 +309,8 @@ namespace VEPROMS.CSLA.Library
} }
#endregion // From veproms.ini #endregion // From veproms.ini
#region SystemPrintCategory // From veproms.ini #region SystemPrintCategory // From veproms.ini
//[Category("System Print")]
[Category("Print Settings")] [Category("Print Settings")]
[DisplayName("Override Underline Thickness (dots)")] [DisplayName("Override Underline Thickness (dots)")]
//[DisplayName("Underline Width")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Underline Width")] [Description("Underline Width")]
public int SysPrint_UWidth public int SysPrint_UWidth
@ -289,19 +318,36 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["SystemPrint", "UnderlineWidth"]; string s = _Xp["SystemPrint", "UnderlineWidth"];
if (s == string.Empty) return 10;
return int.Parse(_Xp["SystemPrint", "UnderlineWidth"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("SystemPrint", "UnderlineWidth"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return 10;// default to volian default
return int.Parse(s);
} }
set set
{ {
_Xp["SystemPrint", "UnderlineWidth"] = value.ToString(); // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("SystemPrint", "UnderlineWidth"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "10";
if (parval.Equals(value.ToString()))
_Xp["SystemPrint", "UnderlineWidth"] = string.Empty; // reset to parent value
else
_Xp["SystemPrint", "UnderlineWidth"] = value.ToString(); // save selected value
OnPropertyChanged("SysPrint_UWidth"); OnPropertyChanged("SysPrint_UWidth");
} }
} }
//[Category("System Print")]
[Category("Print Settings")] [Category("Print Settings")]
[DisplayName("Adjust Starting Print Position (dots)")] [DisplayName("Adjust Starting Print Position (dots)")]
//[DisplayName("Vertical Offset")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Vertical Offset")] [Description("Vertical Offset")]
public int SysPrint_VOffset public int SysPrint_VOffset
@ -309,19 +355,36 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["SystemPrint", "VerticalOffset"]; string s = _Xp["SystemPrint", "VerticalOffset"];
if (s == string.Empty) return 0;
return int.Parse(_Xp["SystemPrint", "VerticalOffset"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("SystemPrint", "VerticalOffset"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return 0;// default to volian default
return int.Parse(s);
} }
set set
{ {
_Xp["SystemPrint", "VerticalOffset"] = value.ToString(); // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("SystemPrint", "VerticalOffset"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "0";
if (parval.Equals(value.ToString()))
_Xp["SystemPrint", "VerticalOffset"] = string.Empty; // reset to parent value
else
_Xp["SystemPrint", "VerticalOffset"] = value.ToString(); // save selected value
OnPropertyChanged("SysPrint_VOffset"); OnPropertyChanged("SysPrint_VOffset");
} }
} }
//[Category("System Print")]
[Category("Print Settings")] [Category("Print Settings")]
[DisplayName("Override Normal Pen Width (dots)")] [DisplayName("Override Normal Pen Width (dots)")]
//[DisplayName("Stroke Width")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Stroke Width")] [Description("Stroke Width")]
public int SysPrint_StrokeWidth public int SysPrint_StrokeWidth
@ -329,19 +392,36 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["SystemPrint", "StrokeWidth"]; string s = _Xp["SystemPrint", "StrokeWidth"];
if (s == string.Empty) return 0;
return int.Parse(_Xp["SystemPrint", "StrokeWidth"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("SystemPrint", "StrokeWidth"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return 0;// default to volian default
return int.Parse(s);
} }
set set
{ {
_Xp["SystemPrint", "StrokeWidth"] = value.ToString(); // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("SystemPrint", "StrokeWidth"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "0";
if (parval.Equals(((int)value).ToString()))
_Xp["SystemPrint", "StrokeWidth"] = string.Empty; // reset to parent value
else
_Xp["SystemPrint", "StrokeWidth"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("SysPrint_StrokeWidth"); OnPropertyChanged("SysPrint_StrokeWidth");
} }
} }
//[Category("System Print")]
[Category("Print Settings")] [Category("Print Settings")]
[DisplayName("Override Bold Pen Width (dots)")] [DisplayName("Override Bold Pen Width (dots)")]
//[DisplayName("Stroke Width Bold")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Stroke Width Bold")] [Description("Stroke Width Bold")]
public int SysPrint_StrokeWidthBold public int SysPrint_StrokeWidthBold
@ -349,22 +429,43 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["SystemPrint", "StrokeWidthBold"]; string s = _Xp["SystemPrint", "StrokeWidthBold"];
if (s == string.Empty) return 0;
return int.Parse(_Xp["SystemPrint", "StrokeWidthBold"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("SystemPrint", "StrokeWidthBold"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return 0;// default to volian default
return int.Parse(s);
} }
set set
{ {
_Xp["SystemPrint", "StrokeWidthBold"] = value.ToString(); // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("SystemPrint", "StrokeWidthBold"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "0";
if (parval.Equals(((int)value).ToString()))
_Xp["SystemPrint", "StrokeWidthBold"] = string.Empty; // reset to parent value
else
_Xp["SystemPrint", "StrokeWidthBold"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("SysPrint_StrokeWidthBold"); OnPropertyChanged("SysPrint_StrokeWidthBold");
} }
} }
#endregion #endregion
#region StartupCategory // From veproms.ini #region StartupCategory // From veproms.ini
//[Category("Startup")] //PROPGRID: Hide Startup Message Title
//PROPGRID: The Startup Grouping is not being used right now, thus not visable.
[Category("Startup Message")] [Category("Startup Message")]
[DisplayName("Startup MessageBox Title")] [DisplayName("Startup MessageBox Title")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Startup MessageBox Title")] [Description("Startup MessageBox Title")]
[Browsable(false)]
public string Startup_MsgTitle public string Startup_MsgTitle
{ {
get get
@ -377,11 +478,12 @@ namespace VEPROMS.CSLA.Library
OnPropertyChanged("Startup_MsgTitle"); OnPropertyChanged("Startup_MsgTitle");
} }
} }
//[Category("Startup")] //PROPGRID: Hide Startup Message File
[Category("Startup Message")] [Category("Startup Message")]
[DisplayName("Startup Message File")] [DisplayName("Startup Message File")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Startup Message File")] [Description("Startup Message File")]
[Browsable(false)]
public string Startup_MsgFile public string Startup_MsgFile
{ {
get get
@ -397,6 +499,9 @@ namespace VEPROMS.CSLA.Library
#endregion #endregion
#region ProcedureListTabStopsCategory // From veproms.ini #region ProcedureListTabStopsCategory // From veproms.ini
[Category("ProcedureListTabStops")] [Category("ProcedureListTabStops")]
//PROPGRID: Hide Procedure Number Tab
// ** Note that we will need to add logic it handle the reset to the parent value
[Browsable(false)]
[DisplayName("Procedure Number Tab")] [DisplayName("Procedure Number Tab")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Procedure Number Tab")] [Description("Procedure Number Tab")]
@ -415,6 +520,9 @@ namespace VEPROMS.CSLA.Library
} }
} }
[Category("ProcedureListTabStops")] [Category("ProcedureListTabStops")]
//PROPGRID: Hide Procedure Title Tab
// ** Note that we will need to add logic it handle the reset to the parent value
[Browsable(false)]
[DisplayName("Procedure Title Tab")] [DisplayName("Procedure Title Tab")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Procedure Title Tab")] [Description("Procedure Title Tab")]
@ -437,14 +545,17 @@ namespace VEPROMS.CSLA.Library
[TypeConverter(typeof(EnumDescConverter))] [TypeConverter(typeof(EnumDescConverter))]
public enum FormatColumns : int public enum FormatColumns : int
{ {
[Description("Format Default")]
Default = 0, Default = 0,
[Description("Single Column")]OneColumn, [Description("Single Column")]
[Description("Duel Column")]TwoColumn, OneColumn,
[Description("Triple Column")]ThreeColumn, [Description("Duel Column")]
[Description("Quad Column")]FourColumns TwoColumn,
[Description("Triple Column")]
ThreeColumn,
[Description("Quad Column")]
FourColumns
} }
//[Category("Format")]
//[DisplayName("Column Layout")]
[Category("Editor Settings")] [Category("Editor Settings")]
[DisplayName("Step Editor Columns")] [DisplayName("Step Editor Columns")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
@ -453,70 +564,117 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
string s = _Xp["format", "columns"]; string s = _Xp["format", "columns"];// get the saved value
if (s == string.Empty || s.Equals("-1")) return FormatColumns.Default;//return (FormatColumns)0;
return (FormatColumns)int.Parse(_Xp["format", "columns"]); //If there is no value to get, then get the parent value (a.k.a. default value).
//return Enum.Parse(typeof(FormatColumns),_Xp["format", "columns"]); if (s == string.Empty)
s = _Xp.ParentValue("format", "columns"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return FormatColumns.Default; // default to volian default
return (FormatColumns)int.Parse(s);
} }
set set
{ {
if (value == 0) _Xp["format", "columns"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
else _Xp["format", "columns"] = ((int)value).ToString(); // reset the data to use the parent value.
string parval = _Xp.ParentValue("format", "columns"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(FormatColumns.Default)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["format", "columns"] = string.Empty; // reset to parent value
else
_Xp["format", "columns"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Format_Columns"); OnPropertyChanged("Format_Columns");
} }
} }
//[Category("Format")]
//[DisplayName("Plant Format Name")]
[Category("Format Settings")]
[DisplayName("Format")]
[RefreshProperties(RefreshProperties.All)]
[Description("Default Plant Format")]
public string Format_Plant
{
get
{
return _Xp["format", "plant"];
}
set
{
_Xp["format", "plant"] = value;
OnPropertyChanged("Format_Plant");
}
}
#endregion #endregion
#region DefaultsCategory // from proc.ini #region DefaultsCategory // from proc.ini
//[Category("Defaults")]
[Category("Referenced Objects")] [Category("Referenced Objects")]
//[DisplayName("Default Setpoint Prefix")]
[DisplayName("Default RO Prefix")] [DisplayName("Default RO Prefix")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Default Setpoint Prefix")] [Description("Default Setpoint Prefix")]
public string Default_SPPrefix public string Default_SPPrefix
{ {
get { return _Xp["default", "spprefix"]; } get
{
string s = _Xp["default", "spprefix"];// get the saved value
//If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("default", "spprefix"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
s = "SP1";// default to volian default
return s;
}
set set
{ {
_Xp["default", "spprefix"] = value; // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("default", "spprefix"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "SP1";
if (parval.Equals(value))
_Xp["default", "spprefix"] = string.Empty; // reset to parent value
else
_Xp["default", "spprefix"] = value; // save selected value
OnPropertyChanged("Default_SPPrefix"); OnPropertyChanged("Default_SPPrefix");
} }
} }
//[Category("Defaults")]
[Category("Referenced Objects")] [Category("Referenced Objects")]
[DisplayName("Default Image Prefix")] [DisplayName("Default Image Prefix")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Default Image Prefix")] [Description("Default Image Prefix")]
public string Default_IMPrefix public string Default_IMPrefix
{ {
get { return _Xp["default", "imprefix"]; } get
{
string s = _Xp["default", "imprefix"];// get the saved value
//If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("default", "imprefix"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
s = "IG1";// default to volian default
return s;
}
set set
{ {
_Xp["default", "imprefix"] = value; // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("default", "imprefix"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "IG1";
if (parval.Equals(value))
_Xp["default", "imprefix"] = string.Empty; // reset to parent value
else
_Xp["default", "imprefix"] = value; // save selected value
OnPropertyChanged("RO_IMPrefix"); OnPropertyChanged("RO_IMPrefix");
} }
} }
#endregion #endregion
#region PrintSettingsCategory // From curset.dat #region PrintSettingsCategory // From curset.dat
//PROPGRID: Hide Print Number of Copies
[Category("Print Settings")] [Category("Print Settings")]
[Browsable(false)]
[DisplayName("Number of Copies")] [DisplayName("Number of Copies")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Number of Copies")] [Description("Number of Copies")]
@ -547,13 +705,31 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "Pagination"]; string s = _Xp["PrintSettings", "Pagination"];
if (s == string.Empty || s.Equals("-1")) return PrintPagination.Auto;
return (PrintPagination)int.Parse(_Xp["PrintSettings", "Pagination"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "Pagination"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintPagination.Auto;// default to volian default
return (PrintPagination)int.Parse(s);
} }
set set
{ {
if (value == PrintPagination.Auto) _Xp["PrintSettings", "Pagination"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
else _Xp["PrintSettings", "Pagination"] = ((int)value).ToString(); // reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "Pagination"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintPagination.Auto)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "Pagination"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "Pagination"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_Pagination"); OnPropertyChanged("Print_Pagination");
} }
} }
@ -561,7 +737,8 @@ namespace VEPROMS.CSLA.Library
public enum PrintWatermark : int public enum PrintWatermark : int
{ {
None = 0, Reference, Draft, Master, Sample, None = 0, Reference, Draft, Master, Sample,
[Description("Information Only")]InformationOnly [Description("Information Only")]
InformationOnly
} }
[Category("Print Settings")] [Category("Print Settings")]
@ -573,19 +750,36 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "Watermark"]; string s = _Xp["PrintSettings", "Watermark"];
if (s == string.Empty || s.Equals("-1")) return PrintWatermark.Draft;
return (PrintWatermark)int.Parse(_Xp["PrintSettings", "Watermark"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "Watermark"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintWatermark.Draft;// default to volian default
return (PrintWatermark)int.Parse(s);
} }
set set
{ {
if (value == PrintWatermark.Draft) _Xp["PrintSettings", "Watermark"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
else _Xp["PrintSettings", "Watermark"] = ((int)value).ToString(); // reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "Watermark"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintWatermark.Draft)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "Watermark"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "Watermark"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_Watermark"); OnPropertyChanged("Print_Watermark");
} }
} }
[Category("Print Settings")] [Category("Print Settings")]
[DisplayName("Disable Automatic Duplexing")] [DisplayName("Disable Automatic Duplexing")]
//[DisplayName("Disable Duplex Printing")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Disable Duplex Printing")] [Description("Disable Duplex Printing")]
public bool Print_DisableDuplex public bool Print_DisableDuplex
@ -593,12 +787,31 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "disableduplex"]; string s = _Xp["PrintSettings", "disableduplex"];
if (s == string.Empty) return false;
return bool.Parse(_Xp["PrintSettings", "disableduplex"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "disableduplex"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
s = "false";// default to volian default
return bool.Parse(s);
} }
set set
{ {
_Xp["PrintSettings", "disableduplex"] = value.ToString(); // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "disableduplex"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "false";
if (parval.Equals(value.ToString()))
_Xp["PrintSettings", "disableduplex"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "disableduplex"] = value.ToString(); // save selected value
OnPropertyChanged("Print_DisableDuplex"); OnPropertyChanged("Print_DisableDuplex");
} }
} }
@ -610,18 +823,15 @@ namespace VEPROMS.CSLA.Library
[TypeConverter(typeof(EnumDescConverter))] [TypeConverter(typeof(EnumDescConverter))]
public enum PrintChangeBar : int public enum PrintChangeBar : int
{ {
[Description("Select Before Printing")]SelectBeforePrinting = 0, [Description("Select Before Printing")]
[Description("Without Change Bars")]Without, SelectBeforePrinting = 0,
[Description("With Default Change Bars")]WithDefault, [Description("Without Change Bars")]
[Description("Use Custom Change Bars")]WithUserSpecified Without,
[Description("With Default Change Bars")]
WithDefault,
[Description("Use Custom Change Bars")]
WithUserSpecified
} }
//{
// [Description("Select When Printed")]NoDefault = 0,
// [Description("None")]Without,
// [Description("Default")]WithDefault,
// [Description("User Specified")]WithUserSpecified
//}
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
[DisplayName("Change Bar")] [DisplayName("Change Bar")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
@ -630,15 +840,32 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
string s = _Xp["PrintSettings", "ChangeBar"]; string s = _Xp["PrintSettings", "ChangeBar"];// get the saved value
if (s == string.Empty || s.Equals("-1")) return PrintChangeBar.SelectBeforePrinting;//PrintChangeBar.NoDefault;
return (PrintChangeBar)int.Parse(_Xp["PrintSettings", "ChangeBar"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "ChangeBar"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintChangeBar.SelectBeforePrinting;// default to volian default
return (PrintChangeBar)int.Parse(s);
} }
set set
{ {
// if (value == PrintChangeBar.NoDefault) _Xp["PrintSettings", "ChangeBar"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
if (value == PrintChangeBar.SelectBeforePrinting) _Xp["PrintSettings", "ChangeBar"] = string.Empty; // reset the data to use the parent value.
else _Xp["PrintSettings", "ChangeBar"] = ((int)value).ToString();
string parval = _Xp.ParentValue("PrintSettings", "ChangeBar"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintChangeBar.SelectBeforePrinting)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "ChangeBar"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "ChangeBar"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_ChangeBar"); OnPropertyChanged("Print_ChangeBar");
} }
} }
@ -650,15 +877,17 @@ namespace VEPROMS.CSLA.Library
[TypeConverter(typeof(EnumDescConverter))] [TypeConverter(typeof(EnumDescConverter))]
public enum PrintChangeBarLoc : int public enum PrintChangeBarLoc : int
{ {
[Description("With Text")]WithText = 0, [Description("With Text")]
[Description("Outside Box")]OutsideBox, WithText = 0,
[Description("AER on Left RNO on Right")]AERleftRNOright, [Description("Outside Box")]
[Description("To the Left of the Text")]LeftOfText OutsideBox,
[Description("AER on Left RNO on Right")]
AERleftRNOright,
[Description("To the Left of the Text")]
LeftOfText
} }
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
//[DisplayName("Change Bar Location")]
[DisplayName("Change Bar Position")] [DisplayName("Change Bar Position")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("User Specified Change Bar Location")] [Description("User Specified Change Bar Location")]
@ -667,13 +896,31 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "ChangeBarLoc"]; string s = _Xp["PrintSettings", "ChangeBarLoc"];
if (s == string.Empty || s.Equals("-1")) return PrintChangeBarLoc.WithText;
return (PrintChangeBarLoc)int.Parse(_Xp["PrintSettings", "ChangeBarLoc"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "ChangeBarLoc"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintChangeBarLoc.WithText;// default to volian default
return (PrintChangeBarLoc)int.Parse(s);
} }
set set
{ {
if (value == PrintChangeBarLoc.WithText) _Xp["PrintSettings", "ChangeBarLoc"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
else _Xp["PrintSettings", "ChangeBarLoc"] = ((int)value).ToString(); // reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "ChangeBarLoc"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintChangeBarLoc.WithText)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "ChangeBarLoc"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "ChangeBarLoc"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_ChangeBarLoc"); OnPropertyChanged("Print_ChangeBarLoc");
} }
} }
@ -687,15 +934,18 @@ namespace VEPROMS.CSLA.Library
[TypeConverter(typeof(EnumDescConverter))] [TypeConverter(typeof(EnumDescConverter))]
public enum PrintChangeBarText : int public enum PrintChangeBarText : int
{ {
[Description("Date and Change ID")]DateChgID = 0, [Description("Date and Change ID")]
[Description("Revision Number")]RevNum, DateChgID = 0,
[Description("Change ID")]ChgID, [Description("Revision Number")]
[Description("No Change Bar Text")]None, RevNum,
[Description("Custom Change Bar Text")]UserDef [Description("Change ID")]
ChgID,
[Description("No Change Bar Text")]
None,
[Description("Custom Change Bar Text")]
UserDef
} }
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
//[DisplayName("Change Bar Text")]
[DisplayName("Change bar Text Type")] [DisplayName("Change bar Text Type")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Change Bar Text")] [Description("Change Bar Text")]
@ -704,18 +954,39 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "ChangeBarText"]; string s = _Xp["PrintSettings", "ChangeBarText"];
if (s == string.Empty || s.Equals("-1")) return PrintChangeBarText.DateChgID;
return (PrintChangeBarText)int.Parse(_Xp["PrintSettings", "ChangeBarText"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "ChangeBarText"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintChangeBarText.DateChgID;// default to volian default
return (PrintChangeBarText)int.Parse(s);
} }
set set
{ {
if (value == PrintChangeBarText.DateChgID) _Xp["PrintSettings", "ChangeBarText"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
else _Xp["PrintSettings", "ChangeBarText"] = ((int)value).ToString(); // reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "ChangeBarText"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintChangeBarText.DateChgID)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "ChangeBarText"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "ChangeBarText"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_ChangeBarText"); OnPropertyChanged("Print_ChangeBarText");
} }
} }
//PROPGRID: Hide User Format
// ** If we unhide this, logic to reset to parent setting will need to be added
[Category("Print Settings")] [Category("Print Settings")]
[Browsable(false)]
[DisplayName("User Format")] [DisplayName("User Format")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("User Format")] [Description("User Format")]
@ -732,9 +1003,7 @@ namespace VEPROMS.CSLA.Library
} }
} }
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
//[DisplayName("User Change Bar Message1")]
[DisplayName("Custom Change Bar Message Line One")] [DisplayName("Custom Change Bar Message Line One")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("User Change Bar Message1")] [Description("User Change Bar Message1")]
@ -742,18 +1011,37 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
return _Xp["PrintSettings", "usercbmess1"]; string s = _Xp["PrintSettings", "usercbmess1"];// get the saved value
//If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "usercbmess1"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
s = "";// default to volian default
return s;
} }
set set
{ {
_Xp["PrintSettings", "usercbmess1"] = value; // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "usercbmess1"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "";
if (parval.Equals(value))
_Xp["PrintSettings", "usercbmess1"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "usercbmess1"] = value; // save selected value
OnPropertyChanged("Print_UserCBMess1"); OnPropertyChanged("Print_UserCBMess1");
} }
} }
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
//[DisplayName("User Change Bar Message2")]
[DisplayName("Custom Change Bar Message Line Two")] [DisplayName("Custom Change Bar Message Line Two")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("User Change Bar Message2")] [Description("User Change Bar Message2")]
@ -761,18 +1049,41 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
return _Xp["PrintSettings", "usercbmess2"]; string s = _Xp["PrintSettings", "usercbmess2"];// get the saved value
//If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "usercbmess2"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
s = "";// default to volian default
return s;
} }
set set
{ {
_Xp["PrintSettings", "usercbmess2"] = value; // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "usercbmess2"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "";
if (parval.Equals(value))
_Xp["PrintSettings", "usercbmess2"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "usercbmess2"] = value; // save selected value
OnPropertyChanged("Print_UserCBMess2"); OnPropertyChanged("Print_UserCBMess2");
} }
} }
#endregion #endregion
//[Category("Defaults")] //[Category("Defaults")]
//PROPGRID: Hide text background color
[Category("Editor Settings")] [Category("Editor Settings")]
//[DisplayName("Default BackColor")] [Browsable(false)]
[DisplayName("Step Editor Colors - Non Active Background")] [DisplayName("Step Editor Colors - Non Active Background")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Default Background Color")] [Description("Default Background Color")]
@ -780,7 +1091,6 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
//return _Xp["default", "BkColor"];
string sColor = _Xp["default", "BkColor"]; string sColor = _Xp["default", "BkColor"];
if (sColor == string.Empty) sColor = "White"; if (sColor == string.Empty) sColor = "White";
if (sColor[0] == '[') if (sColor[0] == '[')

View File

@ -32,13 +32,18 @@ namespace VEPROMS.CSLA.Library
} }
#endregion #endregion
#region Constructors #region Constructors
//PROPGRID: Hide ParentLookup
[Browsable(false)]
public bool ParentLookup public bool ParentLookup
{ {
get { return _Xp.ParentLookup; } get { return _Xp.ParentLookup; }
set { _Xp.ParentLookup = value; } set { _Xp.ParentLookup = value; }
} }
[NonSerialized] //PROPGRID: Needed to comment out [NonSerialized] in order to hide AncestorLookup from property grid
//[NonSerialized]
private bool _AncestorLookup; private bool _AncestorLookup;
//PROPGRID: Hide AncestorLookup
[Browsable(false)]
public bool AncestorLookup public bool AncestorLookup
{ {
get { return _AncestorLookup; } get { return _AncestorLookup; }
@ -115,7 +120,6 @@ namespace VEPROMS.CSLA.Library
} }
#endregion #endregion
#region Local Properties #region Local Properties
//[Category("Identification")]
[Category("General")] [Category("General")]
[DisplayName("Number")] [DisplayName("Number")]
[Description("Number")] [Description("Number")]
@ -124,7 +128,6 @@ namespace VEPROMS.CSLA.Library
get { return (_Procedure != null ? _Procedure.MyContent.Number : _ProcedureInfo.MyContent.Number); } get { return (_Procedure != null ? _Procedure.MyContent.Number : _ProcedureInfo.MyContent.Number); }
set { if (_Procedure != null) _Procedure.MyContent.Number = value; } set { if (_Procedure != null) _Procedure.MyContent.Number = value; }
} }
//[Category("Identification")]
[Category("General")] [Category("General")]
[DisplayName("Title")] [DisplayName("Title")]
[Description("Title")] [Description("Title")]
@ -134,6 +137,8 @@ namespace VEPROMS.CSLA.Library
set { if (_Procedure != null) _Procedure.MyContent.Text = value; } set { if (_Procedure != null) _Procedure.MyContent.Text = value; }
} }
[Category("Identification")] [Category("Identification")]
//PROPGRID: Hide Old Sequence
[Browsable(false)]
[DisplayName("Old Sequence")] [DisplayName("Old Sequence")]
[Description("Old Sequence")] [Description("Old Sequence")]
public string OldSequence public string OldSequence
@ -142,13 +147,14 @@ namespace VEPROMS.CSLA.Library
set { if (_Procedure != null) _Procedure.MyContent.MyZContent.OldStepSequence = value; } set { if (_Procedure != null) _Procedure.MyContent.MyZContent.OldStepSequence = value; }
} }
[Category("Identification")] [Category("Identification")]
//PROPGRID: Hide Dirty
[Browsable(false)]
[DisplayName("Dirty")] [DisplayName("Dirty")]
[Description("Dirty")] [Description("Dirty")]
public bool Dirty public bool Dirty
{ {
get { return (_Procedure != null ? _Procedure.IsDirty : false); } get { return (_Procedure != null ? _Procedure.IsDirty : false); }
} }
//[Category("Format")]
[Category("Format Settings")] [Category("Format Settings")]
[DisplayName("Format")] [DisplayName("Format")]
[Description("Format")] [Description("Format")]
@ -157,8 +163,6 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
//if (_DocVersion != null) return FormatList.ToString(_DocVersion.FormatID);
//if (_DocVersionInfo != null) return FormatList.ToString(_DocVersionInfo.FormatID);
if (_Procedure != null && _Procedure.MyContent.MyFormat != null) return _Procedure.MyContent.MyFormat.PlantFormat.FormatData.Name; if (_Procedure != null && _Procedure.MyContent.MyFormat != null) return _Procedure.MyContent.MyFormat.PlantFormat.FormatData.Name;
if (_ProcedureInfo != null && _ProcedureInfo.MyContent.MyFormat != null) return _ProcedureInfo.MyContent.MyFormat.PlantFormat.FormatData.Name; if (_ProcedureInfo != null && _ProcedureInfo.MyContent.MyFormat != null) return _ProcedureInfo.MyContent.MyFormat.PlantFormat.FormatData.Name;
return null; return null;
@ -168,18 +172,14 @@ namespace VEPROMS.CSLA.Library
if (_Procedure != null) _Procedure.MyContent.MyFormat = FormatList.ToFormat(value); // Can only be set if _DocVersion is set if (_Procedure != null) _Procedure.MyContent.MyFormat = FormatList.ToFormat(value); // Can only be set if _DocVersion is set
} }
} }
//[Category("Format")]
[Category("Format Settings")] [Category("Format Settings")]
//[DisplayName("Format")]
[DisplayName("Default Format")] [DisplayName("Default Format")]
[Description("Format")] [Description("Default Format")]
[TypeConverter(typeof(FormatList))] [TypeConverter(typeof(FormatList))]
public string DefaultFormatSelection public string DefaultFormatSelection
{ {
get get
{ {
//if (_Folder != null) return FormatList.ToString(_Folder.FormatID);
//if (_FolderInfo != null) return FormatList.ToString(_FolderInfo.FormatID);
if (_Procedure != null && _Procedure.ActiveParent != null && _Procedure.ActiveParent.ActiveFormat != null) return _Procedure.ActiveParent.ActiveFormat.PlantFormat.FormatData.Name; if (_Procedure != null && _Procedure.ActiveParent != null && _Procedure.ActiveParent.ActiveFormat != null) return _Procedure.ActiveParent.ActiveFormat.PlantFormat.FormatData.Name;
if (_ProcedureInfo != null && _ProcedureInfo.MyParent != null && _ProcedureInfo.MyParent.ActiveFormat != null) return _ProcedureInfo.MyParent.ActiveFormat.PlantFormat.FormatData.Name; if (_ProcedureInfo != null && _ProcedureInfo.MyParent != null && _ProcedureInfo.MyParent.ActiveFormat != null) return _ProcedureInfo.MyParent.ActiveFormat.PlantFormat.FormatData.Name;
return null; return null;
@ -208,9 +208,7 @@ namespace VEPROMS.CSLA.Library
[Description("Quad Column")] [Description("Quad Column")]
FourColumns FourColumns
} }
//[Category("Format")]
[Category("General")] [Category("General")]
//[DisplayName("Column Layout")]
[DisplayName("Default Column Mode")] [DisplayName("Default Column Mode")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Column Layout")] [Description("Column Layout")]
@ -219,18 +217,37 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["format", "columns"]; string s = _Xp["format", "columns"];
if (s == string.Empty || s.Equals("-1")) return FormatColumns.Default;//(FormatColumns)0;
return (FormatColumns)int.Parse(_Xp["format", "columns"]); //If there is no value to get, then get the parent value (a.k.a. default value).
//return Enum.Parse(typeof(FormatColumns),_Xp["format", "columns"]); if (s == string.Empty)
s = _Xp.ParentValue("format", "columns"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return FormatColumns.Default;// default to volian default
return (FormatColumns)int.Parse(s);
} }
set set
{ {
if (value == 0) _Xp["format", "columns"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
else _Xp["format", "columns"] = ((int)value).ToString(); // reset the data to use the parent value.
string parval = _Xp.ParentValue("format", "columns"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(FormatColumns.Default)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["format", "columns"] = string.Empty; // reset to parent value
else
_Xp["format", "columns"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Format_Columns"); OnPropertyChanged("Format_Columns");
} }
} }
[Category("Format")] [Category("Format")]
//PROPGRID: Hide Plant Format Name (using Format and Default Format)
[Browsable(false)]
[DisplayName("Plant Format Name")] [DisplayName("Plant Format Name")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Default Plant Format")] [Description("Default Plant Format")]
@ -249,6 +266,8 @@ namespace VEPROMS.CSLA.Library
#endregion #endregion
#region PrintSettingsCategory // From curset.dat #region PrintSettingsCategory // From curset.dat
[Category("Print Settings")] [Category("Print Settings")]
//PROPGRID: Hide Number of Copies
[Browsable(false)]
[DisplayName("Number of Copies")] [DisplayName("Number of Copies")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Number of Copies")] [Description("Number of Copies")]
@ -280,14 +299,32 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
string s = _Xp["PrintSettings", "Pagination"]; string s = _Xp["PrintSettings", "Pagination"];
if (s == string.Empty || s.Equals("-1")) return PrintPagination.Auto; //If there is no value to get, then get the parent value (a.k.a. default value).
return (PrintPagination)int.Parse(_Xp["PrintSettings", "Pagination"]); if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "Pagination"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintPagination.Auto;// default to volian default
return (PrintPagination)int.Parse(s);
} }
set set
{ {
if (value == PrintPagination.Auto) _Xp["PrintSettings", "Pagination"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
else _Xp["PrintSettings", "Pagination"] = ((int)value).ToString(); // reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "Pagination"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintPagination.Auto)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "Pagination"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "Pagination"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_Pagination"); OnPropertyChanged("Print_Pagination");
} }
} }
@ -307,18 +344,35 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "Watermark"]; string s = _Xp["PrintSettings", "Watermark"];
if (s == string.Empty || s.Equals("-1")) return PrintWatermark.Draft;
return (PrintWatermark)int.Parse(_Xp["PrintSettings", "Watermark"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "Watermark"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintWatermark.Draft;// default to volian default
return (PrintWatermark)int.Parse(s);
} }
set set
{ {
if (value == PrintWatermark.Draft) _Xp["PrintSettings", "Watermark"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
else _Xp["PrintSettings", "Watermark"] = ((int)value).ToString(); // reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "Watermark"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintWatermark.Draft)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "Watermark"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "Watermark"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_Watermark"); OnPropertyChanged("Print_Watermark");
} }
} }
[Category("Print Settings")] [Category("Print Settings")]
//[DisplayName("Disable Duplex Printing")]
[DisplayName("Disable Automatic Duplexing")] [DisplayName("Disable Automatic Duplexing")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Disable Duplex Printing")] [Description("Disable Duplex Printing")]
@ -327,12 +381,31 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "disableduplex"]; string s = _Xp["PrintSettings", "disableduplex"];
if (s == string.Empty) return false;
return bool.Parse(_Xp["PrintSettings", "disableduplex"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "disableduplex"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
s = "false";// default to volian default
return bool.Parse(s);
} }
set set
{ {
_Xp["PrintSettings", "disableduplex"] = value.ToString(); // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "disableduplex"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "false";
if (parval.Equals(value.ToString()))
_Xp["PrintSettings", "disableduplex"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "disableduplex"] = value.ToString(); // save selected value
OnPropertyChanged("Print_DisableDuplex"); OnPropertyChanged("Print_DisableDuplex");
} }
} }
@ -353,13 +426,6 @@ namespace VEPROMS.CSLA.Library
[Description("Use Custom Change Bars")] [Description("Use Custom Change Bars")]
WithUserSpecified WithUserSpecified
} }
//{
// [Description("Select When Printed")]NoDefault = 0,
// [Description("None")]Without,
// [Description("Default")]WithDefault,
// [Description("User Specified")]WithUserSpecified
//}
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
[DisplayName("Change Bar")] [DisplayName("Change Bar")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
@ -369,14 +435,31 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "ChangeBar"]; string s = _Xp["PrintSettings", "ChangeBar"];
if (s == string.Empty || s.Equals("-1")) return PrintChangeBar.SelectBeforePrinting;//PrintChangeBar.NoDefault;
return (PrintChangeBar)int.Parse(_Xp["PrintSettings", "ChangeBar"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "ChangeBar"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintChangeBar.SelectBeforePrinting;// default to volian default
return (PrintChangeBar)int.Parse(s);
} }
set set
{ {
//if (value == PrintChangeBar.NoDefault) _Xp["PrintSettings", "ChangeBar"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
if (value == PrintChangeBar.SelectBeforePrinting) _Xp["PrintSettings", "ChangeBar"] = string.Empty; // reset the data to use the parent value.
else _Xp["PrintSettings", "ChangeBar"] = ((int)value).ToString();
string parval = _Xp.ParentValue("PrintSettings", "ChangeBar"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintChangeBar.SelectBeforePrinting)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "ChangeBar"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "ChangeBar"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_ChangeBar"); OnPropertyChanged("Print_ChangeBar");
} }
} }
@ -397,9 +480,7 @@ namespace VEPROMS.CSLA.Library
[Description("To the Left of the Text")] [Description("To the Left of the Text")]
LeftOfText LeftOfText
} }
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
//[DisplayName("Change Bar Location")]
[DisplayName("Change Bar Position")] [DisplayName("Change Bar Position")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("User Specified Change Bar Location")] [Description("User Specified Change Bar Location")]
@ -408,13 +489,31 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "ChangeBarLoc"]; string s = _Xp["PrintSettings", "ChangeBarLoc"];
if (s == string.Empty || s.Equals("-1")) return PrintChangeBarLoc.WithText;
return (PrintChangeBarLoc)int.Parse(_Xp["PrintSettings", "ChangeBarLoc"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "ChangeBarLoc"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintChangeBarLoc.WithText;// default to volian default
return (PrintChangeBarLoc)int.Parse(s);
} }
set set
{ {
if (value == PrintChangeBarLoc.WithText) _Xp["PrintSettings", "ChangeBarLoc"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
else _Xp["PrintSettings", "ChangeBarLoc"] = ((int)value).ToString(); // reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "ChangeBarLoc"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintChangeBarLoc.WithText)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "ChangeBarLoc"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "ChangeBarLoc"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_ChangeBarLoc"); OnPropertyChanged("Print_ChangeBarLoc");
} }
} }
@ -439,9 +538,7 @@ namespace VEPROMS.CSLA.Library
[Description("Custom Change Bar Text")] [Description("Custom Change Bar Text")]
UserDef UserDef
} }
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
//[DisplayName("Change Bar Text")]
[DisplayName("Change Bar Text Type")] [DisplayName("Change Bar Text Type")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("Change Bar Text")] [Description("Change Bar Text")]
@ -450,18 +547,38 @@ namespace VEPROMS.CSLA.Library
get get
{ {
string s = _Xp["PrintSettings", "ChangeBarText"]; string s = _Xp["PrintSettings", "ChangeBarText"];
if (s == string.Empty || s.Equals("-1")) return PrintChangeBarText.DateChgID;
return (PrintChangeBarText)int.Parse(_Xp["PrintSettings", "ChangeBarText"]); //If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "ChangeBarText"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
return PrintChangeBarText.DateChgID;// default to volian default
return (PrintChangeBarText)int.Parse(s);
} }
set set
{ {
if (value == PrintChangeBarText.DateChgID) _Xp["PrintSettings", "ChangeBarText"] = string.Empty; // if value being saved is same as the parent value, then clear the value (save blank). This will
else _Xp["PrintSettings", "ChangeBarText"] = ((int)value).ToString(); // reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "ChangeBarText"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = ((int)(PrintChangeBarText.DateChgID)).ToString();
if (parval.Equals(((int)value).ToString()))
_Xp["PrintSettings", "ChangeBarText"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "ChangeBarText"] = ((int)value).ToString(); // save selected value
OnPropertyChanged("Print_ChangeBarText"); OnPropertyChanged("Print_ChangeBarText");
} }
} }
[Category("Print Settings")] [Category("Print Settings")]
//PROPGRID: Hide User Format
[Browsable(false)]
[DisplayName("User Format")] [DisplayName("User Format")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("User Format")] [Description("User Format")]
@ -478,9 +595,7 @@ namespace VEPROMS.CSLA.Library
} }
} }
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
//[DisplayName("User Change Bar Message1")]
[DisplayName("Custom Change Bar Message Line One")] [DisplayName("Custom Change Bar Message Line One")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("User Change Bar Message1")] [Description("User Change Bar Message1")]
@ -488,18 +603,37 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
return _Xp["PrintSettings", "usercbmess1"]; string s = _Xp["PrintSettings", "usercbmess1"];// get the saved value
//If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "usercbmess1"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
s = "";// default to volian default
return s;
} }
set set
{ {
_Xp["PrintSettings", "usercbmess1"] = value; // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "usercbmess1"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "";
if (parval.Equals(value))
_Xp["PrintSettings", "usercbmess1"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "usercbmess1"] = value; // save selected value
OnPropertyChanged("Print_UserCBMess1"); OnPropertyChanged("Print_UserCBMess1");
} }
} }
//[Category("Print Settings")]
[Category("Format Settings")] [Category("Format Settings")]
//[DisplayName("User Change Bar Message2")]
[DisplayName("Custom Change Bar Message Line Two")] [DisplayName("Custom Change Bar Message Line Two")]
[RefreshProperties(RefreshProperties.All)] [RefreshProperties(RefreshProperties.All)]
[Description("User Change Bar Message2")] [Description("User Change Bar Message2")]
@ -507,11 +641,32 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
return _Xp["PrintSettings", "usercbmess2"]; string s = _Xp["PrintSettings", "usercbmess2"];// get the saved value
//If there is no value to get, then get the parent value (a.k.a. default value).
if (s == string.Empty)
s = _Xp.ParentValue("PrintSettings", "usercbmess2"); // get the parent value
// If there is no parent value, then use the volian default
if (s == string.Empty)
s = "";// default to volian default
return s;
} }
set set
{ {
_Xp["PrintSettings", "usercbmess2"] = value; // if value being saved is same as the parent value, then clear the value (save blank). This will
// reset the data to use the parent value.
string parval = _Xp.ParentValue("PrintSettings", "usercbmess2"); // get the parent value
if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default
parval = "";
if (parval.Equals(value))
_Xp["PrintSettings", "usercbmess2"] = string.Empty; // reset to parent value
else
_Xp["PrintSettings", "usercbmess2"] = value; // save selected value
OnPropertyChanged("Print_UserCBMess2"); OnPropertyChanged("Print_UserCBMess2");
} }
} }