Added a null reference check for selectedDVI on the tc_PanelTabDisplay() function.

Added logic to skip the checks for changed integrated graphics (figures) when the RO database has none.
This commit is contained in:
John Jenko 2016-08-03 18:52:14 +00:00
parent 56ab02c3f7
commit ac47021609
2 changed files with 15 additions and 9 deletions

View File

@ -2889,6 +2889,7 @@ namespace VEPROMS
} }
private void tc_PanelTabDisplay(object sender, StepPanelTabDisplayEventArgs args) private void tc_PanelTabDisplay(object sender, StepPanelTabDisplayEventArgs args)
{ {
if (_SelectedDVI == null) return;
if (args.PanelTabName == "Bookmarks") if (args.PanelTabName == "Bookmarks")
{ {
toolsPanel.Expanded = true; toolsPanel.Expanded = true;

View File

@ -391,16 +391,19 @@ namespace VEPROMS.CSLA.Library
/// <param name="roids">List of ROIDs with changed figures</param> /// <param name="roids">List of ROIDs with changed figures</param>
private static void FindChangedFiles(ROFSTLookup.rochild[] rochild,List<string> ChangedFiles, List<string> roids) private static void FindChangedFiles(ROFSTLookup.rochild[] rochild,List<string> ChangedFiles, List<string> roids)
{ {
for (int i = 0; i < rochild.Length; i++) if (ChangedFiles != null)
{ {
if (rochild[i].type == 8 && rochild[i].value != null) for (int i = 0; i < rochild.Length; i++)
{ {
string filename = rochild[i].value; if (rochild[i].type == 8 && rochild[i].value != null)
filename = filename.Substring(0, filename.IndexOf('\n')); {
if(ChangedFiles.Contains(filename)) string filename = rochild[i].value;
roids.Add(rochild[i].roid); filename = filename.Substring(0, filename.IndexOf('\n'));
if (ChangedFiles.Contains(filename))
roids.Add(rochild[i].roid);
}
if (rochild[i].children != null) FindChangedFiles(rochild[i].children, ChangedFiles, roids);
} }
if (rochild[i].children != null) FindChangedFiles(rochild[i].children,ChangedFiles, roids);
} }
} }
/// <summary> /// <summary>
@ -411,6 +414,7 @@ namespace VEPROMS.CSLA.Library
/// <returns>List of Files which have changed (DTS)</returns> /// <returns>List of Files which have changed (DTS)</returns>
private static List<string> GetChangedFigures(ROFstInfo origROFst, ROFstInfo rofst) private static List<string> GetChangedFigures(ROFstInfo origROFst, ROFstInfo rofst)
{ {
if (origROFst.ROFstFigures == null) return null;
Dictionary<string,int> orig = new Dictionary<string,int>(); Dictionary<string,int> orig = new Dictionary<string,int>();
foreach (FigureInfo fi in origROFst.ROFstFigures) foreach (FigureInfo fi in origROFst.ROFstFigures)
{ {
@ -463,6 +467,7 @@ namespace VEPROMS.CSLA.Library
List<string> delList = new List<string>(); List<string> delList = new List<string>();
List<string> chgList = newLU.GetValueDifferences(origLU, ref delList); List<string> chgList = newLU.GetValueDifferences(origLU, ref delList);
// Any figures which have been changed will be included in the list of values that have changed. // Any figures which have been changed will be included in the list of values that have changed.
if (MyChangedFigureROIDs != null)
foreach (string roid in MyChangedFigureROIDs) foreach (string roid in MyChangedFigureROIDs)
if (!chgList.Contains(roid)) if (!chgList.Contains(roid))
chgList.Add(roid); chgList.Add(roid);
@ -522,7 +527,7 @@ namespace VEPROMS.CSLA.Library
foreach (string chg in chgList) foreach (string chg in chgList)
{ {
string padroid = chg.Length <= 12 ? chg + "0000" : chg; string padroid = chg.Length <= 12 ? chg + "0000" : chg;
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Updating DRO Values"); if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Updating RO Values");
if (activeDRoids.Contains(chg.Substring(0, 12))) if (activeDRoids.Contains(chg.Substring(0, 12)))
{ {
ROFSTLookup.rochild roch = newLU.GetRoChild(chg); ROFSTLookup.rochild roch = newLU.GetRoChild(chg);
@ -587,7 +592,7 @@ namespace VEPROMS.CSLA.Library
{ {
foreach (DROUsageInfo droUsg in Daffected) foreach (DROUsageInfo droUsg in Daffected)
{ {
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old DRO Values"); if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old RO Values");
Pdf.DeleteAll(droUsg.DocID); Pdf.DeleteAll(droUsg.DocID);
} }
} }