diff --git a/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml b/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml
index 9e6888d4..d9c175dd 100644
--- a/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml
+++ b/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml
@@ -129,11 +129,11 @@
-
-
-
+
+
+
-
+
diff --git a/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml.cs b/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml.cs
index e2f8a3b5..f8aef93b 100644
--- a/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml.cs
+++ b/src/TcoInspectors/src/Wpf/TcOpen.Inxton.TcoInspectors.Wpf/Abstractions/InspectorDialogue/TcoInspectorDialogDialogView.xaml.cs
@@ -55,13 +55,22 @@ public void Dispose()
this.DataContextChanged -= TcoInspectorDialogView_DataContextChanged;
if (context != null)
{
- PermissionBox.RemovePermissionBox(this.PermissionBoxOverrideCommand);
+ try
+ {
+ PermissionBox.RemovePermissionBox(this.PermissionBoxOverrideCommand);
+ PermissionBox.RemovePermissionBox(this.PermissionBoxTerminateCommand);
+ }
+ catch (Exception ex)
+ {
+ }
context.CloseRequestEventHandler -= (s, ev) => this.Close();
}
}
private void HostWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
+ Dispose();
+
if (webView != null)
{
webView.Dispose();
diff --git a/src/TcoInspectors/tests/Sandbox.TcoInspectors.Wpf/App.xaml.cs b/src/TcoInspectors/tests/Sandbox.TcoInspectors.Wpf/App.xaml.cs
index ffc5829d..b5498573 100644
--- a/src/TcoInspectors/tests/Sandbox.TcoInspectors.Wpf/App.xaml.cs
+++ b/src/TcoInspectors/tests/Sandbox.TcoInspectors.Wpf/App.xaml.cs
@@ -46,7 +46,7 @@ public App()
roleGroupManager.CreateGroup("OperatorGroup");
roleGroupManager.AddRoleToGroup("OperatorGroup", "Operator");
- //roleGroupManager.AddRoleToGroup("OperatorGroup", "can_terminate_inspection");
+ roleGroupManager.AddRoleToGroup("OperatorGroup", "can_terminate_inspection");
roleGroupManager.AddRoleToGroup("OperatorGroup", "can_override_inspection");
SecurityManager.Create(userDataRepo, roleGroupManager);
@@ -54,14 +54,15 @@ public App()
var userName = "Operator";
var password = "OperatorPassword";
- userDataRepo.Create(userName, new UserData(userName, string.Empty, password, new string[] { "OperatorGroup" }, "Operator", string.Empty) { CanUserChangePassword = true });
+
+ userDataRepo.Create(userName, new UserData(userName, string.Empty, password, new string[] { "OperatorGroup" }, "Operator", string.Empty) { CanUserChangePassword = true });
LazyRenderer.Get.CreateSecureContainer = (permissions) => new PermissionBox { Permissions = permissions, SecurityMode = SecurityModeEnum.Disabled };
SecurityManager.Manager.Service.AuthenticateUser(userName, password);
- SecurityManager.Manager.Service.DeAuthenticateCurrentUser();
+ //SecurityManager.Manager.Service.DeAuthenticateCurrentUser();
}
private static string AMS_ID = Environment.GetEnvironmentVariable("Tc3Target");