diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-01-16 15:13:55 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-01-16 15:13:55 +0200 |
| commit | 92c52918e13dbbaf2a658945c349a6d04c29aa81 (patch) | |
| tree | 82967e8201bcf009c8a51ea2284a759fae3fd69b /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs | |
| parent | e87626ffc0298426d8242c2453a6992d94f38e1f (diff) | |
| download | Tango-92c52918e13dbbaf2a658945c349a6d04c29aa81.tar.gz Tango-92c52918e13dbbaf2a658945c349a6d04c29aa81.zip | |
Added custom image support for bug reporting.
Fixed issue with dispensers filter search.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs | 31 |
1 files changed, 18 insertions, 13 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 addd2f4fb..df831afb9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs @@ -159,22 +159,27 @@ namespace Tango.MachineStudio.UI.TFS item.State = State.New; item.Type = WorkItemType.Bug; - var bitmap = UIHelper.TakeSnapshot(MainWindow.Instance); - - if (!_tempFolder.Exists()) + foreach (var window in Application.Current.Windows.OfType<Window>().Where(x => !String.IsNullOrWhiteSpace(x.Title))) { - _tempFolder = TemporaryManager.CreateFolder(); - } + var bitmap = UIHelper.TakeSnapshot(window); - var tempFile = _tempFolder.CreateFile(); - bitmap.SaveJpeg(tempFile.Path, 30); + if (!_tempFolder.Exists()) + { + _tempFolder = TemporaryManager.CreateFolder(); + } - item.Attachments.Add(new Attachment() - { - Description = "Screen Capture", - FilePath = tempFile.Path, - Name = "Screen Capture.jpg", - }); + var tempFile = _tempFolder.CreateFile(); + bitmap.SaveJpeg(tempFile.Path, 30); + + String title = window.Title; + + item.Attachments.Add(new Attachment() + { + Description = title + " Screen Capture", + FilePath = tempFile.Path, + Name = $"{title}.jpg", + }); + } return item; } |
