Handle tabs defined in format as {LNK Step Num} for deviation documents

If can’t find an edit window, for example from search results that list ‘hidden’ data, give message –not crash
This commit is contained in:
Kathy Ruffing 2013-12-18 16:42:52 +00:00
parent f63b2a5347
commit 65dd986027
2 changed files with 8 additions and 1 deletions

View File

@ -2484,7 +2484,9 @@ namespace VEPROMS.CSLA.Library
tbformat = FormatStepData.TabData.IdentEdit; tbformat = FormatStepData.TabData.IdentEdit;
if (ActiveFormat.Name.ToUpper() == "WCNCKL" && FormatStepData.StepLayoutData.AlignWithParentTab) tbformat = tbformat.TrimStart(" ".ToCharArray()); if (ActiveFormat.Name.ToUpper() == "WCNCKL" && FormatStepData.StepLayoutData.AlignWithParentTab) tbformat = tbformat.TrimStart(" ".ToCharArray());
} }
if ((ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) if (((ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) ||
((ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations))
{ {
if (tbformat.Contains("{LNK C/N Num}")) if (tbformat.Contains("{LNK C/N Num}"))
{ {

View File

@ -57,6 +57,11 @@ namespace Volian.Controls.Library
set set
{ {
_MyStepPanel.SelectedEditItem = _MyStepPanel.GetEditItem(value); _MyStepPanel.SelectedEditItem = _MyStepPanel.GetEditItem(value);
if (_MyStepPanel.SelectedEditItem == null)
{
MessageBox.Show("The selected item is not available in the editor. One possible cause is that the data is 'not editable', check the section properties 'Editable Data' checkbox.", "Inaccessible Data", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (_MyStepPanel.SelectedEditItem != null) if (_MyStepPanel.SelectedEditItem != null)
_MyStepPanel.SelectedEditItem.ItemSelect(); _MyStepPanel.SelectedEditItem.ItemSelect();
if (!_MyStepPanel.ItemSelectionChangeShown) _MyStepPanel.OnItemSelectedChanged(this, new ItemSelectedChangedEventArgs(_MyStepPanel.SelectedEditItem)); if (!_MyStepPanel.ItemSelectionChangeShown) _MyStepPanel.OnItemSelectedChanged(this, new ItemSelectedChangedEventArgs(_MyStepPanel.SelectedEditItem));