Skip to content

Commit

Permalink
Disposed of AppComThread before closing WPF
Browse files Browse the repository at this point in the history
  • Loading branch information
rexcardan committed Mar 25, 2019
1 parent ede2797 commit 5ca49df
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
7 changes: 7 additions & 0 deletions ESAPIX.StarterWPF/ESAPIX136/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using ESAPIX.Common;

namespace $safeprojectname$
{
Expand All @@ -26,5 +27,11 @@ protected override void OnStartup(StartupEventArgs e)
//bs.IsPatientSelectionEnabled = false;
bs.Run(args);
}

protected override void OnExit(ExitEventArgs e)
{
AppComThread.Instance.Dispose();
base.OnExit(e);
}
}
}
16 changes: 8 additions & 8 deletions ESAPIX/Constraints/PQAsserter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ public PQAsserter ContainsNonEmptyStructuresById(params string[] structureIds)
var structures = _pi.GetStructures();
if (structures == null)
{
Results.Add(new ConstraintResult(null, NOT_APPLICABLE, "No structure set", string.Empty));
Results.Add(new ConstraintResult(null, NOT_APPLICABLE_MISSING_STRUCTURE, "No structure set", string.Empty));
return this;
}
foreach (var id in structureIds)
if (!_pi.ContainsStructure(id))
{
Results.Add(new ConstraintResult(null, NOT_APPLICABLE, $"Missing {id}, or {id} is empty",
Results.Add(new ConstraintResult(null, NOT_APPLICABLE_MISSING_STRUCTURE, $"Missing {id}, or {id} is empty",
string.Empty));
return this;
}
Expand All @@ -226,7 +226,7 @@ public PQAsserter ContainsOneOrMoreNonEmptyStructureById(params string[] structu
var structures = _pi.GetStructures();
if (structures == null)
{
Results.Add(new ConstraintResult(null, NOT_APPLICABLE, "No structure set", string.Empty));
Results.Add(new ConstraintResult(null, NOT_APPLICABLE_MISSING_STRUCTURE, "No structure set", string.Empty));
return this;
}
foreach (var id in structureIds)
Expand All @@ -238,7 +238,7 @@ public PQAsserter ContainsOneOrMoreNonEmptyStructureById(params string[] structu
}
}

Results.Add(new ConstraintResult(null, NOT_APPLICABLE, $"Does not contain one: {string.Join(",", structureIds)}, or all are empty",
Results.Add(new ConstraintResult(null, NOT_APPLICABLE_MISSING_STRUCTURE, $"Does not contain one: {string.Join(",", structureIds)}, or all are empty",
string.Empty));
return this;
}
Expand All @@ -253,14 +253,14 @@ public PQAsserter ContainsNonEmptyStructuresByDICOMType(params string[] dicomTyp
var structures = _pi.GetStructures();
if (structures == null)
{
Results.Add(new ConstraintResult(null, NOT_APPLICABLE, "No structure set", string.Empty));
Results.Add(new ConstraintResult(null, NOT_APPLICABLE_MISSING_STRUCTURE, "No structure set", string.Empty));
return this;
}
foreach (var dt in dicomTypes)
{
if (!structures.Any(s => s.DicomType == dt && !s.IsEmpty))
{
Results.Add(new ConstraintResult(null, NOT_APPLICABLE,
Results.Add(new ConstraintResult(null, NOT_APPLICABLE_MISSING_STRUCTURE,
$"Missing type {dt}, or {dt} structure is empty", string.Empty));
return this;
}
Expand All @@ -280,7 +280,7 @@ public PQAsserter ContainsOneOrMoreNonEmptyStructuresByDICOMType(params string[]
var structures = _pi.GetStructures();
if (structures == null)
{
Results.Add(new ConstraintResult(null, NOT_APPLICABLE, "No structure set", string.Empty));
Results.Add(new ConstraintResult(null, NOT_APPLICABLE_MISSING_STRUCTURE, "No structure set", string.Empty));
return this;
}
foreach (var dt in dicomTypes)
Expand All @@ -292,7 +292,7 @@ public PQAsserter ContainsOneOrMoreNonEmptyStructuresByDICOMType(params string[]
}
}

Results.Add(new ConstraintResult(null, NOT_APPLICABLE,
Results.Add(new ConstraintResult(null, NOT_APPLICABLE_MISSING_STRUCTURE,
$"Does not contain one: {string.Join(",", dicomTypes)}, or all are empty", string.Empty));
return this;
}
Expand Down

0 comments on commit 5ca49df

Please sign in to comment.