diff options
| author | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
| commit | 00a491d93733d4625ad329b2ba8237f445364b3f (patch) | |
| tree | 4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS | |
| parent | 124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff) | |
| download | Tango-00a491d9.tar.gz Tango-00a491d9.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS')
2 files changed, 17 insertions, 61 deletions
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 b716ed1fb..31b330c3f 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs @@ -15,10 +15,8 @@ using Tango.Core.Helpers; using Tango.Core.IO; using Tango.Integration.Operation; using Tango.Logging; -using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Authentication; using Tango.MachineStudio.Common.StudioApplication; -using Tango.Settings; using Tango.SharedUI.Helpers; using Tango.TFS; @@ -161,7 +159,6 @@ namespace Tango.MachineStudio.UI.TFS item.Severity = Severity.Medium; item.State = State.New; item.Type = WorkItemType.Bug; - item.Environment = SettingsManager.Default.GetOrCreate<MachineStudioSettings>().DeploymentSlot.ToDescription(); foreach (var window in Application.Current.Windows.OfType<Window>().Where(x => !String.IsNullOrWhiteSpace(x.Title))) { @@ -188,22 +185,6 @@ namespace Tango.MachineStudio.UI.TFS return item; } - private string[] GetLogFiles(FileLogger logger) - { - string[] fileEntries = new string[1]; - fileEntries[0] = logger.LogFile; - string fileName = Path.GetFileNameWithoutExtension(logger.LogFile); - int indexPos = fileName.IndexOf(FileLogger.FILE_SET_EXTENSION); - if (indexPos > 0) - { - string extension = Path.GetExtension(logger.LogFile); - fileName = fileName.Substring(0, indexPos); - fileEntries = Directory.GetFiles(logger.Folder, $"{fileName}*{extension}").Where(x => Path.GetFileName(x).StartsWith(logger.Tag)).OrderBy(x => x.Length).ThenBy(x => x).ToArray(); - } - - return fileEntries; - } - public void FinalizeBug(WorkItem item) { IAuthenticationProvider auth = TangoIOC.Default.GetInstance<IAuthenticationProvider>(); @@ -211,55 +192,31 @@ namespace Tango.MachineStudio.UI.TFS FileLogger appFileLogger = LogManager.Default.RegisteredLoggers.FirstOrDefault(x => x.GetType() == typeof(FileLogger)) as FileLogger; FileLogger embeddedFileLogger = MachineOperator.EmbeddedLogManager.RegisteredLoggers.FirstOrDefault(x => x.GetType() == typeof(FileLogger)) as FileLogger; - + if (appFileLogger != null) { - string[] logFiles = GetLogFiles(appFileLogger); - foreach( string file in logFiles) - { - var appLogFile = _tempFolder.CreateImaginaryFile(); - File.Copy(file, appLogFile.Path); - item.Attachments.Add(new Attachment() - { - Description = "Application Log File", - FilePath = appLogFile.Path, - Name = Path.GetFileName(file), - }); - } - } + var appLogFile = _tempFolder.CreateImaginaryFile(); + File.Copy(appFileLogger.LogFile, appLogFile.Path); - if (embeddedFileLogger != null && File.Exists(embeddedFileLogger.LogFile)) - { - string[] logFiles = GetLogFiles(embeddedFileLogger); - foreach (string file in logFiles) + item.Attachments.Add(new Attachment() { - var embeddedLogFile = _tempFolder.CreateImaginaryFile(); - File.Copy(file, embeddedLogFile.Path); - item.Attachments.Add(new Attachment() - { - Description = "Embedded Log File", - FilePath = embeddedLogFile.Path, - Name = Path.GetFileName(file), - }); - } + Description = "Application Log File", + FilePath = appLogFile.Path, + Name = Path.GetFileName(appFileLogger.LogFile), + }); } - //Add session log file.. - if (MachineOperator.EnableSessionLogFile) + if (embeddedFileLogger != null && File.Exists(embeddedFileLogger.LogFile)) { - var file = MachineOperator.SessionLogger.LogFile; + var embeddedLogFile = _tempFolder.CreateImaginaryFile(); + File.Copy(embeddedFileLogger.LogFile, embeddedLogFile.Path); - if (file != null && File.Exists(file)) + item.Attachments.Add(new Attachment() { - var sessionLogFile = _tempFolder.CreateImaginaryFile(); - File.Copy(file, sessionLogFile.Path); - item.Attachments.Add(new Attachment() - { - Description = "Session Log File", - FilePath = sessionLogFile.Path, - Name = Path.GetFileName(file), - }); - } + Description = "Embedded Log File", + FilePath = embeddedLogFile.Path, + Name = Path.GetFileName(embeddedFileLogger.LogFile), + }); } SystemInformationModel sysModel = new SystemInformationModel(); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamMembersProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamMembersProvider.cs index 464599452..0691ca6bd 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamMembersProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamMembersProvider.cs @@ -13,8 +13,7 @@ namespace Tango.MachineStudio.UI.TFS { public IEnumerable GetSuggestions(string filter) { - var members = TangoIOC.Default.GetInstance<TeamFoundationServiceExtendedClient>().Project.Members; - return members.Where(x => x.AssignName.ToLower().Contains(filter.ToLower())); + return TangoIOC.Default.GetInstance<TeamFoundationServiceExtendedClient>().Project.Members.Where(x => x.AssignName.ToLower().Contains(filter.ToLower())); } } } |
