aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-11-25 10:44:37 +0200
committerShlomo Hecht <shlomo@twine-s.com>2018-11-25 10:44:37 +0200
commitbeff6af103bb0ae9b9147a907c6567bdb33abd00 (patch)
tree375eefd654c25f3b68c0cf5b3612df844a140d8e /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
parent57f20269fbb4c591aa73c9f5e50118310cc4892e (diff)
parentdff24e56a8906b8c9b355cf407f25f4b793beafe (diff)
downloadTango-beff6af103bb0ae9b9147a907c6567bdb33abd00.tar.gz
Tango-beff6af103bb0ae9b9147a907c6567bdb33abd00.zip
merge
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs16
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs38
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj6
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs4
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs13
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs5
7 files changed, 75 insertions, 9 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
index de819a61f..115e3f140 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
@@ -4,5 +4,5 @@ using System.Runtime.InteropServices;
[assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyTitle("Tango - Machine Studio")]
-[assembly: AssemblyVersion("3.5.61.18305")]
+[assembly: AssemblyVersion("3.5.73.18305")]
[assembly: ComVisible(false)] \ No newline at end of file
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 3864708fc..6303b1ac8 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
@@ -26,6 +26,7 @@ using Tango.MachineStudio.Common.Notifications;
using Tango.MachineStudio.UI.Views;
using Tango.Integration.Operation;
using Tango.MachineStudio.UI.Windows;
+using Tango.MachineStudio.Common.JobRunsLogging;
namespace Tango.MachineStudio.UI.StudioApplication
{
@@ -39,15 +40,22 @@ namespace Tango.MachineStudio.UI.StudioApplication
private INavigationManager _navigationManager;
private IStudioModuleLoader _moduleLoader;
private INotificationProvider _notification;
+ private IJobRunsLogger _jobRunsLogger;
private List<Window> _openedWindows;
private List<IStudioViewModel> _notified_view_models;
/// <summary>
+ /// Occurs when the application is ready.
+ /// </summary>
+ public event EventHandler ApplicationReady;
+
+ /// <summary>
/// Initializes a new instance of the <see cref="DefaultStudioApplicationManager" /> class.
/// </summary>
/// <param name="navigationManager">The navigation manager.</param>
- public DefaultStudioApplicationManager(INavigationManager navigationManager, IStudioModuleLoader moduleLoader, INotificationProvider notification)
+ public DefaultStudioApplicationManager(INavigationManager navigationManager, IStudioModuleLoader moduleLoader, INotificationProvider notification, IJobRunsLogger jobRunsLogger)
{
+ _jobRunsLogger = jobRunsLogger;
_moduleLoader = moduleLoader;
_navigationManager = navigationManager;
_notification = notification;
@@ -332,7 +340,7 @@ namespace Tango.MachineStudio.UI.StudioApplication
/// </summary>
public void NotifyApplicationReady()
{
- TangoIOC.Default.GetAllInstancesByBase<IStudioViewModel>().ToList().ForEach(x =>
+ TangoIOC.Default.GetAllInstancesByBase<IStudioViewModel>().ToList().ForEach(x =>
{
if (!_notified_view_models.Contains(x))
{
@@ -340,6 +348,9 @@ namespace Tango.MachineStudio.UI.StudioApplication
_notified_view_models.Add(x);
}
});
+
+ ApplicationReady?.Invoke(this, new EventArgs());
+ _jobRunsLogger.Init(this);
}
/// <summary>
@@ -360,5 +371,6 @@ namespace Tango.MachineStudio.UI.StudioApplication
ConnectedMachine = null;
}
}
+
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs
index 8f67a21c2..edce9d3c1 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
+using System.Security.Authentication;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@@ -23,6 +24,7 @@ namespace Tango.MachineStudio.UI.TFS
public class TeamFoundationServiceExtendedClient : TeamFoundationServiceClient
{
private TemporaryFolder _tempFolder;
+ private String user_email;
public Project Project { get; private set; }
@@ -52,6 +54,8 @@ namespace Tango.MachineStudio.UI.TFS
{
if (user != null)
{
+ user_email = user.Email;
+
Task.Factory.StartNew(async () =>
{
Thread.Sleep(5000);
@@ -72,9 +76,18 @@ namespace Tango.MachineStudio.UI.TFS
if (Project != null)
{
IStudioApplicationManager app = TangoIOC.Default.GetInstance<IStudioApplicationManager>();
- var items = await GetWorkItemsCreatedBy(Project, GetUserTeamMember());
- items.Where(x => x.StepsToReproduce != null).ToList().ForEach(x => x.StepsToReproduce = x.StepsToReproduce.Replace("<div style=\"white-space:pre;\">", "").Replace("</div>", ""));
- ResolvedWorkItems = items.Where(x => x.State == State.Resolved && x.ResolvedReason == ResolvedReason.Fixed && x.IsBuildVersionValid && x.FoundInBuildVersion < app.Version).ToObservableCollection();
+ var member = GetUserTeamMember();
+
+ if (member != null)
+ {
+ var items = await GetWorkItemsCreatedBy(Project, member);
+ items.Where(x => x.StepsToReproduce != null).ToList().ForEach(x => x.StepsToReproduce = x.StepsToReproduce.Replace("<div style=\"white-space:pre;\">", "").Replace("</div>", ""));
+ ResolvedWorkItems = items.Where(x => x.State == State.Resolved && x.ResolvedReason == ResolvedReason.Fixed && x.IsBuildVersionValid && x.FoundInBuildVersion < app.Version).ToObservableCollection();
+ }
+ else
+ {
+ LogManager.Default.Log($"User '{user_email}' is not part of the VSTS team.", LogCategory.Warning);
+ }
}
}
catch (Exception ex)
@@ -130,6 +143,12 @@ namespace Tango.MachineStudio.UI.TFS
item.Iteration = Project.Iterations.FirstOrDefault();
TeamMember currentUser = GetUserTeamMember();
+
+ if (currentUser == null)
+ {
+ throw LogManager.Default.Log(new AuthenticationException($"User '{user_email}' is not part of the Tango VSTS team. Please contact your administrator."));
+ }
+
item.CreatedBy = currentUser;
item.ChangedBy = currentUser;
item.AuthorizedAs = currentUser;
@@ -141,6 +160,12 @@ namespace Tango.MachineStudio.UI.TFS
item.Type = WorkItemType.Bug;
var bitmap = UIHelper.TakeSnapshot(MainWindow.Instance);
+
+ if (!_tempFolder.Exists())
+ {
+ _tempFolder = TemporaryManager.CreateFolder();
+ }
+
var tempFile = _tempFolder.CreateFile();
bitmap.SaveJpeg(tempFile.Path, 30);
@@ -207,7 +232,12 @@ namespace Tango.MachineStudio.UI.TFS
machineView.PanelColumnDefinition.Width = new GridLength(0);
machineView.stackHeader.Visibility = Visibility.Collapsed;
machineView.Background = System.Windows.Media.Brushes.White;
- machineView.DataContext = new MachineDesigner.ViewModels.MainViewVM() { SelectedMachine = machine, Configuration = machine.Configuration };
+
+
+ var machineDesignerVM = new MachineDesigner.ViewModels.MainViewVM();
+ machineDesignerVM.SetSelectedMachine(machine);
+ machineDesignerVM.Configuration = machine.Configuration;
+ machineView.DataContext = machineDesignerVM;
var configImageFile = _tempFolder.CreateImaginaryFile();
machineView.RenderToFile(configImageFile.Path, System.Drawing.Imaging.ImageFormat.Jpeg, new Size(machineView.Width, machineView.Height), 100);
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 4fb14ba47..1be69bf1c 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
@@ -445,6 +445,10 @@
<Project>{d0186ac0-0fcf-4d3b-9619-54812b6e524b}</Project>
<Name>Tango.MachineStudio.RML</Name>
</ProjectReference>
+ <ProjectReference Include="..\Modules\Tango.MachineStudio.Statistics\Tango.MachineStudio.Statistics.csproj">
+ <Project>{8a65ad6a-a9b4-48c0-9301-4b7434b712f8}</Project>
+ <Name>Tango.MachineStudio.Statistics</Name>
+ </ProjectReference>
<ProjectReference Include="..\Modules\Tango.MachineStudio.Stubs\Tango.MachineStudio.Stubs.csproj">
<Project>{22c2aa72-9493-4d0d-b421-8ef9789fb192}</Project>
<Name>Tango.MachineStudio.Stubs</Name>
@@ -591,7 +595,7 @@ copy /Y "$(SolutionDir)Referenced Assemblies\Microsoft.WITDataStore32.dll" "$(Ta
</Target>
<ProjectExtensions>
<VisualStudio>
- <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" />
+ <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" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs
index 10aa86ad1..8bb33d007 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs
@@ -7,6 +7,7 @@ using Tango.MachineStudio.Common.Authentication;
using Tango.MachineStudio.Common.Diagnostics;
using Tango.MachineStudio.Common.EventLogging;
using Tango.MachineStudio.Common.Html;
+using Tango.MachineStudio.Common.JobRunsLogging;
using Tango.MachineStudio.Common.Modules;
using Tango.MachineStudio.Common.Navigation;
using Tango.MachineStudio.Common.Notifications;
@@ -68,6 +69,7 @@ namespace Tango.MachineStudio.UI
TangoIOC.Default.Unregister<IHtmlPresenter>();
TangoIOC.Default.Unregister<ITeamFoundationServiceClient>();
TangoIOC.Default.Unregister<IDispatcherProvider>();
+ TangoIOC.Default.Unregister<IJobRunsLogger>();
TangoIOC.Default.Register<IDispatcherProvider, DefaultDispatcherProvider>(new DefaultDispatcherProvider(Application.Current.Dispatcher));
@@ -75,6 +77,7 @@ namespace Tango.MachineStudio.UI
TangoIOC.Default.Register<IAuthenticationProvider, DefaultAuthenticationProvider>();
TangoIOC.Default.Register<INavigationManager, DefaultNavigationManager>();
TangoIOC.Default.Register<IStudioModuleLoader, DefaultStudioModuleLoader>();
+ TangoIOC.Default.Register<IJobRunsLogger, DefaultJobRunsLogger>();
TangoIOC.Default.Register<IStudioApplicationManager, DefaultStudioApplicationManager>();
TangoIOC.Default.Register<ExternalBridgeScanner, ExternalBridgeScanner>();
TangoIOC.Default.Register<IVideoCaptureProvider, DefaultVideoCaptureProvider>();
@@ -83,6 +86,7 @@ namespace Tango.MachineStudio.UI
TangoIOC.Default.Register<ISpeechProvider, DefaultSpeechProvider>();
TangoIOC.Default.Register<IHtmlPresenter, DefaultHtmlPresenter>();
TangoIOC.Default.Register<TeamFoundationServiceExtendedClient>(new TeamFoundationServiceExtendedClient("https://twinetfs.visualstudio.com", String.Empty, "szzfokrceo4rhd4eqi5qpmxn3pa5iwl3q7tlqd36l2m7smz2ynoa"));
+
TangoIOC.Default.Register<MainViewVM>();
TangoIOC.Default.Register<LoadingViewVM>();
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 31e297cd1..70378a4d5 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
@@ -367,6 +367,7 @@ namespace Tango.MachineStudio.UI.ViewModels
Email = _authenticationProvider.CurrentUser.Email,
Password = _authenticationProvider.CurrentUser.Password,
Version = _applicationManager.Version.ToString(),
+ AcceptBetaRelease = _settings.AcceptBetaRelease,
});
IsUpdateAvailable = response.IsUpdateAvailable;
@@ -803,7 +804,17 @@ namespace Tango.MachineStudio.UI.ViewModels
private void ReportIssue()
{
- var bug = TFSClient.CreateBug();
+ Tango.TFS.WorkItem bug = null;
+
+ try
+ {
+ bug = TFSClient.CreateBug();
+ }
+ catch (Exception ex)
+ {
+ _notificationProvider.ShowError(ex.Message);
+ return;
+ }
_notificationProvider.ShowModalDialog<ReportIssueViewVM, ReportIssueView>(new ReportIssueViewVM(TFSClient.Project, bug), async (vm) =>
{
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
index 55f585626..a9624da2d 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
@@ -22,6 +22,8 @@ using Tango.MachineStudio.Common.StudioApplication;
using Tango.MachineStudio.Common.Update;
using Tango.SharedUI;
using Tango.MachineStudio.UI.Messages;
+using Tango.Settings;
+using Tango.MachineStudio.Common;
namespace Tango.MachineStudio.UI.ViewModels
{
@@ -181,6 +183,8 @@ namespace Tango.MachineStudio.UI.ViewModels
{
Status = UpdateStatus.CheckingForUpdate;
+ var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>();
+
ChannelFactory<IMachineStudioUpdateService> service = null;
Task.Factory.StartNew(() =>
@@ -197,6 +201,7 @@ namespace Tango.MachineStudio.UI.ViewModels
Email = _authentication.CurrentUser.Email,
Password = _authentication.CurrentUser.Password,
Version = _application.Version.ToString(),
+ AcceptBetaRelease = settings.AcceptBetaRelease,
});
if (response.IsUpdateAvailable)