aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-01-14 15:24:49 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-01-14 15:24:49 +0200
commita20fd4bd769aeccd1fd1f20273f895c92a5b5bb8 (patch)
tree15f2dc0d4629dfd17b2e44ca3732d549fed27751 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications
parent04db84896f75bb761e8b3d482b4cb0f82c08d96e (diff)
downloadTango-a20fd4bd769aeccd1fd1f20273f895c92a5b5bb8.tar.gz
Tango-a20fd4bd769aeccd1fd1f20273f895c92a5b5bb8.zip
Added code comments for:
MachineStudio.Common.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs23
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs71
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/TaskItem.cs21
3 files changed, 112 insertions, 3 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs
index e5e4cac78..5fcd63071 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs
@@ -8,11 +8,18 @@ using Tango.SharedUI;
namespace Tango.MachineStudio.Common.Notifications
{
+ /// <summary>
+ /// Represents a dialog view model base class.
+ /// </summary>
+ /// <seealso cref="Tango.SharedUI.ViewModel" />
public abstract class DialogViewVM : ViewModel
{
public event Action Accepted;
public event Action Canceled;
+ /// <summary>
+ /// Initializes a new instance of the <see cref="DialogViewVM"/> class.
+ /// </summary>
public DialogViewVM()
{
CanClose = true;
@@ -20,25 +27,39 @@ namespace Tango.MachineStudio.Common.Notifications
}
private bool _canClose;
-
+ /// <summary>
+ /// Gets or sets a value indicating whether this dialog can be closed.
+ /// </summary>
public bool CanClose
{
get { return _canClose; }
set { _canClose = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
}
+ /// <summary>
+ /// Gets or sets the close command.
+ /// </summary>
public RelayCommand CloseCommand { get; set; }
+ /// <summary>
+ /// Called when the dialog has been shown.
+ /// </summary>
public virtual void OnShow()
{
}
+ /// <summary>
+ /// Invokes the <see cref="Accepted"/> event.
+ /// </summary>
protected virtual void Accept()
{
Accepted?.Invoke();
}
+ /// <summary>
+ /// Invokes the <see cref="Canceled"/> event.
+ /// </summary>
protected virtual void Cancel()
{
Canceled?.Invoke();
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs
index 937a39ec2..30e5626a1 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs
@@ -10,34 +10,101 @@ using System.Windows.Media;
namespace Tango.MachineStudio.Common.Notifications
{
+ /// <summary>
+ /// Represents the Machine Studio user notification provider responsible for displaying information, alerts and dialogs to the user.
+ /// </summary>
public interface INotificationProvider
{
+ /// <summary>
+ /// Gets the collection of active task items.
+ /// </summary>
ObservableCollection<TaskItem> TaskItems { get; }
+ /// <summary>
+ /// Gets the current displayed task item.
+ /// </summary>
TaskItem CurrentTaskItem { get; }
+ /// <summary>
+ /// Gets a value indicating whether there are any queued task items.
+ /// </summary>
bool HasTaskItems { get; }
+ /// <summary>
+ /// Pushes the specified task item to the queue.
+ /// </summary>
+ /// <param name="taskItem">The task item.</param>
void PushTaskItem(TaskItem taskItem);
+ /// <summary>
+ /// Create and push a new task item from the specified message.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ /// <returns></returns>
TaskItem PushTaskItem(String message);
+ /// <summary>
+ /// Removed the specified task item from the queue.
+ /// </summary>
+ /// <param name="taskItem">The task item.</param>
void PopTaskItem(TaskItem taskItem);
+ /// <summary>
+ /// Creates a new instance of the specified View type and displays it as a modal dialog.
+ /// </summary>
+ /// <typeparam name="View">The type of the view.</typeparam>
+ /// <typeparam name="VM">The type of the view model.</typeparam>
+ /// <param name="onAccept">Accept button callback.</param>
+ /// <param name="onCancel">Cancel button callback.</param>
void ShowModalDialog<View, VM>(Action<VM> onAccept, Action onCancel) where View : FrameworkElement where VM : DialogViewVM;
+ /// <summary>
+ /// Creates a new view by a naming convention of the specified view model type.
+ /// </summary>
+ /// <typeparam name="VM">The type of the view model.</typeparam>
+ /// <param name="onAccept">Accept button callback.</param>
+ /// <param name="onCancel">Cancel button callback.</param>
void ShowModalDialog<VM>(Action<VM> onAccept, Action onCancel) where VM : DialogViewVM;
+ /// <summary>
+ /// Creates a new view by a naming convention of the specified view model type.
+ /// </summary>
+ /// <typeparam name="VM">The type of the view model.</typeparam>
+ /// <param name="onAccept">Accept button callback.</param>
void ShowModalDialog<VM>(Action<VM> onAccept) where VM : DialogViewVM;
- bool? ShowDialog(PackIconKind icon, Brush iconColor, String message, bool hasCancel);
+ /// <summary>
+ /// Display a message box.
+ /// </summary>
+ /// <param name="icon">The icon.</param>
+ /// <param name="iconColor">Color of the icon.</param>
+ /// <param name="message">The message.</param>
+ /// <param name="hasCancel">if set to <c>true</c> displays the cancel button.</param>
+ /// <returns></returns>
+ bool? ShowMessageBox(PackIconKind icon, Brush iconColor, String message, bool hasCancel);
+ /// <summary>
+ /// Shows an information message box.
+ /// </summary>
+ /// <param name="message">The message.</param>
void ShowInfo(String message);
- void ShowWarnning(String message);
+ /// <summary>
+ /// Shows warning message box.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ void ShowWarning(String message);
+ /// <summary>
+ /// Shows an error message box.
+ /// </summary>
+ /// <param name="message">The message.</param>
void ShowError(String message);
+ /// <summary>
+ /// Shows a question message box.
+ /// </summary>
+ /// <param name="message">The message.</param>
bool ShowQuestion(String message);
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/TaskItem.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/TaskItem.cs
index 0cf5e2c8e..110fbfa74 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/TaskItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/TaskItem.cs
@@ -7,32 +7,53 @@ using Tango.Core;
namespace Tango.MachineStudio.Common.Notifications
{
+ /// <summary>
+ /// Represents a Machine Studio "work-bar" item.
+ /// </summary>
+ /// <seealso cref="Tango.Core.ExtendedObject" />
+ /// <seealso cref="System.IDisposable" />
public class TaskItem : ExtendedObject, IDisposable
{
private INotificationProvider _notificationProvider;
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TaskItem"/> class.
+ /// </summary>
+ /// <param name="notificationProvider">The notification provider.</param>
public TaskItem(INotificationProvider notificationProvider)
{
_notificationProvider = notificationProvider;
}
private String _message;
+ /// <summary>
+ /// Gets or sets the message.
+ /// </summary>
public String Message
{
get { return _message; }
set { _message = value; RaisePropertyChangedAuto(); }
}
+ /// <summary>
+ /// Removed this item from the queue.
+ /// </summary>
public void Pop()
{
_notificationProvider.PopTaskItem(this);
}
+ /// <summary>
+ /// Pushes this item to the queue.
+ /// </summary>
public void Push()
{
_notificationProvider.PushTaskItem(this);
}
+ /// <summary>
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// </summary>
public void Dispose()
{
Pop();