Fixed null reference

Fixed null reference and logic to support Placekeeper check box
This commit is contained in:
John Jenko 2014-05-08 14:30:38 +00:00
parent 387dcd5dac
commit 1664a62e4d
2 changed files with 4 additions and 4 deletions

View File

@ -683,7 +683,7 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
SectionConfig scfg = (SectionConfig)MyActiveSection.MyConfig; SectionConfig scfg = (SectionConfig)ActiveSection.MyConfig;
if (MyDocStyle.StructureStyle.Style == null || scfg == null) return false; if (MyDocStyle.StructureStyle.Style == null || scfg == null) return false;
bool PlacekeepOption = ((ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.AutoPlacekeeper) == E_PurchaseOptions.AutoPlacekeeper) bool PlacekeepOption = ((ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.AutoPlacekeeper) == E_PurchaseOptions.AutoPlacekeeper)
&& scfg.Section_Placekeeper.Equals("Y"); && scfg.Section_Placekeeper.Equals("Y");

View File

@ -147,7 +147,7 @@ namespace Volian.Controls.Library
cbPageBreak.Checked = false; // will be set below if HLS & config has it on cbPageBreak.Checked = false; // will be set below if HLS & config has it on
cbPlaceKeeper.Checked = false; // will be set below if HLS & config has this set cbPlaceKeeper.Checked = false; // will be set below if HLS & config has this set
cbPageBreak.Enabled = CurItemInfo.IsHigh; cbPageBreak.Enabled = CurItemInfo.IsHigh;
cbPlaceKeeper.Enabled = ((SectionConfig)CurItemInfo.MyActiveSection.MyConfig).Section_Placekeeper == "Y"; cbPlaceKeeper.Enabled = ((SectionConfig)CurItemInfo.ActiveSection.MyConfig).Section_Placekeeper == "Y";
cbCAS.Enabled = true; cbCAS.Enabled = true;
rbChgBarOff.Enabled = true; rbChgBarOff.Enabled = true;
rbChgBarOn.Enabled = true; rbChgBarOn.Enabled = true;
@ -180,7 +180,7 @@ namespace Volian.Controls.Library
{ {
if (CurItemInfo.IsHigh) if (CurItemInfo.IsHigh)
cbPageBreak.Checked = sc.Step_NewManualPagebreak; cbPageBreak.Checked = sc.Step_NewManualPagebreak;
cbPlaceKeeper.Checked = sc.Step_Placekeeper; cbPlaceKeeper.Checked = sc.Step_Placekeeper.ToUpper() != "N";
cbCAS.Checked = sc.Step_CAS; cbCAS.Checked = sc.Step_CAS;
} }
bool _checkoffsAllowed = true; bool _checkoffsAllowed = true;
@ -337,7 +337,7 @@ namespace Volian.Controls.Library
MyEditItem.SaveContents(); MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig; StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return; if (sc == null) return;
sc.Step_Placekeeper = cbPlaceKeeper.Checked; sc.Step_Placekeeper = (cbPlaceKeeper.Checked)?"Y":"N";
} }
private void listBoxStepTypes_SelectedIndexChanged(object sender, EventArgs e) private void listBoxStepTypes_SelectedIndexChanged(object sender, EventArgs e)
{ {