aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs52
1 files changed, 52 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs
index 02e41e087..5e4bd7c30 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs
@@ -14,22 +14,43 @@ using Tango.SharedUI.Helpers;
namespace Tango.PPC.UI.Notifications
{
+ /// <summary>
+ /// Represents the default PPC notification provider.
+ /// </summary>
+ /// <seealso cref="Tango.Core.ExtendedObject" />
+ /// <seealso cref="Tango.PPC.Common.Notifications.INotificationProvider" />
public class DefaultNotificationProvider : ExtendedObject, INotificationProvider
{
+ /// <summary>
+ /// Represents a pending message box.
+ /// </summary>
private class PendingMessageBox
{
+ /// <summary>
+ /// Gets or sets the message view model.
+ /// </summary>
public MessageBoxVM VM { get; set; }
+
+ /// <summary>
+ /// Gets or sets the message task completion source.
+ /// </summary>
public TaskCompletionSource<bool> CompletionSource { get; set; }
}
private ConcurrentQueue<PendingMessageBox> _pendingMessageBoxes;
+ /// <summary>
+ /// Initializes a new instance of the <see cref="DefaultNotificationProvider"/> class.
+ /// </summary>
public DefaultNotificationProvider()
{
_pendingMessageBoxes = new ConcurrentQueue<PendingMessageBox>();
}
private MessageBoxVM _currentMessageBox;
+ /// <summary>
+ /// Gets the current message box if any.
+ /// </summary>
public MessageBoxVM CurrentMessageBox
{
get { return _currentMessageBox; }
@@ -41,6 +62,9 @@ namespace Tango.PPC.UI.Notifications
}
}
+ /// <summary>
+ /// Gets a value indicating whether a message box is available.
+ /// </summary>
public bool HasMessageBox
{
get
@@ -49,6 +73,11 @@ namespace Tango.PPC.UI.Notifications
}
}
+ /// <summary>
+ /// Shows an error message box.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ /// <returns></returns>
public Task ShowError(string message)
{
return ShowMessageBox(new MessageBoxVM()
@@ -60,6 +89,11 @@ namespace Tango.PPC.UI.Notifications
});
}
+ /// <summary>
+ /// Shows an information message box.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ /// <returns></returns>
public Task ShowInfo(string message)
{
return ShowMessageBox(new MessageBoxVM()
@@ -71,6 +105,11 @@ namespace Tango.PPC.UI.Notifications
});
}
+ /// <summary>
+ /// Shows warning message box.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ /// <returns></returns>
public Task ShowWarning(string message)
{
return ShowMessageBox(new MessageBoxVM()
@@ -82,6 +121,11 @@ namespace Tango.PPC.UI.Notifications
});
}
+ /// <summary>
+ /// Shows a question message box.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ /// <returns></returns>
public Task<bool> ShowQuestion(string message)
{
return ShowMessageBox(new MessageBoxVM()
@@ -94,6 +138,11 @@ namespace Tango.PPC.UI.Notifications
});
}
+ /// <summary>
+ /// Shows the message box.
+ /// </summary>
+ /// <param name="vm">The view model.</param>
+ /// <returns></returns>
private Task<bool> ShowMessageBox(MessageBoxVM vm)
{
TaskCompletionSource<bool> source = new TaskCompletionSource<bool>();
@@ -117,6 +166,9 @@ namespace Tango.PPC.UI.Notifications
return source.Task;
}
+ /// <summary>
+ /// Called when the message box has been closed.
+ /// </summary>
private void OnMessageBoxClosed()
{
CurrentMessageBox = null;