aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs21
1 files changed, 17 insertions, 4 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs
index 1c9b8732f..cb36d8d29 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs
@@ -112,14 +112,16 @@ namespace Tango.MachineStudio.UI.Notifications
dialog.DataContext = context;
Action onAcceptAction = null;
+ Action onCancelAction = null;
+
onAcceptAction = new Action(() =>
{
dialog.Close();
onAccept(context);
context.Accepted -= onAcceptAction;
+ context.Canceled -= onCancelAction;
});
- Action onCancelAction = null;
onCancelAction = new Action(() =>
{
dialog.Close();
@@ -129,6 +131,7 @@ namespace Tango.MachineStudio.UI.Notifications
onCancel();
}
+ context.Accepted -= onAcceptAction;
context.Canceled -= onCancelAction;
});
@@ -163,14 +166,16 @@ namespace Tango.MachineStudio.UI.Notifications
dialog.DataContext = context;
Action onAcceptAction = null;
+ Action onCancelAction = null;
+
onAcceptAction = new Action(() =>
{
dialog.Close();
onAccept(context);
context.Accepted -= onAcceptAction;
+ context.Canceled -= onCancelAction;
});
- Action onCancelAction = null;
onCancelAction = new Action(() =>
{
dialog.Close();
@@ -180,6 +185,7 @@ namespace Tango.MachineStudio.UI.Notifications
onCancel();
}
+ context.Accepted -= onAcceptAction;
context.Canceled -= onCancelAction;
});
@@ -213,14 +219,16 @@ namespace Tango.MachineStudio.UI.Notifications
dialog.DataContext = context;
Action onAcceptAction = null;
+ Action onCancelAction = null;
+
onAcceptAction = new Action(() =>
{
dialog.Close();
onAccept(context);
context.Accepted -= onAcceptAction;
+ context.Canceled -= onCancelAction;
});
- Action onCancelAction = null;
onCancelAction = new Action(() =>
{
dialog.Close();
@@ -231,6 +239,7 @@ namespace Tango.MachineStudio.UI.Notifications
}
context.Canceled -= onCancelAction;
+ context.Accepted -= onAcceptAction;
});
context.Accepted += onAcceptAction;
@@ -279,15 +288,18 @@ namespace Tango.MachineStudio.UI.Notifications
}
dialog.DataContext = context;
+ Action onCancelAction = null;
Action onAcceptAction = null;
+
onAcceptAction = new Action(() =>
{
dialog.Close();
onAccept(context);
+
+ context.Canceled -= onCancelAction;
context.Accepted -= onAcceptAction;
});
- Action onCancelAction = null;
onCancelAction = new Action(() =>
{
dialog.Close();
@@ -298,6 +310,7 @@ namespace Tango.MachineStudio.UI.Notifications
}
context.Canceled -= onCancelAction;
+ context.Accepted -= onAcceptAction;
});
context.Accepted += onAcceptAction;