diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-02-13 23:09:44 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-02-13 23:09:44 +0200 |
| commit | 678b22afc27e53811f978103b7ea41609ff68606 (patch) | |
| tree | faaabb6468c1b22d770eb753eeac39b34ef65e4f /Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/MainViewVM.cs | |
| parent | 69f27fd4bfc5a46fad019b06c9c8d06159c400b9 (diff) | |
| download | Tango-678b22afc27e53811f978103b7ea41609ff68606.tar.gz Tango-678b22afc27e53811f978103b7ea41609ff68606.zip | |
Implemented and deployed machine service gateway.
Implemented AzureUtils => Gateway.
Diffstat (limited to 'Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/MainViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/MainViewVM.cs | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/MainViewVM.cs index 4faf1369f..69543cb5a 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/MainViewVM.cs @@ -2,6 +2,7 @@ using Microsoft.Azure.Management.Fluent; using System; using System.Collections.Generic; +using System.Configuration; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -9,6 +10,7 @@ using System.Windows.Input; using Tango.AzureUtils.Deployment; using Tango.AzureUtils.UI.Managers; using Tango.Core.Commands; +using Tango.Core.Cryptography; using Tango.Core.DI; using Tango.SharedUI; @@ -34,6 +36,21 @@ namespace Tango.AzureUtils.UI.ViewModels set { _progress = value; RaisePropertyChangedAuto(); } } + private String _email; + public String Email + { + get { return _email; } + set { _email = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + private String _password; + public String Password + { + get { return _password; } + set { _password = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + #endregion #region Commands @@ -44,7 +61,14 @@ namespace Tango.AzureUtils.UI.ViewModels public MainViewVM() { - InitCommand = new RelayCommand(Init, () => !IsInitialized); + InitCommand = new RelayCommand(Init, () => !IsInitialized && !String.IsNullOrWhiteSpace(Email) && !String.IsNullOrWhiteSpace(Password)); + + try + { + Email = Settings.Email; + Password = Settings.Password; + } + catch { } } public override void OnApplicationReady() @@ -65,7 +89,12 @@ namespace Tango.AzureUtils.UI.ViewModels IsFree = false; StatusManager.UpdateStatus(AzureUtilsStage.Initializing, "Authenticating...", true); - _azure = await AzureUtilsAuthenticationFactory.AuthenticateOrGetAsync(); + _azure = await AzureUtilsAuthenticationFactory.AuthenticateOrGetAsync(ConfigurationManager.AppSettings.Get("GatewayUrl"), Email, Password); + + Settings.Email = Email; + Settings.Password = Password; + Settings.Save(); + List<IWebAppBase> allApps = new List<IWebAppBase>(); |
