Added ErrorLog Message if a disconnected item is processed
Added logic to keep disconnected items from being displayed in the search results If the user selects a disconnected item the code will display a message rather than crashing.
This commit is contained in:
@@ -122,7 +122,8 @@ namespace Volian.Controls.Library
|
||||
btnOpenLibDoc.Enabled = false;
|
||||
foreach (ItemInfo ii in dicnt.LibraryDocumentUsageList)
|
||||
{
|
||||
listBoxUsages.Items.Add(ii.MyProcedure.ToString() + " - " + ii.MyContent.Number + " " + ii.MyContent.Text);
|
||||
if(ii.MyDocVersion!=null)
|
||||
listBoxUsages.Items.Add(ii.MyProcedure.ToString() + " - " + ii.MyContent.Number + " " + ii.MyContent.Text);
|
||||
}
|
||||
btnPrint.Enabled = listBoxUsages.Items.Count > 0 ? true : false;
|
||||
}
|
||||
@@ -284,8 +285,14 @@ namespace Volian.Controls.Library
|
||||
MessageBox.Show("No Content in this document");
|
||||
return;
|
||||
}
|
||||
if (listBoxUsages.SelectedIndex < di.LibraryDocumentUsageList.Count && listBoxUsages.SelectedIndex >= 0)
|
||||
_DisplayTabControl.OpenItem(di.LibraryDocumentUsageList[listBoxUsages.SelectedIndex]);
|
||||
if (listBoxUsages.SelectedIndex < di.LibraryDocumentUsageList.Count && listBoxUsages.SelectedIndex >= 0)
|
||||
{
|
||||
ItemInfo ii = di.LibraryDocumentUsageList[listBoxUsages.SelectedIndex];
|
||||
if (ii.MyDocVersion == null)
|
||||
MessageBox.Show("This usage is not connected properly", "Disconnected Data", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
else
|
||||
_DisplayTabControl.OpenItem(ii);
|
||||
}
|
||||
_ProcessingSelectedValueChanged = false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user