Mercurial > silverbladetech
comparison Chronosv2/source/Authentication/AuthenticationObserver.cs @ 14:741981715d94
Initial review and translations
author | stevenh7776 stevenhollidge@hotmail.com |
---|---|
date | Tue, 21 Feb 2012 18:59:30 +0700 |
parents | 443821e55f06 |
children |
comparison
equal
deleted
inserted
replaced
13:87905693f506 | 14:741981715d94 |
---|---|
1 /* | 1 using System; |
2 The MIT License | |
3 | |
4 Copyright (c) 2009-2010. Carlos Guzmán Álvarez. http://chronoswpf.codeplex.com/ | |
5 | |
6 Permission is hereby granted, free of charge, to any person obtaining a copy | |
7 of this software and associated documentation files (the "Software"), to deal | |
8 in the Software without restriction, including without limitation the rights | |
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
10 copies of the Software, and to permit persons to whom the Software is | |
11 furnished to do so, subject to the following conditions: | |
12 | |
13 The above copyright notice and this permission notice shall be included in | |
14 all copies or substantial portions of the Software. | |
15 | |
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
22 THE SOFTWARE. | |
23 */ | |
24 | |
25 using System; | |
26 using System.Threading.Tasks; | 2 using System.Threading.Tasks; |
27 using Chronos.Authentication; | 3 using Chronos.Authentication; |
28 using Chronos.Modules.Navigation; | 4 using Chronos.Modules.Navigation; |
29 using Chronos.Presentation.Core.Navigation; | 5 using Chronos.Presentation.Core.Navigation; |
30 using Chronos.Presentation.Core.VirtualDesktops; | 6 using Chronos.Presentation.Core.VirtualDesktops; |
74 public void OnNext(AuthenticationInfo value) | 50 public void OnNext(AuthenticationInfo value) |
75 { | 51 { |
76 switch (value.Action) | 52 switch (value.Action) |
77 { | 53 { |
78 case AuthenticationAction.LogOn: | 54 case AuthenticationAction.LogOn: |
79 Logger.Debug("Autenticación del usuario"); | 55 Logger.Debug("User Authentication"); |
80 ServiceLocator.GetService<INavigationService>() | 56 ServiceLocator.GetService<INavigationService>() |
81 .Navigate(NavigateMode.Modal, NavigationRoutes.Login); | 57 .Navigate(NavigateMode.Modal, NavigationRoutes.Login); |
82 break; | 58 break; |
83 | 59 |
84 case AuthenticationAction.LoggedIn: | 60 case AuthenticationAction.LoggedIn: |
85 Logger.Debug("Usuario autenticado correctamente"); | 61 Logger.Debug("Properly authenticated user"); |
86 ServiceLocator.GetService<IVirtualDesktopManager>() | 62 ServiceLocator.GetService<IVirtualDesktopManager>() |
87 .ActivateDefaultDesktop(); | 63 .ActivateDefaultDesktop(); |
88 break; | 64 break; |
89 | 65 |
90 case AuthenticationAction.LogOut: | 66 case AuthenticationAction.LogOut: |
91 Logger.Debug("Cerrando sesión"); | 67 Logger.Debug("Logging out"); |
92 Task t = Task.Factory.StartNew | 68 Task t = Task.Factory.StartNew |
93 ( | 69 ( |
94 () => | 70 () => |
95 { | 71 { |
96 ServiceLocator.GetService<IVirtualDesktopManager>() | 72 ServiceLocator.GetService<IVirtualDesktopManager>() |