Better handling of parent information in Get and Set
This commit is contained in:
		| @@ -26,12 +26,16 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			get { return _Xp; } | ||||
| 		} | ||||
| 		//PROPGRID: Hide ParentLookup | ||||
| 		[Browsable(false)] | ||||
| 		public bool ParentLookup | ||||
| 		{ | ||||
| 			get { return _Xp.ParentLookup; } | ||||
| 			set { _Xp.ParentLookup = value; } | ||||
| 		} | ||||
| 		private bool _AncestorLookup; | ||||
| 		//PROPGRID: Hide AncestorLookup | ||||
| 		[Browsable(false)] | ||||
| 		public bool AncestorLookup | ||||
| 		{ | ||||
| 			get { return _AncestorLookup; } | ||||
| @@ -91,7 +95,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			return _Xp[group, item]; | ||||
| 		} | ||||
| 				//[Category("Identification")] | ||||
| 		[Category("General")] | ||||
| 		[DisplayName("Name")] | ||||
| 		[Description("Name")] | ||||
| @@ -100,8 +103,9 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get { return (_DocVersion != null ? _DocVersion.Name : _DocVersionInfo.Name); } | ||||
| 			set { if (_DocVersion != null) _DocVersion.Name = value; } | ||||
| 		} | ||||
| 				//[Category("Identification")] | ||||
| 		[Category("General")] | ||||
| 		//PROPGRID: Hide Title | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("Title")] | ||||
| 		[Description("Title")] | ||||
| 		public string Title | ||||
| @@ -109,7 +113,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get { return (_DocVersion != null ? _DocVersion.Title : _DocVersionInfo.Title); } | ||||
| 			set { if (_DocVersion != null) _DocVersion.Title = value; } | ||||
| 		} | ||||
| 				//[Category("Format")] | ||||
| 		[Category("Format Settings")] | ||||
| 		[DisplayName("Format")] | ||||
| 		[Description("Format")] | ||||
| @@ -118,8 +121,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			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 (_DocVersionInfo != null && _DocVersionInfo.MyFormat != null) return _DocVersionInfo.MyFormat.PlantFormat.FormatData.Name; | ||||
| 				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 | ||||
| 			} | ||||
| 		} | ||||
| 				//[Category("Format")] | ||||
| 		[Category("Format Settings")] | ||||
| 		[DisplayName("Default Format")] | ||||
| 				[Description("Format")] | ||||
| 		[Description("Default Format")] | ||||
| 		[TypeConverter(typeof(FormatList))] | ||||
| 		public string DefaultFormatSelection | ||||
| 		{ | ||||
| 			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 (_DocVersionInfo != null && _DocVersionInfo.MyFolder != null && _DocVersionInfo.MyFolder.ActiveParent != null) return _DocVersionInfo.MyFolder.ActiveFormat.PlantFormat.FormatData.Name; | ||||
| 				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> | ||||
|  | ||||
| 		#region RODefaults        // From proc.ini | ||||
| 		  //[Category("RODefaults")] | ||||
| 		[Category("Referenced Objects")] | ||||
| 		  //[DisplayName("Setpoint Prefix")] | ||||
| 		[DisplayName("Default RO Prefix")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Setpoint Prefix")] | ||||
| @@ -165,17 +161,36 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			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 | ||||
| 			{ | ||||
|                 _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"); | ||||
| 			} | ||||
| 		} | ||||
| 		  //[Category("RODefaults")] | ||||
| 		[Category("Referenced Objects")] | ||||
| 		  //[DisplayName("Graphics Prefix")] | ||||
| 		[DisplayName("Default Graphics Prefix")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Graphics Prefix")] | ||||
| @@ -183,17 +198,36 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			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 | ||||
| 			{ | ||||
|                 _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"); | ||||
| 			} | ||||
| 		} | ||||
| 		//[Category("Graphics")] | ||||
| 		[Category("Referenced Objects")] | ||||
| 		//[DisplayName("Default File Extension")] | ||||
| 		[DisplayName("Graphic File Extension")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Default File Extension")] | ||||
| @@ -201,17 +235,40 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			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 | ||||
| 			{ | ||||
| 				_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"); | ||||
| 			} | ||||
| 		} | ||||
| 		#endregion | ||||
| 		#region PrintSettingsCategory        // From curset.dat | ||||
| 		[Category("Print Settings")] | ||||
| 		//PROPGRID: Hide Printer | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("Number of Copies")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Number of Copies")] | ||||
| @@ -230,6 +287,8 @@ namespace VEPROMS.CSLA.Library | ||||
| 			} | ||||
| 		} | ||||
| 		[Category("Print Settings")] | ||||
| 		//PROPGRID: Hide Printer | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("Printer")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Printer")] | ||||
| @@ -246,12 +305,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 				OnPropertyChanged("Print_Printer"); | ||||
| 			} | ||||
| 		} | ||||
| 		  //public enum PrintWatermark : int | ||||
| 		  //{ | ||||
| 		  //    None = 0, Reference, Draft, Master, Sample, | ||||
| 		  //   [Description("Information Only")] | ||||
| 		  //   InformationOnly | ||||
| 		  //} | ||||
| 		[TypeConverter(typeof(EnumDescConverter))] | ||||
| 		public enum PrintWatermark : int | ||||
| 		{ | ||||
| @@ -259,7 +312,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 			[Description("Information Only")] | ||||
| 			InformationOnly | ||||
| 		} | ||||
| 		//[TypeConverter(typeof(EnumDescConverter))] | ||||
|  | ||||
| 		[Category("Print Settings")] | ||||
| 		[DisplayName("Watermark")] | ||||
| @@ -270,18 +322,35 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
|                 if (value == PrintWatermark.Draft) _Xp["PrintSettings", "Watermark"] = string.Empty; | ||||
|                 else _Xp["PrintSettings", "Watermark"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
| 		[Category("Print Settings")] | ||||
| 		  //[DisplayName("Disable Duplex Printing")] | ||||
| 		[DisplayName("Disable Automatic Duplexing")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Disable Duplex Printing")] | ||||
| @@ -290,12 +359,31 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
|                 _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"); | ||||
| 			} | ||||
| 		} | ||||
| @@ -304,10 +392,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 		//      Without Change Bars | ||||
| 		//      With Default Change Bars | ||||
| 		//      With User Specified Change Bars | ||||
| 		  //public enum PrintChangeBar : int | ||||
| 		  //{ | ||||
| 		  //   NoDefault = 0, Without, WithDefault, WithUserSpecified | ||||
| 		  //} | ||||
| 		[TypeConverter(typeof(EnumDescConverter))] | ||||
| 		public enum PrintChangeBar : int | ||||
| 		{ | ||||
| @@ -321,9 +405,7 @@ namespace VEPROMS.CSLA.Library | ||||
| 			WithUserSpecified | ||||
| 		} | ||||
|  | ||||
| 		  //[Category("Print Settings")] | ||||
| 		[Category("Format Settings")] | ||||
| 		  //[DisplayName("Change Bar")] | ||||
| 		[DisplayName("Change Bars")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Change Bar Use")] | ||||
| @@ -332,28 +414,34 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 					//if (value == PrintChangeBar.NoDefault) _Xp["PrintSettings", "ChangeBar"] = string.Empty; | ||||
| 					if (value == PrintChangeBar.SelectBeforePrinting) _Xp["PrintSettings", "ChangeBar"] = string.Empty; | ||||
| 					else _Xp["PrintSettings", "ChangeBar"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
| 		//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: | ||||
| 		//      With Text | ||||
| 		//      Outside Box | ||||
| @@ -371,9 +459,7 @@ namespace VEPROMS.CSLA.Library | ||||
| 			[Description("To the Left of the Text")] | ||||
| 			LeftOfText | ||||
| 		} | ||||
| 		  //[Category("Print Settings")] | ||||
| 		[Category("Format Settings")] | ||||
| 		  //[DisplayName("Change Bar Location")] | ||||
| 		[DisplayName("Change Bar Position")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("User Specified Change Bar Location")] | ||||
| @@ -382,13 +468,31 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
|                 if (value == PrintChangeBarLoc.WithText) _Xp["PrintSettings", "ChangeBarLoc"] = string.Empty; | ||||
|                 else _Xp["PrintSettings", "ChangeBarLoc"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
| @@ -399,10 +503,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 		//      Change ID | ||||
| 		//      No Change Bar Message | ||||
| 		//      User Defined Message | ||||
| 		//public enum PrintChangeBarText : int | ||||
| 		//{ | ||||
| 		//   DateChgID = 0, RevNum, ChgID, None, UserDef | ||||
| 		//} | ||||
| 		[TypeConverter(typeof(EnumDescConverter))] | ||||
| 		public enum PrintChangeBarText : int | ||||
| 		{ | ||||
| @@ -417,9 +517,7 @@ namespace VEPROMS.CSLA.Library | ||||
| 			[Description("Custom Change Bar Text")] | ||||
| 			UserDef | ||||
| 		} | ||||
| 		  //[Category("Print Settings")] | ||||
| 		[Category("Format Settings")] | ||||
| 		  //[DisplayName("Change Bar Text")] | ||||
| 		[DisplayName("Change Bar Text Type")] | ||||
| 		[Description("Change Bar Text")] | ||||
| 		public PrintChangeBarText Print_ChangeBarText | ||||
| @@ -427,19 +525,35 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
|                 if (value == PrintChangeBarText.DateChgID) _Xp["PrintSettings", "ChangeBarText"] = string.Empty; | ||||
|                 else _Xp["PrintSettings", "ChangeBarText"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
| 		  //[Category("Print Settings")] | ||||
| 		[Category("Format Settings")] | ||||
| 		  //[DisplayName("User Change Bar Message1")] | ||||
| 		[DisplayName("Custom Change Bar Message Line One")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("User Change Bar Message1")] | ||||
| @@ -447,17 +561,36 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			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 | ||||
| 			{ | ||||
| 				  _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"); | ||||
| 			} | ||||
| 		} | ||||
| 		  //[Category("Print Settings")] | ||||
| 		[Category("Format Settings")] | ||||
| 		  //[DisplayName("User Change Bar Message2")] | ||||
| 		[DisplayName("Custom Change Bar Message Line Two")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("User Change Bar Message2")] | ||||
| @@ -465,15 +598,38 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			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 | ||||
| 			{ | ||||
| 				  _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"); | ||||
| 			} | ||||
| 		} | ||||
| 		[Category("Print Settings")] | ||||
| 		//PROPGRID: Hide User Format | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("User Format")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("User Format")] | ||||
| @@ -502,17 +658,36 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				  if (value == PrintPagination.Auto) _Xp["PrintSettings", "Pagination"] = string.Empty; | ||||
| 				  else _Xp["PrintSettings", "Pagination"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
| 		#endregion | ||||
| 		#region DELETE_ME | ||||
| 		/* | ||||
|         #region ColorCategory       // From veproms.ini | ||||
|         // Note that not all possibilities from 16-bit will be added here, until | ||||
| @@ -1050,5 +1225,6 @@ OnPropertyChanged("Default_BkColor"); | ||||
| } | ||||
| } | ||||
| */ | ||||
| 		#endregion | ||||
| 	} | ||||
| } | ||||
| @@ -27,13 +27,19 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			get { return _Xp; } | ||||
| 		} | ||||
| 		//PROPGRID: Hide ParentLookup | ||||
| 		[Browsable(false)] | ||||
| 		public bool ParentLookup | ||||
| 		{ | ||||
| 			get { return _Xp.ParentLookup; } | ||||
| 			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; | ||||
| 		[Browsable(false)] | ||||
| 		public bool AncestorLookup | ||||
| 		{ | ||||
| 			get { return _AncestorLookup; } | ||||
| @@ -51,16 +57,21 @@ namespace VEPROMS.CSLA.Library | ||||
| 		} | ||||
| 		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) | ||||
| 			{ | ||||
| 					string retval = folder.FolderConfig.GetValue( args.Group, args.Item); | ||||
| 				string retval = folder.FolderConfig.GetValue(group, item); | ||||
| 				if (retval != string.Empty) return retval; | ||||
| 			} | ||||
| 			} | ||||
| 			return string.Empty; | ||||
| 		} | ||||
|  | ||||
| 		private string Xp_LookInAncestorFolderInfo(object sender, XMLPropertiesArgs args) | ||||
| 		{ | ||||
| 			if (_AncestorLookup || ParentLookup) | ||||
| @@ -93,7 +104,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			return _Xp[group, item]; | ||||
| 		} | ||||
| 		//[Category("Identification")] | ||||
| 		[Category("General")] | ||||
| 		[DisplayName("Name")] | ||||
| 		[Description("Name")] | ||||
| @@ -102,8 +112,9 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get { return (_Folder != null ? _Folder.Name : _FolderInfo.Name); } | ||||
| 			set { if (_Folder != null)_Folder.Name = value; } | ||||
| 		} | ||||
| 		//[Category("Identification")] | ||||
| 		//PROPGRID: Hide Title | ||||
| 		[Category("General")] | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("Title")] | ||||
| 		[Description("Title")] | ||||
| 		public string Title | ||||
| @@ -111,8 +122,9 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get { return (_Folder != null ? _Folder.Title : _FolderInfo.Title); } | ||||
| 			set { _Folder.Title = value; } | ||||
| 		} | ||||
| 		//[Category("Identification")] | ||||
| 		//PROPGRID: Hide Short Name | ||||
| 		[Category("General")] | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("Short Name")] | ||||
| 		[Description("Short Name")] | ||||
| 		public string ShortName | ||||
| @@ -120,7 +132,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get { return (_Folder != null ? _Folder.ShortName : _FolderInfo.ShortName); } | ||||
| 			set { if (_Folder != null)_Folder.ShortName = value; } | ||||
| 		} | ||||
| 		//[Category("Format")] | ||||
| 		[Category("Format Settings")] | ||||
| 		[DisplayName("Format")] | ||||
| 		[Description("Format")] | ||||
| @@ -129,8 +140,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			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 (_FolderInfo != null && _FolderInfo.MyFormat != null) return _FolderInfo.MyFormat.PlantFormat.FormatData.Name; | ||||
| 				return null; | ||||
| @@ -140,18 +149,14 @@ namespace VEPROMS.CSLA.Library | ||||
| 				if (_Folder != null) _Folder.MyFormat = FormatList.ToFormat(value); | ||||
| 			} | ||||
| 		} | ||||
| 		//[Category("Format")] | ||||
| 		[Category("Format Settings")] | ||||
| 		[DisplayName("Default Format")] | ||||
| 		//[DisplayName("Format")] | ||||
| 		[Description("Format")] | ||||
| 		[Description("Default Format")] | ||||
| 		[TypeConverter(typeof(FormatList))] | ||||
| 		public string DefaultFormatSelection | ||||
| 		{ | ||||
| 			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 (_FolderInfo != null && _FolderInfo.MyParent != null && _FolderInfo.MyParent.ActiveFormat != null) return _FolderInfo.MyParent.ActiveFormat.PlantFormat.FormatData.Name; | ||||
| 				return null; | ||||
| @@ -168,31 +173,53 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			return true; | ||||
| 		} | ||||
| 		//[Category("Graphics")] | ||||
| 		[Category("Referenced Objects")] | ||||
| 		[DisplayName("Graphic File Extension")] | ||||
| 		//[DisplayName("Default File Extension")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Default File Extension")] | ||||
| 		public string Graphics_defaultext | ||||
| 		{ | ||||
| 			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 | ||||
| 			{ | ||||
| 				_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"); | ||||
| 			} | ||||
| 		} | ||||
| 		#endregion | ||||
| 		#region ColorCategory       // From veproms.ini | ||||
| 		// Note that not all possibilities from 16-bit will be added here, until | ||||
| 		// it is determined how these will be used | ||||
| 		//[Category("Color")] | ||||
| 		// ** Note that not all possibilities from 16-bit will be added here, until | ||||
| 		// ** it is determined how these will be used | ||||
| 		// ** 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")] | ||||
| 		//[DisplayName("Referenced Object Highlight")] | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("Step Editor Colors - Referenced Objects")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Color used to highlight an RO in procedure text")] | ||||
| @@ -208,9 +235,9 @@ namespace VEPROMS.CSLA.Library | ||||
| 				OnPropertyChanged("Color_ro"); | ||||
| 			} | ||||
| 		} | ||||
| 		//[Category("Color")] | ||||
| 		//PROPGRID: Hide Editor Color for Transitions | ||||
| 		[Category("Editor Settings")] | ||||
| 		//[DisplayName("Transition Highlight")] | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("Step Editor Colors - Transitions")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Color used to highlight a Transition in procedure text")] | ||||
| @@ -226,9 +253,9 @@ namespace VEPROMS.CSLA.Library | ||||
| 				OnPropertyChanged("Color_transition"); | ||||
| 			} | ||||
| 		} | ||||
| 		//[Category("Color")] | ||||
| 		//PROPGRID: Hide Active Text Background Color | ||||
| 		[Category("Editor Settings")] | ||||
| 		//[DisplayName("editbackground")] | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("Step Editor Colors - Active Background")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("editbackground")] | ||||
| @@ -244,7 +271,9 @@ namespace VEPROMS.CSLA.Library | ||||
| 				OnPropertyChanged("Color_editbackground"); | ||||
| 			} | ||||
| 		} | ||||
| 		//PROPGRID: Hide color setting for Black | ||||
| 		[Category("Color")] | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("black")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("black")] | ||||
| @@ -260,7 +289,9 @@ namespace VEPROMS.CSLA.Library | ||||
| 				OnPropertyChanged("Color_black"); | ||||
| 			} | ||||
| 		} | ||||
| 		//PROPGRID: Hide Color Setting for Blue | ||||
| 		[Category("Color")] | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("blue")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("blue")] | ||||
| @@ -278,10 +309,8 @@ namespace VEPROMS.CSLA.Library | ||||
| 		} | ||||
| 		#endregion       // From veproms.ini | ||||
| 		#region SystemPrintCategory     // From veproms.ini | ||||
| 		//[Category("System Print")] | ||||
| 		[Category("Print Settings")] | ||||
| 		[DisplayName("Override Underline Thickness (dots)")] | ||||
| 		//[DisplayName("Underline Width")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Underline Width")] | ||||
| 		public int SysPrint_UWidth | ||||
| @@ -289,19 +318,36 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				_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"); | ||||
| 			} | ||||
| 		} | ||||
| 		//[Category("System Print")] | ||||
| 		[Category("Print Settings")] | ||||
| 		[DisplayName("Adjust Starting Print Position (dots)")] | ||||
| 		//[DisplayName("Vertical Offset")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Vertical Offset")] | ||||
| 		public int SysPrint_VOffset | ||||
| @@ -309,19 +355,36 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				_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"); | ||||
| 			} | ||||
| 		} | ||||
| 		//[Category("System Print")] | ||||
| 		[Category("Print Settings")] | ||||
| 		[DisplayName("Override Normal Pen Width (dots)")] | ||||
| 		//[DisplayName("Stroke Width")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Stroke Width")] | ||||
| 		public int SysPrint_StrokeWidth | ||||
| @@ -329,19 +392,36 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				_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"); | ||||
| 			} | ||||
| 		} | ||||
| 		//[Category("System Print")] | ||||
| 		[Category("Print Settings")] | ||||
| 		[DisplayName("Override Bold Pen Width (dots)")] | ||||
| 		//[DisplayName("Stroke Width Bold")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Stroke Width Bold")] | ||||
| 		public int SysPrint_StrokeWidthBold | ||||
| @@ -349,22 +429,43 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				_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"); | ||||
| 			} | ||||
| 		} | ||||
| 		#endregion | ||||
| 		#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")] | ||||
| 		[DisplayName("Startup MessageBox Title")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Startup MessageBox Title")] | ||||
| 		[Browsable(false)] | ||||
| 		public string Startup_MsgTitle | ||||
| 		{ | ||||
| 			get | ||||
| @@ -377,11 +478,12 @@ namespace VEPROMS.CSLA.Library | ||||
| 				OnPropertyChanged("Startup_MsgTitle"); | ||||
| 			} | ||||
| 		} | ||||
| 		//[Category("Startup")] | ||||
| 		//PROPGRID: Hide Startup Message File | ||||
| 		[Category("Startup Message")] | ||||
| 		[DisplayName("Startup Message File")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Startup Message File")] | ||||
| 		[Browsable(false)] | ||||
| 		public string Startup_MsgFile | ||||
| 		{ | ||||
| 			get | ||||
| @@ -397,6 +499,9 @@ namespace VEPROMS.CSLA.Library | ||||
| 		#endregion | ||||
| 		#region ProcedureListTabStopsCategory       // From veproms.ini | ||||
| 		[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")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Procedure Number Tab")] | ||||
| @@ -415,6 +520,9 @@ namespace VEPROMS.CSLA.Library | ||||
| 			} | ||||
| 		} | ||||
| 		[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")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Procedure Title Tab")] | ||||
| @@ -437,14 +545,17 @@ namespace VEPROMS.CSLA.Library | ||||
| 		[TypeConverter(typeof(EnumDescConverter))] | ||||
| 		public enum FormatColumns : int | ||||
| 		{ | ||||
| 			[Description("Format Default")] | ||||
| 			Default = 0, | ||||
| 			 [Description("Single Column")]OneColumn,  | ||||
| 			 [Description("Duel Column")]TwoColumn,  | ||||
| 			 [Description("Triple Column")]ThreeColumn,  | ||||
| 			 [Description("Quad Column")]FourColumns | ||||
| 			[Description("Single Column")] | ||||
| 			OneColumn, | ||||
| 			[Description("Duel Column")] | ||||
| 			TwoColumn, | ||||
| 			[Description("Triple Column")] | ||||
| 			ThreeColumn, | ||||
| 			[Description("Quad Column")] | ||||
| 			FourColumns | ||||
| 		} | ||||
| 		//[Category("Format")] | ||||
| 		//[DisplayName("Column Layout")] | ||||
| 		[Category("Editor Settings")] | ||||
| 		[DisplayName("Step Editor Columns")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| @@ -453,70 +564,117 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			get | ||||
| 			{ | ||||
| 				string s = _Xp["format", "columns"]; | ||||
| 				if (s == string.Empty || s.Equals("-1")) return FormatColumns.Default;//return (FormatColumns)0; | ||||
| 				return (FormatColumns)int.Parse(_Xp["format", "columns"]); | ||||
| 				//return Enum.Parse(typeof(FormatColumns),_Xp["format", "columns"]); | ||||
| 				string s = _Xp["format", "columns"];// 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("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 | ||||
| 			{ | ||||
| 				if (value == 0) _Xp["format", "columns"] = string.Empty; | ||||
| 				else _Xp["format", "columns"] = ((int)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("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"); | ||||
| 			} | ||||
| 		} | ||||
| 		//[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 | ||||
|  | ||||
| 		#region DefaultsCategory        // from proc.ini | ||||
| 		//[Category("Defaults")] | ||||
| 		[Category("Referenced Objects")] | ||||
| 		//[DisplayName("Default Setpoint Prefix")] | ||||
| 		[DisplayName("Default RO Prefix")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Default Setpoint Prefix")] | ||||
| 		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 | ||||
| 			{ | ||||
| 				_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"); | ||||
| 			} | ||||
| 		} | ||||
| 		//[Category("Defaults")] | ||||
| 		[Category("Referenced Objects")] | ||||
| 		[DisplayName("Default Image Prefix")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Default Image Prefix")] | ||||
| 		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 | ||||
| 			{ | ||||
| 				_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"); | ||||
| 			} | ||||
| 		} | ||||
| 		#endregion | ||||
| 		#region PrintSettingsCategory       // From curset.dat | ||||
| 		//PROPGRID: Hide Print Number of Copies | ||||
| 		[Category("Print Settings")] | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("Number of Copies")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Number of Copies")] | ||||
| @@ -547,13 +705,31 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				if (value == PrintPagination.Auto) _Xp["PrintSettings", "Pagination"] = string.Empty; | ||||
| 				else _Xp["PrintSettings", "Pagination"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
| @@ -561,7 +737,8 @@ namespace VEPROMS.CSLA.Library | ||||
| 		public enum PrintWatermark : int | ||||
| 		{ | ||||
| 			None = 0, Reference, Draft, Master, Sample, | ||||
| 			[Description("Information Only")]InformationOnly | ||||
| 			[Description("Information Only")] | ||||
| 			InformationOnly | ||||
| 		} | ||||
|  | ||||
| 		[Category("Print Settings")] | ||||
| @@ -573,19 +750,36 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				if (value == PrintWatermark.Draft) _Xp["PrintSettings", "Watermark"] = string.Empty; | ||||
| 				else _Xp["PrintSettings", "Watermark"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
| 		[Category("Print Settings")] | ||||
| 		[DisplayName("Disable Automatic Duplexing")] | ||||
| 		//[DisplayName("Disable Duplex Printing")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Disable Duplex Printing")] | ||||
| 		public bool Print_DisableDuplex | ||||
| @@ -593,12 +787,31 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				_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"); | ||||
| 			} | ||||
| 		} | ||||
| @@ -610,18 +823,15 @@ namespace VEPROMS.CSLA.Library | ||||
| 		[TypeConverter(typeof(EnumDescConverter))] | ||||
| 		public enum PrintChangeBar : int | ||||
| 		{ | ||||
| 			[Description("Select Before Printing")]SelectBeforePrinting = 0,  | ||||
| 			[Description("Without Change Bars")]Without,  | ||||
| 			[Description("With Default Change Bars")]WithDefault,  | ||||
| 			[Description("Use Custom Change Bars")]WithUserSpecified | ||||
| 			[Description("Select Before Printing")] | ||||
| 			SelectBeforePrinting = 0, | ||||
| 			[Description("Without Change Bars")] | ||||
| 			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")] | ||||
| 		[DisplayName("Change Bar")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| @@ -630,15 +840,32 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			get | ||||
| 			{ | ||||
| 				string s = _Xp["PrintSettings", "ChangeBar"]; | ||||
| 				if (s == string.Empty || s.Equals("-1")) return PrintChangeBar.SelectBeforePrinting;//PrintChangeBar.NoDefault; | ||||
| 				return (PrintChangeBar)int.Parse(_Xp["PrintSettings", "ChangeBar"]); | ||||
| 				string s = _Xp["PrintSettings", "ChangeBar"];// 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", "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 | ||||
| 			{ | ||||
| 	//			if (value == PrintChangeBar.NoDefault) _Xp["PrintSettings", "ChangeBar"] = string.Empty; | ||||
| 				if (value == PrintChangeBar.SelectBeforePrinting) _Xp["PrintSettings", "ChangeBar"] = string.Empty; | ||||
| 				else _Xp["PrintSettings", "ChangeBar"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
| @@ -650,15 +877,17 @@ namespace VEPROMS.CSLA.Library | ||||
| 		[TypeConverter(typeof(EnumDescConverter))] | ||||
| 		public enum PrintChangeBarLoc : int | ||||
| 		{ | ||||
| 			[Description("With Text")]WithText = 0,  | ||||
| 			[Description("Outside Box")]OutsideBox,  | ||||
| 			[Description("AER on Left RNO on Right")]AERleftRNOright,  | ||||
| 			[Description("To the Left of the Text")]LeftOfText | ||||
| 			[Description("With Text")] | ||||
| 			WithText = 0, | ||||
| 			[Description("Outside Box")] | ||||
| 			OutsideBox, | ||||
| 			[Description("AER on Left RNO on Right")] | ||||
| 			AERleftRNOright, | ||||
| 			[Description("To the Left of the Text")] | ||||
| 			LeftOfText | ||||
| 		} | ||||
|  | ||||
| 		//[Category("Print Settings")] | ||||
| 		[Category("Format Settings")] | ||||
| 		//[DisplayName("Change Bar Location")] | ||||
| 		[DisplayName("Change Bar Position")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("User Specified Change Bar Location")] | ||||
| @@ -667,13 +896,31 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				if (value == PrintChangeBarLoc.WithText) _Xp["PrintSettings", "ChangeBarLoc"] = string.Empty; | ||||
| 				else _Xp["PrintSettings", "ChangeBarLoc"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
| @@ -687,15 +934,18 @@ namespace VEPROMS.CSLA.Library | ||||
| 		[TypeConverter(typeof(EnumDescConverter))] | ||||
| 		public enum PrintChangeBarText : int | ||||
| 		{ | ||||
| 			[Description("Date and Change ID")]DateChgID = 0,  | ||||
| 			[Description("Revision Number")]RevNum,  | ||||
| 			[Description("Change ID")]ChgID,  | ||||
| 			[Description("No Change Bar Text")]None,  | ||||
| 			[Description("Custom Change Bar Text")]UserDef | ||||
| 			[Description("Date and Change ID")] | ||||
| 			DateChgID = 0, | ||||
| 			[Description("Revision Number")] | ||||
| 			RevNum, | ||||
| 			[Description("Change ID")] | ||||
| 			ChgID, | ||||
| 			[Description("No Change Bar Text")] | ||||
| 			None, | ||||
| 			[Description("Custom Change Bar Text")] | ||||
| 			UserDef | ||||
| 		} | ||||
| 		//[Category("Print Settings")] | ||||
| 		[Category("Format Settings")] | ||||
| 		//[DisplayName("Change Bar Text")] | ||||
| 		[DisplayName("Change bar Text Type")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Change Bar Text")] | ||||
| @@ -704,18 +954,39 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				if (value == PrintChangeBarText.DateChgID) _Xp["PrintSettings", "ChangeBarText"] = string.Empty; | ||||
| 				else _Xp["PrintSettings", "ChangeBarText"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		//PROPGRID: Hide User Format | ||||
| 		// ** If we unhide this, logic to reset to parent setting will need to be added | ||||
| 		[Category("Print Settings")] | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("User Format")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("User Format")] | ||||
| @@ -732,9 +1003,7 @@ namespace VEPROMS.CSLA.Library | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		//[Category("Print Settings")] | ||||
| 		[Category("Format Settings")] | ||||
| 		//[DisplayName("User Change Bar Message1")] | ||||
| 		[DisplayName("Custom Change Bar Message Line One")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("User Change Bar Message1")] | ||||
| @@ -742,18 +1011,37 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			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 | ||||
| 			{ | ||||
| 				_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"); | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		//[Category("Print Settings")] | ||||
| 		[Category("Format Settings")] | ||||
| 		//[DisplayName("User Change Bar Message2")] | ||||
| 		[DisplayName("Custom Change Bar Message Line Two")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("User Change Bar Message2")] | ||||
| @@ -761,18 +1049,41 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			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 | ||||
| 			{ | ||||
| 				_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"); | ||||
| 			} | ||||
| 		} | ||||
| 		#endregion | ||||
| 		//[Category("Defaults")] | ||||
| 		//PROPGRID: Hide text background color | ||||
|  | ||||
| 		[Category("Editor Settings")] | ||||
| 		//[DisplayName("Default BackColor")] | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("Step Editor Colors - Non Active Background")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Default Background Color")] | ||||
| @@ -780,7 +1091,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			get | ||||
| 			{ | ||||
| 				//return _Xp["default", "BkColor"]; | ||||
| 				string sColor = _Xp["default", "BkColor"]; | ||||
| 				if (sColor == string.Empty) sColor = "White"; | ||||
| 				if (sColor[0] == '[') | ||||
|   | ||||
| @@ -32,13 +32,18 @@ namespace VEPROMS.CSLA.Library | ||||
| 		} | ||||
| 		#endregion | ||||
| 		#region Constructors | ||||
| 		//PROPGRID: Hide ParentLookup | ||||
| 		[Browsable(false)] | ||||
| 		public bool ParentLookup | ||||
| 		{ | ||||
| 			get { return _Xp.ParentLookup; } | ||||
| 			set { _Xp.ParentLookup = value; } | ||||
| 		} | ||||
| 		[NonSerialized] | ||||
| 		//PROPGRID: Needed to comment out [NonSerialized] in order to hide AncestorLookup from property grid | ||||
| 		//[NonSerialized] | ||||
| 		private bool _AncestorLookup; | ||||
| 		//PROPGRID: Hide AncestorLookup | ||||
| 		[Browsable(false)] | ||||
| 		public bool AncestorLookup | ||||
| 		{ | ||||
| 			get { return _AncestorLookup; } | ||||
| @@ -115,7 +120,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 		} | ||||
| 		#endregion | ||||
| 		#region Local Properties | ||||
| 		//[Category("Identification")] | ||||
| 		[Category("General")] | ||||
| 		[DisplayName("Number")] | ||||
| 		[Description("Number")] | ||||
| @@ -124,7 +128,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get { return (_Procedure != null ? _Procedure.MyContent.Number : _ProcedureInfo.MyContent.Number); } | ||||
| 			set { if (_Procedure != null) _Procedure.MyContent.Number = value; } | ||||
| 		} | ||||
| 		//[Category("Identification")] | ||||
| 		[Category("General")] | ||||
| 		[DisplayName("Title")] | ||||
| 		[Description("Title")] | ||||
| @@ -134,6 +137,8 @@ namespace VEPROMS.CSLA.Library | ||||
| 			set { if (_Procedure != null) _Procedure.MyContent.Text = value; } | ||||
| 		} | ||||
| 		[Category("Identification")] | ||||
| 		//PROPGRID: Hide Old Sequence | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("Old Sequence")] | ||||
| 		[Description("Old Sequence")] | ||||
| 		public string OldSequence | ||||
| @@ -142,13 +147,14 @@ namespace VEPROMS.CSLA.Library | ||||
| 			set { if (_Procedure != null) _Procedure.MyContent.MyZContent.OldStepSequence = value; } | ||||
| 		} | ||||
| 		[Category("Identification")] | ||||
| 		//PROPGRID: Hide Dirty | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("Dirty")] | ||||
| 		[Description("Dirty")] | ||||
| 		public bool Dirty | ||||
| 		{ | ||||
| 			get { return (_Procedure != null ? _Procedure.IsDirty : false); } | ||||
| 		} | ||||
| 		//[Category("Format")] | ||||
| 		[Category("Format Settings")] | ||||
| 		[DisplayName("Format")] | ||||
| 		[Description("Format")] | ||||
| @@ -157,8 +163,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			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 (_ProcedureInfo != null && _ProcedureInfo.MyContent.MyFormat != null) return _ProcedureInfo.MyContent.MyFormat.PlantFormat.FormatData.Name; | ||||
| 				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 | ||||
| 			} | ||||
| 		} | ||||
| 		//[Category("Format")] | ||||
| 		[Category("Format Settings")] | ||||
| 		//[DisplayName("Format")] | ||||
| 		[DisplayName("Default Format")] | ||||
| 		[Description("Format")] | ||||
| 		[Description("Default Format")] | ||||
| 		[TypeConverter(typeof(FormatList))] | ||||
| 		public string DefaultFormatSelection | ||||
| 		{ | ||||
| 			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 (_ProcedureInfo != null && _ProcedureInfo.MyParent != null && _ProcedureInfo.MyParent.ActiveFormat != null) return _ProcedureInfo.MyParent.ActiveFormat.PlantFormat.FormatData.Name; | ||||
| 				return null; | ||||
| @@ -208,9 +208,7 @@ namespace VEPROMS.CSLA.Library | ||||
| 			[Description("Quad Column")] | ||||
| 			FourColumns | ||||
| 		} | ||||
| 		//[Category("Format")] | ||||
| 		[Category("General")] | ||||
| 		//[DisplayName("Column Layout")] | ||||
| 		[DisplayName("Default Column Mode")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Column Layout")] | ||||
| @@ -219,18 +217,37 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				string s = _Xp["format", "columns"]; | ||||
| 				if (s == string.Empty || s.Equals("-1")) return FormatColumns.Default;//(FormatColumns)0; | ||||
| 				return (FormatColumns)int.Parse(_Xp["format", "columns"]); | ||||
| 				//return Enum.Parse(typeof(FormatColumns),_Xp["format", "columns"]); | ||||
|  | ||||
| 				//If there is no value to get, then get the parent value (a.k.a. default value). | ||||
| 				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 | ||||
| 			{ | ||||
| 				if (value == 0) _Xp["format", "columns"] = string.Empty; | ||||
| 				else _Xp["format", "columns"] = ((int)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("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"); | ||||
| 			} | ||||
| 		} | ||||
| 		[Category("Format")] | ||||
| 		//PROPGRID: Hide Plant Format Name (using Format and Default Format) | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("Plant Format Name")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Default Plant Format")] | ||||
| @@ -249,6 +266,8 @@ namespace VEPROMS.CSLA.Library | ||||
| 		#endregion | ||||
| 		#region PrintSettingsCategory       // From curset.dat | ||||
| 		[Category("Print Settings")] | ||||
| 		//PROPGRID: Hide Number of Copies | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("Number of Copies")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Number of Copies")] | ||||
| @@ -280,14 +299,32 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			get | ||||
| 			{ | ||||
|  | ||||
| 				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 | ||||
| 			{ | ||||
| 				if (value == PrintPagination.Auto) _Xp["PrintSettings", "Pagination"] = string.Empty; | ||||
| 				else _Xp["PrintSettings", "Pagination"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
| @@ -307,18 +344,35 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				if (value == PrintWatermark.Draft) _Xp["PrintSettings", "Watermark"] = string.Empty; | ||||
| 				else _Xp["PrintSettings", "Watermark"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
| 		[Category("Print Settings")] | ||||
| 		//[DisplayName("Disable Duplex Printing")] | ||||
| 		[DisplayName("Disable Automatic Duplexing")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Disable Duplex Printing")] | ||||
| @@ -327,12 +381,31 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				_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"); | ||||
| 			} | ||||
| 		} | ||||
| @@ -353,13 +426,6 @@ namespace VEPROMS.CSLA.Library | ||||
| 			[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")] | ||||
| 		[DisplayName("Change Bar")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| @@ -369,14 +435,31 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				//if (value == PrintChangeBar.NoDefault) _Xp["PrintSettings", "ChangeBar"] = string.Empty; | ||||
| 				if (value == PrintChangeBar.SelectBeforePrinting) _Xp["PrintSettings", "ChangeBar"] = string.Empty; | ||||
| 				else _Xp["PrintSettings", "ChangeBar"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
| @@ -397,9 +480,7 @@ namespace VEPROMS.CSLA.Library | ||||
| 			[Description("To the Left of the Text")] | ||||
| 			LeftOfText | ||||
| 		} | ||||
| 		//[Category("Print Settings")] | ||||
| 		[Category("Format Settings")] | ||||
| 		//[DisplayName("Change Bar Location")] | ||||
| 		[DisplayName("Change Bar Position")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("User Specified Change Bar Location")] | ||||
| @@ -408,13 +489,31 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				if (value == PrintChangeBarLoc.WithText) _Xp["PrintSettings", "ChangeBarLoc"] = string.Empty; | ||||
| 				else _Xp["PrintSettings", "ChangeBarLoc"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
| @@ -439,9 +538,7 @@ namespace VEPROMS.CSLA.Library | ||||
| 			[Description("Custom Change Bar Text")] | ||||
| 			UserDef | ||||
| 		} | ||||
| 		//[Category("Print Settings")] | ||||
| 		[Category("Format Settings")] | ||||
| 		//[DisplayName("Change Bar Text")] | ||||
| 		[DisplayName("Change Bar Text Type")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("Change Bar Text")] | ||||
| @@ -450,18 +547,38 @@ namespace VEPROMS.CSLA.Library | ||||
| 			get | ||||
| 			{ | ||||
| 				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 | ||||
| 			{ | ||||
| 				if (value == PrintChangeBarText.DateChgID) _Xp["PrintSettings", "ChangeBarText"] = string.Empty; | ||||
| 				else _Xp["PrintSettings", "ChangeBarText"] = ((int)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", "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"); | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		[Category("Print Settings")] | ||||
| 		//PROPGRID: Hide User Format | ||||
| 		[Browsable(false)] | ||||
| 		[DisplayName("User Format")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("User Format")] | ||||
| @@ -478,9 +595,7 @@ namespace VEPROMS.CSLA.Library | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		//[Category("Print Settings")] | ||||
| 		[Category("Format Settings")] | ||||
| 		//[DisplayName("User Change Bar Message1")] | ||||
| 		[DisplayName("Custom Change Bar Message Line One")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("User Change Bar Message1")] | ||||
| @@ -488,18 +603,37 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			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 | ||||
| 			{ | ||||
| 				_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"); | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		//[Category("Print Settings")] | ||||
| 		[Category("Format Settings")] | ||||
| 		//[DisplayName("User Change Bar Message2")] | ||||
| 		[DisplayName("Custom Change Bar Message Line Two")] | ||||
| 		[RefreshProperties(RefreshProperties.All)] | ||||
| 		[Description("User Change Bar Message2")] | ||||
| @@ -507,11 +641,32 @@ namespace VEPROMS.CSLA.Library | ||||
| 		{ | ||||
| 			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 | ||||
| 			{ | ||||
| 				_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"); | ||||
| 			} | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jsj
					Jsj