aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2020-01-19 16:44:58 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2020-01-19 16:44:58 +0200
commitc87dfdfc47a41fd5524dc9145350208295ca6714 (patch)
tree824fb82b79b8486fa2be9d63cb29b8504a7ee5a9 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
parent601c03423f2f623d28df991ef6870e3d981ffe05 (diff)
parent13b01cc6e2539dae0063f8cf23909e07982dfbb9 (diff)
downloadTango-c87dfdfc47a41fd5524dc9145350208295ca6714.tar.gz
Tango-c87dfdfc47a41fd5524dc9145350208295ca6714.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs3
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/active_directory.pngbin0 -> 15300 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/login.pngbin0 -> 6401 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/machinestudio_login.pngbin0 -> 21788 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs15
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj5
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs64
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs29
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs145
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml9
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml76
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml2
12 files changed, 253 insertions, 95 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 c992d0768..209b26505 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
@@ -90,7 +90,7 @@ namespace Tango.MachineStudio.UI.Authentication
/// <param name="password">The password.</param>
/// <returns></returns>
/// <exception cref="AuthenticationException">Login failed for user " + email</exception>
- public AuthenticationLoginResult Login(string email, string password, bool bypassVersionCheck = false)
+ public AuthenticationLoginResult Login(string email, string password, LoginMethod method, bool bypassVersionCheck = false)
{
_refreshTokenTimer.Stop();
@@ -118,6 +118,7 @@ namespace Tango.MachineStudio.UI.Authentication
Email = email,
Password = password,
Version = appVersion,
+ Method = method,
}).Result;
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/active_directory.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/active_directory.png
new file mode 100644
index 000000000..4cced33e0
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/active_directory.png
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/login.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/login.png
new file mode 100644
index 000000000..9f7d0b9ba
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/login.png
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/machinestudio_login.png b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/machinestudio_login.png
new file mode 100644
index 000000000..98f1b286a
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Images/machinestudio_login.png
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
index 0235f8cca..2c3c9ccb9 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
@@ -49,6 +49,11 @@ namespace Tango.MachineStudio.UI.StudioApplication
public event EventHandler ApplicationReady;
/// <summary>
+ /// Occurs when the connected machine session has been lost and an automatic reconnection with the last machine is required.
+ /// </summary>
+ public event EventHandler ReconnectionRequired;
+
+ /// <summary>
/// Initializes a new instance of the <see cref="DefaultStudioApplicationManager" /> class.
/// </summary>
/// <param name="navigationManager">The navigation manager.</param>
@@ -126,6 +131,8 @@ namespace Tango.MachineStudio.UI.StudioApplication
{
if (e == Transport.TransportComponentState.Disconnected || e == Transport.TransportComponentState.Failed)
{
+ bool reconnect = ConnectedMachine is IExternalBridgeSecureClient;
+
ConnectedMachine = null;
if (e == Transport.TransportComponentState.Failed)
@@ -134,12 +141,16 @@ namespace Tango.MachineStudio.UI.StudioApplication
ConnectionLostViewVM vm = new ConnectionLostViewVM()
{
- Exception = failed_reason
+ Exception = failed_reason,
+ AutoReconnect = reconnect,
};
InvokeUI(() =>
{
- _notification.ShowModalDialog<ConnectionLostViewVM, ConnectionLostView>(vm, (x) => { }, () => { });
+ _notification.ShowModalDialog<ConnectionLostViewVM, ConnectionLostView>(vm, (x) =>
+ {
+ ReconnectionRequired?.Invoke(this, new EventArgs());
+ }, () => { });
});
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
index 565489f0b..efe8fc6b1 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
@@ -363,6 +363,9 @@
<Link>TCC\template.bmp</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
+ <Resource Include="Images\login.png" />
+ <Resource Include="Images\active_directory.png" />
+ <Resource Include="Images\machinestudio_login.png" />
<Resource Include="Images\external-bridge-signalr.png" />
<Resource Include="machine_new_small.ico" />
<Resource Include="Images\Statuses\dyeing.png" />
@@ -676,7 +679,7 @@ if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)Roslyn\"</PostBuildEven
</Target>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_BuildVersioningStyle="None.None.Increment.DeltaBaseYearDayOfYear" BuildVersion_UpdateFileVersion="True" BuildVersion_DetectChanges="True" BuildVersion_UseGlobalSettings="False" />
+ <UserProperties BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="True" BuildVersion_UpdateFileVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.DeltaBaseYearDayOfYear" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs
index f1f4f69c0..e96f0ab62 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ConnectionLostViewVM.cs
@@ -3,12 +3,76 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Timers;
+using System.Windows.Threading;
using Tango.SharedUI;
namespace Tango.MachineStudio.UI.ViewModels
{
public class ConnectionLostViewVM : DialogViewVM
{
+ private Timer _reconnectTimer;
+
public String Exception { get; set; }
+
+ private int _reconnectinSeconds;
+ public int ReconnectinSeconds
+ {
+ get { return _reconnectinSeconds; }
+ set { _reconnectinSeconds = value; RaisePropertyChangedAuto(); }
+ }
+
+ private bool _autoReconnect;
+ public bool AutoReconnect
+ {
+ get { return _autoReconnect; }
+ set { _autoReconnect = value; RaisePropertyChangedAuto(); }
+ }
+
+
+ public ConnectionLostViewVM() : base()
+ {
+ ReconnectinSeconds = 10;
+ _reconnectTimer = new Timer();
+ _reconnectTimer.Interval = TimeSpan.FromSeconds(1).TotalMilliseconds;
+ _reconnectTimer.Elapsed += _reconnectTimer_Elapsed;
+ }
+
+ private void _reconnectTimer_Elapsed(object sender, ElapsedEventArgs e)
+ {
+ ReconnectinSeconds--;
+
+ if (ReconnectinSeconds == -1)
+ {
+ _reconnectTimer.Stop();
+
+ InvokeUI(() =>
+ {
+ Accept();
+ });
+ }
+ }
+
+ public override void OnShow()
+ {
+ base.OnShow();
+
+ if (AutoReconnect)
+ {
+ _reconnectTimer.Start();
+ }
+ }
+
+ protected override void Accept()
+ {
+ _reconnectTimer.Stop();
+ base.Accept();
+ }
+
+ protected override void Cancel()
+ {
+ base.Cancel();
+ _reconnectTimer.Stop();
+ }
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
index cf34764d9..9c2367f93 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
@@ -102,6 +102,21 @@ namespace Tango.MachineStudio.UI.ViewModels
set { _enableSlotSelection = value; RaisePropertyChangedAuto(); }
}
+ private bool _isActiveDirectory;
+ public bool IsActiveDirectory
+ {
+ get { return _isActiveDirectory; }
+ set { _isActiveDirectory = value; RaisePropertyChangedAuto(); if (value) IsStandardUser = false; }
+ }
+
+ private bool _isStandardUser;
+ public bool IsStandardUser
+ {
+ get { return _isStandardUser; }
+ set { _isStandardUser = value; RaisePropertyChangedAuto(); if (value) IsActiveDirectory = false; }
+ }
+
+
/// <summary>
/// Gets or sets the login command.
@@ -131,6 +146,15 @@ namespace Tango.MachineStudio.UI.ViewModels
Email = _settings.LastLoginEmail;
DeploymentSlot = _settings.DeploymentSlot;
RememberMe = _settings.RememberMe;
+
+ if (_settings.LastLoginMethod == LoginMethod.ActiveDirectory)
+ {
+ IsActiveDirectory = true;
+ }
+ else
+ {
+ IsStandardUser = true;
+ }
try
{
@@ -154,11 +178,13 @@ namespace Tango.MachineStudio.UI.ViewModels
IsLogging = true;
InvalidateRelayCommands();
+ LoginMethod loginMethod = IsActiveDirectory ? LoginMethod.ActiveDirectory : LoginMethod.StandardUser;
+
await Task.Factory.StartNew(() =>
{
_settings.DeploymentSlot = DeploymentSlot;
- LoginResponse result = _authenticationProvider.Login(Email, Password, _settings.ByPassEnvironmentVersionCheck).Response;
+ LoginResponse result = _authenticationProvider.Login(Email, Password, loginMethod, _settings.ByPassEnvironmentVersionCheck).Response;
if (result.VersionChangeRequired && !_settings.ByPassEnvironmentVersionCheck)
{
@@ -183,6 +209,7 @@ namespace Tango.MachineStudio.UI.ViewModels
_settings.LastLoginEmail = Email;
_settings.RememberMe = RememberMe;
+ _settings.LastLoginMethod = loginMethod;
_settings.LastLoginPassword = RememberMe ? cryptographer.Encrypt(Password) : null;
_settings.Save();
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
index a7397835b..ce3b825c8 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
@@ -58,6 +58,8 @@ namespace Tango.MachineStudio.UI.ViewModels
private IEventLogger _eventLogger;
private MachineStudioSettings _settings;
private MachineStudioWebClient _machineStudioWebClient;
+ private IExternalBridgeSecureClient _reconnectionMachine;
+ private MachineLoginViewVM _reconnectionMachineConfig;
/// <summary>
/// Gets or sets the current loaded module.
@@ -344,6 +346,13 @@ namespace Tango.MachineStudio.UI.ViewModels
AboutCommand = new RelayCommand(ShowAboutDialog);
ChangeAppThemeCommand = new RelayCommand<MachineStudioTheme>(ChangeTheme);
+
+ ApplicationManager.ReconnectionRequired += ApplicationManager_ReconnectionRequired;
+ }
+
+ private void ApplicationManager_ReconnectionRequired(object sender, EventArgs e)
+ {
+ ConnectToMachineSecure(_reconnectionMachine, _reconnectionMachineConfig);
}
private void MachineEventsStateProvider_EventsResolved(object sender, IEnumerable<MachinesEvent> e)
@@ -465,62 +474,7 @@ namespace Tango.MachineStudio.UI.ViewModels
if (x.SelectedMachine.RequiresAuthentication)
{
- //Check machine exist on my database first
- if (x.SelectedMachine.Machine == null)
- {
- _notificationProvider.ShowError($"The specified machine '{x.SelectedMachine.SerialNumber}' could not be found on the database. Aborting connection.");
- return;
- }
-
- _notificationProvider.ShowModalDialog<MachineLoginViewVM>(async (login) =>
- {
- using (NotificationProvider.PushTaskItem("Connecting to machine " + x.SelectedMachine.ToString() + "..."))
- {
- try
- {
- await x.SelectedMachine.As<IExternalBridgeSecureClient>().Connect(new PMR.Integration.ExternalBridgeLoginRequest()
- {
- AppID = "Machine Studio",
- HostName = Environment.MachineName,
- Password = login.Password,
- UserGuid = AuthenticationProvider.CurrentUser.Guid,
- Intent = login.Intent,
- });
-
- ApplicationManager.SetConnectedMachine(x.SelectedMachine);
- (x.SelectedMachine as IExternalBridgeSecureClient).SessionClosed += (_, __) =>
- {
- InvokeUI(() =>
- {
- _notificationProvider.ShowError("The remote machine has closed the current session. Machine disconnected.");
- ApplicationManager.SetConnectedMachine(null);
- });
- };
- PostMessage(new MachineConnectionChangedMessage() { Machine = x.SelectedMachine });
- _eventLogger.Log(String.Format("Successfully connected to machine {0} via TCP", x.SelectedMachine.SerialNumber));
-
- //if (x.UploadHardwareConfiguration)
- //{
- // UploadHardwareConfiguration(false);
- //}
-
- }
- catch (ResponseErrorException ex)
- {
- LogManager.Log(ex);
- _eventLogger.Log(ex, "Error connecting to machine " + x.SelectedMachine.SerialNumber);
- _notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Container.ErrorMessage);
- }
- catch (Exception ex)
- {
- LogManager.Log(ex);
- _eventLogger.Log(ex, "Error connecting to machine " + x.SelectedMachine.SerialNumber);
- _notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Message);
- }
-
- InvalidateRelayCommands();
- }
- });
+ ConnectToMachineSecure(x.SelectedMachine as IExternalBridgeSecureClient);
}
else
{
@@ -633,6 +587,77 @@ namespace Tango.MachineStudio.UI.ViewModels
InvalidateRelayCommands();
}
+ private async void ConnectToMachineSecure(IExternalBridgeSecureClient machine, MachineLoginViewVM config)
+ {
+ using (NotificationProvider.PushTaskItem("Connecting to machine " + machine.ToString() + "..."))
+ {
+ try
+ {
+ await machine.Connect(new PMR.Integration.ExternalBridgeLoginRequest()
+ {
+ AppID = "Machine Studio",
+ HostName = Environment.MachineName,
+ Password = config.Password,
+ UserGuid = AuthenticationProvider.CurrentUser.Guid,
+ Intent = config.Intent,
+ });
+
+ _reconnectionMachine = machine;
+ _reconnectionMachineConfig = config;
+
+ ApplicationManager.SetConnectedMachine(machine);
+ machine.SessionClosed -= Machine_SessionClosed;
+ machine.SessionClosed += Machine_SessionClosed;
+ PostMessage(new MachineConnectionChangedMessage() { Machine = machine });
+ _eventLogger.Log(String.Format("Successfully connected to machine {0} via TCP", machine.SerialNumber));
+
+ //if (x.UploadHardwareConfiguration)
+ //{
+ // UploadHardwareConfiguration(false);
+ //}
+
+ }
+ catch (ResponseErrorException ex)
+ {
+ LogManager.Log(ex);
+ _eventLogger.Log(ex, "Error connecting to machine " + machine.SerialNumber);
+ _notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Container.ErrorMessage);
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex);
+ _eventLogger.Log(ex, "Error connecting to machine " + machine.SerialNumber);
+ _notificationProvider.ShowError("Could not connect to the selected machine." + Environment.NewLine + ex.Message);
+ }
+
+ InvalidateRelayCommands();
+ }
+ }
+
+ private void ConnectToMachineSecure(IExternalBridgeSecureClient machine)
+ {
+ //Check machine exist on my database first
+ if (machine.Machine == null)
+ {
+ _notificationProvider.ShowError($"The specified machine '{machine.SerialNumber}' could not be found on the database. Aborting connection.");
+ return;
+ }
+
+ _notificationProvider.ShowModalDialog<MachineLoginViewVM>((login) =>
+ {
+ ConnectToMachineSecure(machine, login);
+ });
+ }
+
+ private void Machine_SessionClosed(object sender, EventArgs e)
+ {
+ InvokeUI(() =>
+ {
+ _notificationProvider.ShowError("The remote machine has closed the current session. Machine disconnected.");
+ ApplicationManager.SetConnectedMachine(null);
+ });
+ }
+
private async void UploadHardwareConfiguration(bool showSuccessMessage = true)
{
try
@@ -706,10 +731,10 @@ namespace Tango.MachineStudio.UI.ViewModels
{
IsModuleLoaded = false;
LogManager.Log(String.Format("Navigating to Home..."));
- (MainView.Self as MainView).NavigationControl.NavigateTo("Home",() =>
- {
- CurrentModule = module;
- });
+ (MainView.Self as MainView).NavigationControl.NavigateTo("Home", () =>
+ {
+ CurrentModule = module;
+ });
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml
index 28937a438..ba5624592 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml
@@ -7,7 +7,7 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
mc:Ignorable="d"
- Width="559" Height="266" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:ConnectionLostViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}">
+ Width="559" Height="350" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:ConnectionLostViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}">
<Grid>
<Grid>
<Grid.RowDefinitions>
@@ -50,7 +50,12 @@
</Grid>
<Grid Grid.Row="1">
- <Button HorizontalAlignment="Right" Width="140" Command="{Binding OKCommand}">CLOSE</Button>
+ <TextBlock Visibility="{Binding AutoReconnect,Converter={StaticResource BoolToVisConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{StaticResource GrayBrush}">
+ <Run>Reconnecting in</Run>
+ <Run Text="{Binding ReconnectinSeconds}" Foreground="{StaticResource RedBrush300}"></Run>
+ <Run>seconds...</Run>
+ </TextBlock>
+ <Button HorizontalAlignment="Right" Width="140" Command="{Binding CloseCommand}">CLOSE</Button>
</Grid>
</Grid>
</Grid>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml
index d93dbc127..e7428dd28 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml
@@ -45,35 +45,57 @@
<Image Source="{StaticResource MachineBig}" RenderOptions.BitmapScalingMode="Fant" Width="100"></Image>
<TextBlock Margin="20 0 0 0" VerticalAlignment="Center" FontSize="70" Foreground="{StaticResource AccentColorBrush}">Machine Studio</TextBlock>
</StackPanel>
- <DockPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="320" Margin="0 120 0 0" Height="510">
- <Button DockPanel.Dock="Bottom" AutomationProperties.AutomationId="{x:Static automation:UI.LoginButton}" Margin="25 20 0 0" Height="50" Command="{Binding LoginCommand}" Content="LOGIN"></Button>
+ <Grid>
+ <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="-600 110 0 0" Visibility="{Binding IsLogging,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
+ <RadioButton ToolTip="Login using your an active directory account" IsChecked="{Binding IsActiveDirectory}" FontSize="16" VerticalContentAlignment="Center" Padding="10 0 0 0">
+ <Image Source="/Images/active_directory.png" Stretch="Uniform" Height="80" RenderOptions.BitmapScalingMode="Fant" />
+ </RadioButton>
+ <RadioButton ToolTip="Login using a standard Machine Studio account" IsChecked="{Binding IsStandardUser}" FontSize="16" Margin="0 20 0 0" VerticalContentAlignment="Center" Padding="10 0 0 0">
+ <Image Source="/Images/machinestudio_login.png" Stretch="Uniform" Height="55" RenderOptions.BitmapScalingMode="Fant" />
+ </RadioButton>
+ </StackPanel>
+ <DockPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="320" Margin="0 120 0 0" Height="510">
- <Grid>
- <StackPanel Visibility="{Binding IsLogging,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
- <TextBlock HorizontalAlignment="Center" FontSize="24">Login to your account</TextBlock>
- <Image Source="/Images/account.png" RenderOptions.BitmapScalingMode="Fant" Width="100" Margin="0 20 0 0"></Image>
- <DockPanel Margin="0 20 0 0">
- <materialDesign:PackIcon Margin="0 0 0 0" Width="20" Height="20" VerticalAlignment="Top" Foreground="{Binding ElementName=txtEmail, Path=BorderBrush}" Kind="EmailOutline" />
- <TextBox x:Name="txtEmail" IsTabStop="True" Margin="5 0 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="Email" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="20" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Text="{Binding Email,UpdateSourceTrigger=PropertyChanged,ValidatesOnNotifyDataErrors=True}" AutomationProperties.IsRequiredForForm="True" />
- </DockPanel>
- <DockPanel Margin="0 20 0 0">
- <materialDesign:PackIcon Margin="0 0 0 0" Width="20" Height="20" VerticalAlignment="Top" Foreground="{Binding ElementName=txtPass, Path=BorderBrush}" Kind="Key" />
- <PasswordBox x:Name="txtPass" helpers:PasswordHelper.Attach="True" helpers:PasswordHelper.Password="{Binding Password,Mode=TwoWay}" Margin="5 0 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="Password" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="20" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}" AutomationProperties.IsRequiredForForm="True" />
- </DockPanel>
- <DockPanel Margin="0 40 0 0" IsEnabled="{Binding EnableSlotSelection}">
- <materialDesign:PackIcon Margin="0 0 0 0" Width="20" Height="20" VerticalAlignment="Top" Foreground="{Binding ElementName=combo, Path=BorderBrush}" Kind="Settings" />
- <ComboBox x:Name="combo" ItemsSource="{Binding Source={x:Type web:DeploymentSlot},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding DeploymentSlot}" SelectedValuePath="Value" DisplayMemberPath="DisplayName" Margin="5 0 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="Environment" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="20" />
- </DockPanel>
- <TextBlock Visibility="{Binding EnableSlotSelection,Converter={StaticResource BooleanToVisibilityInverseConverter}}" Margin="25 0 0 0" FontSize="10" Foreground="Gray">Environment selection requires restarting the application</TextBlock>
- <CheckBox Margin="25 20 0 0" IsChecked="{Binding RememberMe}">Remember me</CheckBox>
- </StackPanel>
+ <Button DockPanel.Dock="Bottom" AutomationProperties.AutomationId="{x:Static automation:UI.LoginButton}" Margin="25 20 0 0" Height="50" Command="{Binding LoginCommand}" Content="LOGIN"></Button>
- <StackPanel Visibility="{Binding IsLogging,Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Center">
- <mahapps:ProgressRing Width="80" Height="80" IsActive="{Binding IsLogging}"></mahapps:ProgressRing>
- <TextBlock HorizontalAlignment="Center" Margin="0 30 0 0" FontSize="18" FontStyle="Italic">Logging you in...</TextBlock>
- </StackPanel>
- </Grid>
- </DockPanel>
+ <Grid>
+ <StackPanel Visibility="{Binding IsLogging,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
+ <TextBlock HorizontalAlignment="Center" FontSize="24">Login to your account</TextBlock>
+ <Image Source="/Images/login.png" RenderOptions.BitmapScalingMode="Fant" Width="100" Margin="0 20 0 0"></Image>
+ <DockPanel Margin="0 20 0 0">
+ <materialDesign:PackIcon Margin="0 0 0 0" Width="20" Height="20" VerticalAlignment="Top" Foreground="{Binding ElementName=txtEmail, Path=BorderBrush}" Kind="EmailOutline" />
+ <TextBox x:Name="txtEmail" IsTabStop="True" Margin="5 0 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="20" Text="{Binding Email,UpdateSourceTrigger=PropertyChanged,ValidatesOnNotifyDataErrors=True}" AutomationProperties.IsRequiredForForm="True">
+ <TextBox.Style>
+ <Style TargetType="TextBox" BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}">
+ <Setter Property="materialDesign:HintAssist.Hint" Value="Active Directory Email"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsStandardUser}" Value="True">
+ <Setter Property="materialDesign:HintAssist.Hint" Value="Machine Studio Email"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </TextBox.Style>
+ </TextBox>
+ </DockPanel>
+ <DockPanel Margin="0 20 0 0">
+ <materialDesign:PackIcon Margin="0 0 0 0" Width="20" Height="20" VerticalAlignment="Top" Foreground="{Binding ElementName=txtPass, Path=BorderBrush}" Kind="Key" />
+ <PasswordBox x:Name="txtPass" helpers:PasswordHelper.Attach="True" helpers:PasswordHelper.Password="{Binding Password,Mode=TwoWay}" Margin="5 0 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="Password" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="20" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}" AutomationProperties.IsRequiredForForm="True" />
+ </DockPanel>
+ <DockPanel Margin="0 40 0 0" IsEnabled="{Binding EnableSlotSelection}">
+ <materialDesign:PackIcon Margin="0 0 0 0" Width="20" Height="20" VerticalAlignment="Top" Foreground="{Binding ElementName=combo, Path=BorderBrush}" Kind="Settings" />
+ <ComboBox x:Name="combo" ItemsSource="{Binding Source={x:Type web:DeploymentSlot},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding DeploymentSlot}" SelectedValuePath="Value" DisplayMemberPath="DisplayName" Margin="5 0 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="Environment" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="20" />
+ </DockPanel>
+ <TextBlock Visibility="{Binding EnableSlotSelection,Converter={StaticResource BooleanToVisibilityInverseConverter}}" Margin="25 0 0 0" FontSize="10" Foreground="Gray">Environment selection requires restarting the application</TextBlock>
+ <CheckBox Margin="25 20 0 0" IsChecked="{Binding RememberMe}">Remember me</CheckBox>
+ </StackPanel>
+
+ <StackPanel Visibility="{Binding IsLogging,Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Center">
+ <mahapps:ProgressRing Width="80" Height="80" IsActive="{Binding IsLogging}"></mahapps:ProgressRing>
+ <TextBlock HorizontalAlignment="Center" Margin="0 30 0 0" FontSize="18" FontStyle="Italic">Logging you in...</TextBlock>
+ </StackPanel>
+ </Grid>
+ </DockPanel>
+ </Grid>
</Grid>
</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
index 020343ba0..48f7b46d3 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
@@ -55,7 +55,7 @@
IsChecked="{Binding Source={x:Reference MenuToggleButton}, Path=IsChecked, Mode=TwoWay}" />
<StackPanel Margin="5 0 0 0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
- <Image Source="/Images/account.png" RenderOptions.BitmapScalingMode="Fant" VerticalAlignment="Center" Width="50" Height="50"></Image>
+ <Image Source="/Images/login.png" RenderOptions.BitmapScalingMode="Fant" VerticalAlignment="Center" Width="50" Height="50"></Image>
<StackPanel Margin="0 5 0 0">
<TextBlock FontSize="16" TextTrimming="CharacterEllipsis" MaxWidth="170" FontStyle="Italic" FontWeight="Bold" Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding AuthenticationProvider.CurrentUser.Contact.FullName}"></TextBlock>
<TextBlock FontSize="12" TextTrimming="CharacterEllipsis" MaxWidth="170" FontStyle="Italic" Margin="10 5 0 0" VerticalAlignment="Center">