diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-14 15:24:49 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-14 15:24:49 +0200 |
| commit | a20fd4bd769aeccd1fd1f20273f895c92a5b5bb8 (patch) | |
| tree | 15f2dc0d4629dfd17b2e44ca3732d549fed27751 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common | |
| parent | 04db84896f75bb761e8b3d482b4cb0f82c08d96e (diff) | |
| download | Tango-a20fd4bd769aeccd1fd1f20273f895c92a5b5bb8.tar.gz Tango-a20fd4bd769aeccd1fd1f20273f895c92a5b5bb8.zip | |
Added code comments for:
MachineStudio.Common.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common')
18 files changed, 262 insertions, 20 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Authentication/IAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Authentication/IAuthenticationProvider.cs index 488a2f6dc..e2d4072ba 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Authentication/IAuthenticationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Authentication/IAuthenticationProvider.cs @@ -7,14 +7,32 @@ using Tango.DAL.Observables; namespace Tango.MachineStudio.Common.Authentication { + /// <summary> + /// Represents the Machine Studio user authentication provider responsible for the current logged-in user. + /// </summary> public interface IAuthenticationProvider { + /// <summary> + /// Occurs when the current logged-in user has changed. + /// </summary> event EventHandler<User> CurrentUserChanged; + /// <summary> + /// Gets the current logged-in user. + /// </summary> User CurrentUser { get; } + /// <summary> + /// Performs a user login by the specified email and password. + /// </summary> + /// <param name="email">The email.</param> + /// <param name="password">The password.</param> + /// <returns></returns> User Login(String email, String password); + /// <summary> + /// Logs-out the current logged-in user. + /// </summary> void Logout(); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiChild.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiChild.cs index 469e3fda5..109b00531 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiChild.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiChild.cs @@ -10,19 +10,34 @@ using Tango.Core.Commands; namespace Tango.MachineStudio.Common.Controls { + /// <summary> + /// Represents an <see cref="MdiContainerControl"/> child control. + /// </summary> + /// <seealso cref="System.Windows.DependencyObject" /> public class MdiChild : DependencyObject { + /// <summary> + /// Initializes a new instance of the <see cref="MdiChild"/> class. + /// </summary> public MdiChild() { } + /// <summary> + /// Initializes a new instance of the <see cref="MdiChild"/> class. + /// </summary> + /// <param name="header">The header.</param> + /// <param name="view">The view.</param> public MdiChild(String header, FrameworkElement view) : this() { Header = header; View = view; } + /// <summary> + /// Gets or sets the icon. + /// </summary> public PackIconKind Icon { get { return (PackIconKind)GetValue(IconProperty); } @@ -31,6 +46,9 @@ namespace Tango.MachineStudio.Common.Controls public static readonly DependencyProperty IconProperty = DependencyProperty.Register("Icon", typeof(PackIconKind), typeof(MdiChild), new PropertyMetadata(PackIconKind.LaptopWindows)); + /// <summary> + /// Gets or sets the header. + /// </summary> public String Header { get { return (String)GetValue(HeaderProperty); } @@ -39,6 +57,9 @@ namespace Tango.MachineStudio.Common.Controls public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register("Header", typeof(String), typeof(MdiChild), new PropertyMetadata(null)); + /// <summary> + /// Gets or sets the view. + /// </summary> public FrameworkElement View { get { return (FrameworkElement)GetValue(ViewProperty); } @@ -47,6 +68,9 @@ namespace Tango.MachineStudio.Common.Controls public static readonly DependencyProperty ViewProperty = DependencyProperty.Register("View", typeof(FrameworkElement), typeof(MdiChild), new PropertyMetadata(null)); + /// <summary> + /// Gets or sets the location. + /// </summary> public Point Location { get { return (Point)GetValue(LocationProperty); } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiContainerControl.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiContainerControl.xaml.cs index dbf4ee74b..ceeda050b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiContainerControl.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiContainerControl.xaml.cs @@ -20,8 +20,11 @@ using Tango.SharedUI.Helpers; namespace Tango.MachineStudio.Common.Controls { /// <summary> - /// Interaction logic for MdiContainerControl.xaml + /// Represents an MDI-style container /// </summary> + /// <seealso cref="System.Windows.Controls.UserControl" /> + /// <seealso cref="System.Windows.Markup.IComponentConnector" /> + /// <seealso cref="System.Windows.Markup.IStyleConnector" /> public partial class MdiContainerControl : UserControl { private const int MIN_SIZE = 200; @@ -63,7 +66,6 @@ namespace Tango.MachineStudio.Common.Controls return UIHelper.FindChild<Canvas>(itemsControl, "canvas"); } - private void OnControlMouseDown(object sender, MouseButtonEventArgs e) { Canvas.SetZIndex(sender as FrameworkElement, GetCanvas().Children.OfType<FrameworkElement>().Max(x => Canvas.GetZIndex(x) + 1)); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Converters/PointToMarginConverter.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Converters/PointToMarginConverter.cs index e6587b1ee..94748fb26 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Converters/PointToMarginConverter.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Converters/PointToMarginConverter.cs @@ -9,8 +9,13 @@ using System.Windows.Data; namespace Tango.MachineStudio.Common.Converters { + /// <summary> + /// Represents a <see cref="Point"/> to <see cref="Thickness"/> binding converter. + /// </summary> + /// <seealso cref="System.Windows.Data.IValueConverter" /> public class PointToMarginConverter : IValueConverter { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { Point p = (Point)value; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ExtensionMethods/IStudioMessageExtensions.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ExtensionMethods/IStudioMessageExtensions.cs index 83183f328..7ae259e04 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ExtensionMethods/IStudioMessageExtensions.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ExtensionMethods/IStudioMessageExtensions.cs @@ -6,8 +6,15 @@ using System.Text; using System.Threading.Tasks; using Tango.MachineStudio.Common.Messages; +/// <summary> +/// Contains <see cref="IStudioMessage"/> extension methods. +/// </summary> public static class IStudioMessageExtensions { + /// <summary> + /// Sends the message. + /// </summary> + /// <param name="message">The message.</param> public static void Send(this IStudioMessage message) { Messenger.Default.Send(message); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ExtensionMethods/UserExtensions.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ExtensionMethods/UserExtensions.cs deleted file mode 100644 index a6c98319e..000000000 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ExtensionMethods/UserExtensions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.DAL.Observables; - -public static class UserExtensions -{ - public static bool HasPermission(this User user, Permissions permission) - { - return user.UsersRoles.Select(x => x.Role).ToList().SelectMany(x => x.RolesPermissions).ToList().Exists(x => x.Permission.Code == permission.ToInt32()); - } -} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs index 902a45a2f..21377fb5f 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/IStudioModule.cs @@ -9,20 +9,45 @@ using Tango.DAL.Observables; namespace Tango.MachineStudio.Common { + /// <summary> + /// Represents a Machine Studio module. + /// </summary> + /// <seealso cref="System.IDisposable" /> public interface IStudioModule : IDisposable { + /// <summary> + /// Gets the module name. + /// </summary> String Name { get; } + /// <summary> + /// Gets the module description. + /// </summary> String Description { get; } + /// <summary> + /// Gets the module cover image. + /// </summary> BitmapSource Image { get; } + /// <summary> + /// Gets the module entry point view. + /// </summary> FrameworkElement MainView { get; } + /// <summary> + /// Gets the permission required to see and load this module. + /// </summary> Permissions Permission { get; } + /// <summary> + /// Gets a value indicating whether this module has been initialized. + /// </summary> bool IsInitialized { get; } + /// <summary> + /// Perform any operations required to initialize this module. + /// </summary> void Initialize(); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Messages/IStudioMessage.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Messages/IStudioMessage.cs index 7d1232c7b..61056ab16 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Messages/IStudioMessage.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Messages/IStudioMessage.cs @@ -6,6 +6,9 @@ using System.Threading.Tasks; namespace Tango.MachineStudio.Common.Messages { + /// <summary> + /// Represents an MVVM base interface for MVVM Light Messenger messages. + /// </summary> public interface IStudioMessage { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Modules/IStudioModuleLoader.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Modules/IStudioModuleLoader.cs index d67accbc1..cb9f1122f 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Modules/IStudioModuleLoader.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Modules/IStudioModuleLoader.cs @@ -7,12 +7,24 @@ using System.Threading.Tasks; namespace Tango.MachineStudio.Common.Modules { + /// <summary> + /// Represents a Machine Studio <see cref="IStudioModule"/> modules loading engine. + /// </summary> public interface IStudioModuleLoader { + /// <summary> + /// Gets all loaded modules. + /// </summary> ObservableCollection<IStudioModule> AllModules { get; } + /// <summary> + /// Gets all the user permitted modules. + /// </summary> ObservableCollection<IStudioModule> UserModules { get; } + /// <summary> + /// Loads all available Machine Studio modules. + /// </summary> void LoadModules(); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs index 631f9e2eb..4d1cbea8c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/INavigationManager.cs @@ -6,8 +6,15 @@ using System.Threading.Tasks; namespace Tango.MachineStudio.Common.Navigation { + /// <summary> + /// Represents the Machine Studio views navigation manager. + /// </summary> public interface INavigationManager { + /// <summary> + /// Navigates to the specified view. + /// </summary> + /// <param name="view">The view.</param> void NavigateTo(NavigationView view); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/NavigationView.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/NavigationView.cs index 77dbaf5b4..db0f0471f 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/NavigationView.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Navigation/NavigationView.cs @@ -6,6 +6,9 @@ using System.Threading.Tasks; namespace Tango.MachineStudio.Common.Navigation { + /// <summary> + /// Represents the available views to navigate to using the <see cref="INavigationManager"/>. + /// </summary> public enum NavigationView { LoadingView, 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(); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IShutdownRequestBlocker.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IShutdownRequestBlocker.cs index a157bd598..4d5f968a4 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IShutdownRequestBlocker.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IShutdownRequestBlocker.cs @@ -6,8 +6,16 @@ using System.Threading.Tasks; namespace Tango.MachineStudio.Common.StudioApplication { + /// <summary> + /// Represents a component capable of receiving notification for when the Machine Studio shuts down. + /// The component can perform it's own shutdown operations, or cancel the current shutdown operation. + /// </summary> public interface IShutdownRequestBlocker { + /// <summary> + /// Called when the application is shutting down. + /// </summary> + /// <returns></returns> Task<bool> OnShutdownRequest(); } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs index 42f4f7b65..dfdac67c7 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/StudioApplication/IStudioApplicationManager.cs @@ -7,12 +7,34 @@ using Tango.Integration.Services; namespace Tango.MachineStudio.Common.StudioApplication { + /// <summary> + /// Represents the Machine Studio application manager. + /// </summary> public interface IStudioApplicationManager { + /// <summary> + /// Gets a value indicating whether Machine Studio is shutting down. + /// </summary> bool IsShuttingDown { get;} + + /// <summary> + /// Shutdown the application. + /// </summary> void ShutDown(); + + /// <summary> + /// Gets or sets the currently connected machine if any. + /// </summary> IExternalBridgeClient ConnectedMachine { get; set; } + + /// <summary> + /// Gets a value indicating whether the <see cref="ConnectedMachine"/> is valid. + /// </summary> bool IsMachineConnected { get; } + + /// <summary> + /// Gets a value indicating whether the <see cref="ConnectedMachine"/> is valid and connected through TCP/IP. + /// </summary> bool IsMachineConnectedViaTCP { get; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index 49fee31f1..42eae3c1e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -91,7 +91,6 @@ <DependentUpon>MdiContainerControl.xaml</DependentUpon> </Compile> <Compile Include="Converters\PointToMarginConverter.cs" /> - <Compile Include="ExtensionMethods\UserExtensions.cs" /> <Compile Include="IStudioModule.cs" /> <Compile Include="Modules\IStudioModuleLoader.cs" /> <Compile Include="Navigation\INavigationManager.cs" /> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ValidationRules/Required.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ValidationRules/Required.cs index 84f274965..aac00fdf1 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ValidationRules/Required.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ValidationRules/Required.cs @@ -8,8 +8,20 @@ using System.Windows.Controls; namespace Tango.MachineStudio.Common.ValidationRules { + /// <summary> + /// Represents a required field validation rule. + /// </summary> + /// <seealso cref="System.Windows.Controls.ValidationRule" /> public class Required : ValidationRule { + /// <summary> + /// When overridden in a derived class, performs validation checks on a value. + /// </summary> + /// <param name="value">The value from the binding target to check.</param> + /// <param name="cultureInfo">The culture to use in this rule.</param> + /// <returns> + /// A <see cref="T:System.Windows.Controls.ValidationResult" /> object. + /// </returns> public override ValidationResult Validate(object value, CultureInfo cultureInfo) { return new ValidationResult(!String.IsNullOrWhiteSpace(value.ToStringSafe()), "Required"); |
