aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-01-22 17:57:57 +0200
committerShlomo Hecht <shlomo@twine-s.com>2019-01-22 17:57:57 +0200
commitbb9f7604e91b3803c23c2212a4854512de600717 (patch)
tree0327a270903e9cab582c9cdfd2ac31bef9077b61 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels
parent0b0df0301bfa63e33034840651787a959e55ca38 (diff)
parentde5315c050369dd7d2cc7cdc2b82e9cde0d6da24 (diff)
downloadTango-bb9f7604e91b3803c23c2212a4854512de600717.tar.gz
Tango-bb9f7604e91b3803c23c2212a4854512de600717.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs17
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ReportIssueViewVM.cs36
2 files changed, 52 insertions, 1 deletions
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 4ebf3d96d..c8e25e2d4 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
@@ -87,6 +87,17 @@ namespace Tango.MachineStudio.UI.ViewModels
set { _rememberMe = value; RaisePropertyChangedAuto(); }
}
+ private bool _enableSlotSelection;
+ /// <summary>
+ /// Gets or sets a value indicating whether to enable the deployment slot selection.
+ /// </summary>
+ public bool EnableSlotSelection
+ {
+ get { return _enableSlotSelection; }
+ set { _enableSlotSelection = value; RaisePropertyChangedAuto(); }
+ }
+
+
/// <summary>
/// Gets or sets the login command.
/// </summary>
@@ -100,6 +111,8 @@ namespace Tango.MachineStudio.UI.ViewModels
/// <param name="notificationProvider">The notification provider.</param>
public LoginViewVM(IAuthenticationProvider authenticationProvider, INavigationManager navigationManager, INotificationProvider notificationProvider, IEventLogger eventLogger)
{
+ EnableSlotSelection = true;
+
_settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>();
_notificationProvider = notificationProvider;
@@ -137,6 +150,8 @@ namespace Tango.MachineStudio.UI.ViewModels
await Task.Factory.StartNew(() =>
{
+
+
_settings.DeploymentSlot = DeploymentSlot;
_authenticationProvider.Login(Email, Password);
@@ -151,6 +166,8 @@ namespace Tango.MachineStudio.UI.ViewModels
_settings.Save();
_eventLogger.Log("User logged in.");
+
+ EnableSlotSelection = false;
});
}
catch (Exception ex)
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ReportIssueViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ReportIssueViewVM.cs
index 96800d9cf..21330a4fc 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ReportIssueViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/ReportIssueViewVM.cs
@@ -1,8 +1,11 @@
-using System;
+using Microsoft.Win32;
+using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Tango.Core.Commands;
using Tango.MachineStudio.Common;
using Tango.MachineStudio.Common.Notifications;
using Tango.MachineStudio.UI.TFS;
@@ -24,9 +27,19 @@ namespace Tango.MachineStudio.UI.ViewModels
[WorkItemValidation]
public WorkItem WorkItem { get; set; }
+ private String _imageFile;
+ public String ImageFile
+ {
+ get { return _imageFile; }
+ set { _imageFile = value; RaisePropertyChangedAuto(); }
+ }
+
+ public RelayCommand BrowseImageCommand { get; set; }
+
public ReportIssueViewVM() : base()
{
_settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>();
+ BrowseImageCommand = new RelayCommand(BrowseImage);
}
public ReportIssueViewVM(Project project, WorkItem workItem) : this()
@@ -55,12 +68,33 @@ namespace Tango.MachineStudio.UI.ViewModels
SelectedTags = new SelectedObjectCollection<Tag>(Project.Tags.ToObservableCollection(), workItem.Tags.ToObservableCollection());
}
+ private void BrowseImage()
+ {
+ OpenFileDialog dlg = new OpenFileDialog();
+ dlg.Title = "Select image file";
+ dlg.Filter = "Image Files|*.jpg;*.bmp;*.png";
+ if (dlg.ShowDialog().Value)
+ {
+ ImageFile = dlg.FileName;
+ }
+ }
+
protected override void Accept()
{
if (Validate())
{
WorkItem.Tags = SelectedTags.SynchedSource.ToList();
+ if (ImageFile != null && File.Exists(ImageFile))
+ {
+ WorkItem.Attachments.Add(new Attachment()
+ {
+ Description = "User Image",
+ FilePath = ImageFile,
+ Name = Path.GetFileName(ImageFile),
+ });
+ }
+
try
{
_settings.DefaultIssueReportArea = WorkItem.Area.Name;