aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2018-02-20 16:45:00 +0200
committerAvi Levkovich <avi@twine-s.com>2018-02-20 16:45:00 +0200
commit6c208c90bc45aff4a7fa214356a42fe7757c5e6f (patch)
tree0d77bc6a0ecfbb53cf42c5462ee19212197ee1bd /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication
parentb0823127f152fe97a6e8fce29e427c7f3db9cf5a (diff)
parent1a573aaa346ec4b8bd58a0e35ab9df571a09b855 (diff)
downloadTango-6c208c90bc45aff4a7fa214356a42fe7757c5e6f.tar.gz
Tango-6c208c90bc45aff4a7fa214356a42fe7757c5e6f.zip
MERGE
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs24
1 files changed, 22 insertions, 2 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
index a30cf0f92..82aba268d 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
@@ -5,15 +5,22 @@ using System.Security.Authentication;
using System.Text;
using System.Threading.Tasks;
using Tango.Core;
-using Tango.DAL.Observables;
+using Tango.Integration.Observables;
using Tango.MachineStudio.Common.Authentication;
namespace Tango.MachineStudio.UI.Authentication
{
+ /// <summary>
+ /// Represents the default Machine Studio <see cref="IAuthenticationProvider">Authentication provider</see>
+ /// </summary>
+ /// <seealso cref="Tango.Core.ExtendedObject" />
+ /// <seealso cref="Tango.MachineStudio.Common.Authentication.IAuthenticationProvider" />
public class DefaultAuthenticationProvider : ExtendedObject, IAuthenticationProvider
{
private User _currentUser;
-
+ /// <summary>
+ /// Gets the current logged-in user.
+ /// </summary>
public User CurrentUser
{
get { return _currentUser; }
@@ -25,8 +32,18 @@ namespace Tango.MachineStudio.UI.Authentication
}
}
+ /// <summary>
+ /// Occurs when the current logged-in user has changed.
+ /// </summary>
public event EventHandler<User> CurrentUserChanged;
+ /// <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>
+ /// <exception cref="AuthenticationException">Login failed for user " + email</exception>
public User Login(string email, string password)
{
User user = ObservablesEntitiesAdapter.Instance.Users.SingleOrDefault(x => x.Email.ToLower() == email.ToLower() && x.Password == password);
@@ -40,6 +57,9 @@ namespace Tango.MachineStudio.UI.Authentication
return user;
}
+ /// <summary>
+ /// Logs-out the current logged-in user.
+ /// </summary>
public void Logout()
{
CurrentUser = null;