From a9b3a221ab01cef1f4aea85e6eb7b4384cfc0f84 Mon Sep 17 00:00:00 2001 From: Robin Date: Wed, 5 Dec 2018 13:22:20 +0100 Subject: [PATCH] Updated Dapplo.Windows and Dapplo.CaliburnMicro, this commit fixes the breaking changes. --- .../Greenshot.Addon.Box.csproj | 6 +- .../Greenshot.Addon.Confluence.csproj | 6 +- .../Greenshot.Addon.Dropbox.csproj | 6 +- .../Greenshot.Addon.ExternalCommand.csproj | 6 +- .../Greenshot.Addon.Flickr.csproj | 6 +- .../Greenshot.Addon.GooglePhotos.csproj | 6 +- .../Greenshot.Addon.Imgur.csproj | 6 +- .../AccessibleHelper.cs | 97 ++++++++++--------- .../Greenshot.Addon.InternetExplorer.csproj | 4 +- .../Greenshot.Addon.Jira.csproj | 6 +- .../Controls/Pipette.cs | 1 - .../Drawing/DrawableContainerList.cs | 2 - .../Drawing/HighlightContainer.cs | 8 +- .../Drawing/TextContainer.cs | 1 - .../Forms/ImageEditorForm.cs | 2 +- .../Greenshot.Addon.LegacyEditor.csproj | 8 +- .../Greenshot.Addon.Lutim.csproj | 6 +- .../Greenshot.Addon.OCR.csproj | 6 +- src/Greenshot.Addon.OcrCommand/Program.cs | 1 - .../Greenshot.Addon.Office.csproj | 6 +- .../OfficeExport/ExcelExporter.cs | 1 - .../OfficeExport/PowerpointExporter.cs | 1 - .../Greenshot.Addon.OneDrive.csproj | 6 +- .../Greenshot.Addon.Photobucket.csproj | 6 +- .../Greenshot.Addon.Tfs.csproj | 6 +- src/Greenshot.Addon.Tfs/TfsClient.cs | 1 - .../Greenshot.Addon.Win10.csproj | 6 +- .../Controls/BackgroundForm.cs | 1 - .../Controls/GreenshotForm.cs | 1 - .../Controls/PleaseWaitForm.cs | 1 - .../Controls/ThumbnailForm.cs | 9 +- .../Core/AbstractDestination.cs | 3 +- src/Greenshot.Addons/Core/Capture.cs | 5 +- .../Core/ICoreConfiguration.cs | 1 - src/Greenshot.Addons/Core/WindowCapture.cs | 49 ++-------- src/Greenshot.Addons/Greenshot.Addons.csproj | 10 +- .../InteropWindowCaptureExtensions.cs | 7 +- src/Greenshot.Core/Greenshot.Core.csproj | 2 +- src/Greenshot.Core/Sources/ScreenSource.cs | 7 +- src/Greenshot.Gfx/Greenshot.Gfx.csproj | 2 +- .../CapturePerformance.cs | 29 ++++++ src/Greenshot.PerformanceTests/Program.cs | 3 +- src/Greenshot.Tests/Greenshot.Tests.csproj | 2 +- .../Configuration/IMetroConfiguration.cs | 1 - .../Impl/MetroConfigurationImpl.cs | 2 +- src/Greenshot/Forms/CaptureForm.cs | 3 +- src/Greenshot/Forms/LanguageDialog.cs | 2 - src/Greenshot/Forms/MainForm.cs | 20 ++-- src/Greenshot/Greenshot.csproj | 16 +-- src/Greenshot/Help/HelpFileLoader.cs | 1 - src/Greenshot/Helpers/CaptureHelper.cs | 10 +- src/Greenshot/Startup.cs | 3 - .../ViewModels/UiConfigViewModel.cs | 2 +- .../ViewModels/UpdateNotificationViewModel.cs | 1 - 54 files changed, 203 insertions(+), 207 deletions(-) create mode 100644 src/Greenshot.PerformanceTests/CapturePerformance.cs diff --git a/src/Greenshot.Addon.Box/Greenshot.Addon.Box.csproj b/src/Greenshot.Addon.Box/Greenshot.Addon.Box.csproj index feaaebdb0..fac915c25 100644 --- a/src/Greenshot.Addon.Box/Greenshot.Addon.Box.csproj +++ b/src/Greenshot.Addon.Box/Greenshot.Addon.Box.csproj @@ -44,12 +44,12 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.Confluence/Greenshot.Addon.Confluence.csproj b/src/Greenshot.Addon.Confluence/Greenshot.Addon.Confluence.csproj index 18ab0ddff..7d6900899 100644 --- a/src/Greenshot.Addon.Confluence/Greenshot.Addon.Confluence.csproj +++ b/src/Greenshot.Addon.Confluence/Greenshot.Addon.Confluence.csproj @@ -51,11 +51,11 @@ - - + + - + all diff --git a/src/Greenshot.Addon.Dropbox/Greenshot.Addon.Dropbox.csproj b/src/Greenshot.Addon.Dropbox/Greenshot.Addon.Dropbox.csproj index 22977b908..a555afc4d 100644 --- a/src/Greenshot.Addon.Dropbox/Greenshot.Addon.Dropbox.csproj +++ b/src/Greenshot.Addon.Dropbox/Greenshot.Addon.Dropbox.csproj @@ -46,12 +46,12 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.ExternalCommand/Greenshot.Addon.ExternalCommand.csproj b/src/Greenshot.Addon.ExternalCommand/Greenshot.Addon.ExternalCommand.csproj index c52ae3984..ba7ede4c4 100644 --- a/src/Greenshot.Addon.ExternalCommand/Greenshot.Addon.ExternalCommand.csproj +++ b/src/Greenshot.Addon.ExternalCommand/Greenshot.Addon.ExternalCommand.csproj @@ -38,9 +38,9 @@ - - - + + + all diff --git a/src/Greenshot.Addon.Flickr/Greenshot.Addon.Flickr.csproj b/src/Greenshot.Addon.Flickr/Greenshot.Addon.Flickr.csproj index bb922823c..e21ca96ba 100644 --- a/src/Greenshot.Addon.Flickr/Greenshot.Addon.Flickr.csproj +++ b/src/Greenshot.Addon.Flickr/Greenshot.Addon.Flickr.csproj @@ -46,10 +46,10 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.GooglePhotos/Greenshot.Addon.GooglePhotos.csproj b/src/Greenshot.Addon.GooglePhotos/Greenshot.Addon.GooglePhotos.csproj index 7072996bd..22ee69d8a 100644 --- a/src/Greenshot.Addon.GooglePhotos/Greenshot.Addon.GooglePhotos.csproj +++ b/src/Greenshot.Addon.GooglePhotos/Greenshot.Addon.GooglePhotos.csproj @@ -46,10 +46,10 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.Imgur/Greenshot.Addon.Imgur.csproj b/src/Greenshot.Addon.Imgur/Greenshot.Addon.Imgur.csproj index 8d922e760..559d8f2cf 100644 --- a/src/Greenshot.Addon.Imgur/Greenshot.Addon.Imgur.csproj +++ b/src/Greenshot.Addon.Imgur/Greenshot.Addon.Imgur.csproj @@ -46,11 +46,11 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.InternetExplorer/AccessibleHelper.cs b/src/Greenshot.Addon.InternetExplorer/AccessibleHelper.cs index 3cafdd2c2..daf628e68 100644 --- a/src/Greenshot.Addon.InternetExplorer/AccessibleHelper.cs +++ b/src/Greenshot.Addon.InternetExplorer/AccessibleHelper.cs @@ -62,8 +62,7 @@ namespace Greenshot.Addon.InternetExplorer { get { - int num; - var res = GetAccessibleChildren(accessible, out num); + var res = GetAccessibleChildren(accessible, out _); if (res == null) { return new Accessible[0]; @@ -72,26 +71,20 @@ namespace Greenshot.Addon.InternetExplorer var list = new List(res.Length); foreach (var obj in res) { - if (obj is IAccessible accessible) + if (obj is IAccessible localAccessible) { - list.Add(new Accessible(accessible)); + list.Add(new Accessible(localAccessible)); } } return list.ToArray(); } } - private string Name - { - get { return accessible.get_accName(CHILDID_SELF); } - } + private string Name => accessible.get_accName(CHILDID_SELF); - private int ChildCount - { - get { return accessible.accChildCount; } - } + private int ChildCount => accessible.accChildCount; - /// + /// /// Returns the URL for the active tab /// public string IEActiveTabUrl @@ -106,19 +99,23 @@ namespace Greenshot.Addon.InternetExplorer { var tabIndex = tab.accessible.get_accState(CHILDID_SELF); - if ((int) tabIndex == IE_ACTIVE_TAB) - { - var description = tab.accessible.get_accDescription(CHILDID_SELF); + if ((int) tabIndex != IE_ACTIVE_TAB) + { + continue; + } - if (!string.IsNullOrEmpty(description)) - { - if (description.Contains(Environment.NewLine)) - { - var url = description.Substring(description.IndexOf(Environment.NewLine)).Trim(); - return url; - } - } - } + var description = tab.accessible.get_accDescription(CHILDID_SELF); + + if (string.IsNullOrEmpty(description)) + { + continue; + } + + if (description.Contains(Environment.NewLine)) + { + var url = description.Substring(description.IndexOf(Environment.NewLine)).Trim(); + return url; + } } } } @@ -225,14 +222,18 @@ namespace Greenshot.Addon.InternetExplorer { var tabIndex = tab.accessible.get_accState(CHILDID_SELF); var description = tab.accessible.get_accDescription(CHILDID_SELF); - if (!string.IsNullOrEmpty(description)) - { - if (description.Contains(Environment.NewLine)) - { - var url = description.Substring(description.IndexOf(Environment.NewLine)).Trim(); - yield return url; - } - } + if (string.IsNullOrEmpty(description)) + { + continue; + } + + if (!description.Contains(Environment.NewLine)) + { + continue; + } + + var url = description.Substring(description.IndexOf(Environment.NewLine)).Trim(); + yield return url; } } } @@ -272,11 +273,13 @@ namespace Greenshot.Addon.InternetExplorer { foreach (var tab in child.Children) { - if (tab.Name == tabCaptionToActivate) - { - tab.Activate(); - return; - } + if (tab.Name != tabCaptionToActivate) + { + continue; + } + + tab.Activate(); + return; } } } @@ -294,14 +297,16 @@ namespace Greenshot.Addon.InternetExplorer { foreach (var tab in child.Children) { - if (tab.Name == tabCaptionToClose) - { - foreach (var CloseTab in tab.Children) - { - CloseTab.Activate(); - } - return; - } + if (tab.Name != tabCaptionToClose) + { + continue; + } + + foreach (var CloseTab in tab.Children) + { + CloseTab.Activate(); + } + return; } } } diff --git a/src/Greenshot.Addon.InternetExplorer/Greenshot.Addon.InternetExplorer.csproj b/src/Greenshot.Addon.InternetExplorer/Greenshot.Addon.InternetExplorer.csproj index c60c67ec7..5ac50dae8 100644 --- a/src/Greenshot.Addon.InternetExplorer/Greenshot.Addon.InternetExplorer.csproj +++ b/src/Greenshot.Addon.InternetExplorer/Greenshot.Addon.InternetExplorer.csproj @@ -30,10 +30,10 @@ - 0.7.26 + 0.8.3 - 0.7.26 + 0.8.3 diff --git a/src/Greenshot.Addon.Jira/Greenshot.Addon.Jira.csproj b/src/Greenshot.Addon.Jira/Greenshot.Addon.Jira.csproj index ca2761752..b0991a4d7 100644 --- a/src/Greenshot.Addon.Jira/Greenshot.Addon.Jira.csproj +++ b/src/Greenshot.Addon.Jira/Greenshot.Addon.Jira.csproj @@ -48,12 +48,12 @@ - - + + - + all diff --git a/src/Greenshot.Addon.LegacyEditor/Controls/Pipette.cs b/src/Greenshot.Addon.LegacyEditor/Controls/Pipette.cs index 48431bfe0..81b149ba5 100644 --- a/src/Greenshot.Addon.LegacyEditor/Controls/Pipette.cs +++ b/src/Greenshot.Addon.LegacyEditor/Controls/Pipette.cs @@ -24,7 +24,6 @@ #region Usings using System; -using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using Dapplo.Windows.Common.Structs; diff --git a/src/Greenshot.Addon.LegacyEditor/Drawing/DrawableContainerList.cs b/src/Greenshot.Addon.LegacyEditor/Drawing/DrawableContainerList.cs index 2a8b14150..0faa944b7 100644 --- a/src/Greenshot.Addon.LegacyEditor/Drawing/DrawableContainerList.cs +++ b/src/Greenshot.Addon.LegacyEditor/Drawing/DrawableContainerList.cs @@ -21,7 +21,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Linq; @@ -29,7 +28,6 @@ using System.Threading; using System.Windows.Forms; using Dapplo.Windows.Common.Extensions; using Dapplo.Windows.Common.Structs; -using Greenshot.Addon.LegacyEditor.Forms; using Greenshot.Addon.LegacyEditor.Memento; using Greenshot.Addons.Core; using Greenshot.Addons.Interfaces; diff --git a/src/Greenshot.Addon.LegacyEditor/Drawing/HighlightContainer.cs b/src/Greenshot.Addon.LegacyEditor/Drawing/HighlightContainer.cs index 8a5ce651a..9d0d5d1aa 100644 --- a/src/Greenshot.Addon.LegacyEditor/Drawing/HighlightContainer.cs +++ b/src/Greenshot.Addon.LegacyEditor/Drawing/HighlightContainer.cs @@ -101,9 +101,11 @@ namespace Greenshot.Addon.LegacyEditor.Drawing Add(blurFilter); break; case PreparedFilter.GRAYSCALE: - AbstractFilter f = new GrayscaleFilter(this); - f.Invert = true; - Add(f); + AbstractFilter f = new GrayscaleFilter(this) + { + Invert = true + }; + Add(f); break; case PreparedFilter.MAGNIFICATION: Add(new MagnifierFilter(this)); diff --git a/src/Greenshot.Addon.LegacyEditor/Drawing/TextContainer.cs b/src/Greenshot.Addon.LegacyEditor/Drawing/TextContainer.cs index 6b494f4c5..3de2d3a05 100644 --- a/src/Greenshot.Addon.LegacyEditor/Drawing/TextContainer.cs +++ b/src/Greenshot.Addon.LegacyEditor/Drawing/TextContainer.cs @@ -21,7 +21,6 @@ using System; using System.ComponentModel; -using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Text; diff --git a/src/Greenshot.Addon.LegacyEditor/Forms/ImageEditorForm.cs b/src/Greenshot.Addon.LegacyEditor/Forms/ImageEditorForm.cs index 2ccde638a..2afcd4dde 100644 --- a/src/Greenshot.Addon.LegacyEditor/Forms/ImageEditorForm.cs +++ b/src/Greenshot.Addon.LegacyEditor/Forms/ImageEditorForm.cs @@ -123,7 +123,7 @@ namespace Greenshot.Addon.LegacyEditor.Forms // Make sure the editor is placed on the same location as the last editor was on close // But only if this still exists, else it will be reset (BUG-1812) var editorWindowPlacement = _editorConfiguration.GetEditorPlacement(); - var screenbounds = WindowCapture.GetScreenBounds(); + var screenbounds = DisplayInfo.ScreenBounds; if (!screenbounds.Contains(editorWindowPlacement.NormalPosition)) { _editorConfiguration.ResetEditorPlacement(); diff --git a/src/Greenshot.Addon.LegacyEditor/Greenshot.Addon.LegacyEditor.csproj b/src/Greenshot.Addon.LegacyEditor/Greenshot.Addon.LegacyEditor.csproj index 92d4646da..c5df09816 100644 --- a/src/Greenshot.Addon.LegacyEditor/Greenshot.Addon.LegacyEditor.csproj +++ b/src/Greenshot.Addon.LegacyEditor/Greenshot.Addon.LegacyEditor.csproj @@ -133,11 +133,11 @@ - - + + - - + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.Lutim/Greenshot.Addon.Lutim.csproj b/src/Greenshot.Addon.Lutim/Greenshot.Addon.Lutim.csproj index 3b46c3669..df30e7f82 100644 --- a/src/Greenshot.Addon.Lutim/Greenshot.Addon.Lutim.csproj +++ b/src/Greenshot.Addon.Lutim/Greenshot.Addon.Lutim.csproj @@ -46,11 +46,11 @@ - - + + - + all diff --git a/src/Greenshot.Addon.OCR/Greenshot.Addon.OCR.csproj b/src/Greenshot.Addon.OCR/Greenshot.Addon.OCR.csproj index a2c97f38c..6fee555fb 100644 --- a/src/Greenshot.Addon.OCR/Greenshot.Addon.OCR.csproj +++ b/src/Greenshot.Addon.OCR/Greenshot.Addon.OCR.csproj @@ -38,9 +38,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.OcrCommand/Program.cs b/src/Greenshot.Addon.OcrCommand/Program.cs index 841c0ce20..14e0b88e7 100644 --- a/src/Greenshot.Addon.OcrCommand/Program.cs +++ b/src/Greenshot.Addon.OcrCommand/Program.cs @@ -25,7 +25,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using Greenshot.Addon.OcrCommand.Modi; diff --git a/src/Greenshot.Addon.Office/Greenshot.Addon.Office.csproj b/src/Greenshot.Addon.Office/Greenshot.Addon.Office.csproj index c40f064cf..cd9cd36ec 100644 --- a/src/Greenshot.Addon.Office/Greenshot.Addon.Office.csproj +++ b/src/Greenshot.Addon.Office/Greenshot.Addon.Office.csproj @@ -45,9 +45,9 @@ - - - + + + diff --git a/src/Greenshot.Addon.Office/OfficeExport/ExcelExporter.cs b/src/Greenshot.Addon.Office/OfficeExport/ExcelExporter.cs index 9d976e5ee..15798b2e2 100644 --- a/src/Greenshot.Addon.Office/OfficeExport/ExcelExporter.cs +++ b/src/Greenshot.Addon.Office/OfficeExport/ExcelExporter.cs @@ -26,7 +26,6 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Runtime.InteropServices; using Dapplo.Log; using Dapplo.Windows.Com; using Dapplo.Windows.Desktop; diff --git a/src/Greenshot.Addon.Office/OfficeExport/PowerpointExporter.cs b/src/Greenshot.Addon.Office/OfficeExport/PowerpointExporter.cs index 0ef7ff3f5..84afa8a34 100644 --- a/src/Greenshot.Addon.Office/OfficeExport/PowerpointExporter.cs +++ b/src/Greenshot.Addon.Office/OfficeExport/PowerpointExporter.cs @@ -26,7 +26,6 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Runtime.InteropServices; using Dapplo.Log; using Dapplo.Windows.Com; using Greenshot.Addon.Office.Configuration; diff --git a/src/Greenshot.Addon.OneDrive/Greenshot.Addon.OneDrive.csproj b/src/Greenshot.Addon.OneDrive/Greenshot.Addon.OneDrive.csproj index 753945a78..adaa0e106 100644 --- a/src/Greenshot.Addon.OneDrive/Greenshot.Addon.OneDrive.csproj +++ b/src/Greenshot.Addon.OneDrive/Greenshot.Addon.OneDrive.csproj @@ -46,11 +46,11 @@ - - + + - + all diff --git a/src/Greenshot.Addon.Photobucket/Greenshot.Addon.Photobucket.csproj b/src/Greenshot.Addon.Photobucket/Greenshot.Addon.Photobucket.csproj index 1b5242fc7..23aab302f 100644 --- a/src/Greenshot.Addon.Photobucket/Greenshot.Addon.Photobucket.csproj +++ b/src/Greenshot.Addon.Photobucket/Greenshot.Addon.Photobucket.csproj @@ -46,10 +46,10 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot.Addon.Tfs/Greenshot.Addon.Tfs.csproj b/src/Greenshot.Addon.Tfs/Greenshot.Addon.Tfs.csproj index ddfa88c55..b8bbbb8c3 100644 --- a/src/Greenshot.Addon.Tfs/Greenshot.Addon.Tfs.csproj +++ b/src/Greenshot.Addon.Tfs/Greenshot.Addon.Tfs.csproj @@ -46,11 +46,11 @@ - - + + - + all diff --git a/src/Greenshot.Addon.Tfs/TfsClient.cs b/src/Greenshot.Addon.Tfs/TfsClient.cs index 9554d46b1..97df1dd16 100644 --- a/src/Greenshot.Addon.Tfs/TfsClient.cs +++ b/src/Greenshot.Addon.Tfs/TfsClient.cs @@ -28,7 +28,6 @@ using System.Linq; using System.Net.Http; using System.Threading.Tasks; using Dapplo.HttpExtensions; -using Dapplo.HttpExtensions.ContentConverter; using Dapplo.HttpExtensions.Factory; using Dapplo.HttpExtensions.JsonNet; using Greenshot.Addon.Tfs.Entities; diff --git a/src/Greenshot.Addon.Win10/Greenshot.Addon.Win10.csproj b/src/Greenshot.Addon.Win10/Greenshot.Addon.Win10.csproj index 36e68b158..e184bc5f1 100644 --- a/src/Greenshot.Addon.Win10/Greenshot.Addon.Win10.csproj +++ b/src/Greenshot.Addon.Win10/Greenshot.Addon.Win10.csproj @@ -57,8 +57,8 @@ - - - + + + \ No newline at end of file diff --git a/src/Greenshot.Addons/Controls/BackgroundForm.cs b/src/Greenshot.Addons/Controls/BackgroundForm.cs index e9958a493..78136800a 100644 --- a/src/Greenshot.Addons/Controls/BackgroundForm.cs +++ b/src/Greenshot.Addons/Controls/BackgroundForm.cs @@ -27,7 +27,6 @@ using System; using System.Drawing; using System.Threading; using System.Windows.Forms; -using Greenshot.Addons.Core; using Greenshot.Addons.Resources; #endregion diff --git a/src/Greenshot.Addons/Controls/GreenshotForm.cs b/src/Greenshot.Addons/Controls/GreenshotForm.cs index b7885413f..bbd51375f 100644 --- a/src/Greenshot.Addons/Controls/GreenshotForm.cs +++ b/src/Greenshot.Addons/Controls/GreenshotForm.cs @@ -37,7 +37,6 @@ using Dapplo.Utils; using Dapplo.Windows.Desktop; using Dapplo.Windows.Dpi; using Dapplo.Windows.Dpi.Forms; -using Greenshot.Addons.Core; using Greenshot.Addons.Resources; using Greenshot.Gfx; diff --git a/src/Greenshot.Addons/Controls/PleaseWaitForm.cs b/src/Greenshot.Addons/Controls/PleaseWaitForm.cs index 04d74c3c7..f4227ad0a 100644 --- a/src/Greenshot.Addons/Controls/PleaseWaitForm.cs +++ b/src/Greenshot.Addons/Controls/PleaseWaitForm.cs @@ -28,7 +28,6 @@ using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using Dapplo.Log; -using Greenshot.Addons.Core; using Greenshot.Addons.Resources; #endregion diff --git a/src/Greenshot.Addons/Controls/ThumbnailForm.cs b/src/Greenshot.Addons/Controls/ThumbnailForm.cs index 5b1b490b1..5ccc63869 100644 --- a/src/Greenshot.Addons/Controls/ThumbnailForm.cs +++ b/src/Greenshot.Addons/Controls/ThumbnailForm.cs @@ -53,6 +53,9 @@ namespace Greenshot.Addons.Controls private IntPtr _thumbnailHandle = IntPtr.Zero; + /// + /// Constructor for the Thumbnail form + /// public ThumbnailForm() { ShowInTaskbar = false; @@ -139,9 +142,13 @@ namespace Greenshot.Addons.Controls } } + /// + /// Aligns the thumbnail form to the specified control + /// + /// public void AlignToControl(Control alignTo) { - var screenBounds = WindowCapture.GetScreenBounds(); + var screenBounds = DisplayInfo.ScreenBounds; if (screenBounds.Contains(alignTo.Left, alignTo.Top - Height)) { Location = new Point(alignTo.Left + alignTo.Width / 2 - Width / 2, alignTo.Top - Height); diff --git a/src/Greenshot.Addons/Core/AbstractDestination.cs b/src/Greenshot.Addons/Core/AbstractDestination.cs index 5b44ef420..476477bfb 100644 --- a/src/Greenshot.Addons/Core/AbstractDestination.cs +++ b/src/Greenshot.Addons/Core/AbstractDestination.cs @@ -37,6 +37,7 @@ using Dapplo.Windows.Common.Structs; using Dapplo.Windows.Dpi; using Dapplo.Windows.Dpi.Forms; using Dapplo.Windows.Extensions; +using Dapplo.Windows.User32; using Greenshot.Addons.Components; using Greenshot.Addons.Extensions; using Greenshot.Addons.Interfaces; @@ -422,7 +423,7 @@ namespace Greenshot.Addons.Core { // find a suitable location var location = Cursor.Position; - var menuRectangle = new NativeRect(location, menu.Size).Intersect(WindowCapture.GetScreenBounds()); + var menuRectangle = new NativeRect(location, menu.Size).Intersect(DisplayInfo.ScreenBounds); if (menuRectangle.Height < menu.Height) { location.Offset(-40, -(menuRectangle.Height - menu.Height)); diff --git a/src/Greenshot.Addons/Core/Capture.cs b/src/Greenshot.Addons/Core/Capture.cs index 092ebc1ed..3c173f318 100644 --- a/src/Greenshot.Addons/Core/Capture.cs +++ b/src/Greenshot.Addons/Core/Capture.cs @@ -29,6 +29,7 @@ using System.Drawing.Imaging; using Dapplo.Log; using Dapplo.Windows.Common.Extensions; using Dapplo.Windows.Common.Structs; +using Dapplo.Windows.User32; using Greenshot.Addons.Interfaces; using Greenshot.Gfx; @@ -59,7 +60,7 @@ namespace Greenshot.Addons.Core /// public Capture() { - _screenBounds = WindowCapture.GetScreenBounds(); + _screenBounds = DisplayInfo.ScreenBounds; _captureDetails = new CaptureDetails(); } @@ -82,7 +83,7 @@ namespace Greenshot.Addons.Core { if (_screenBounds == NativeRect.Empty) { - _screenBounds = WindowCapture.GetScreenBounds(); + _screenBounds = DisplayInfo.ScreenBounds; } return _screenBounds; } diff --git a/src/Greenshot.Addons/Core/ICoreConfiguration.cs b/src/Greenshot.Addons/Core/ICoreConfiguration.cs index f866ec414..febdc5f7e 100644 --- a/src/Greenshot.Addons/Core/ICoreConfiguration.cs +++ b/src/Greenshot.Addons/Core/ICoreConfiguration.cs @@ -26,7 +26,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Drawing; using Dapplo.CaliburnMicro.Configuration; using Dapplo.Config.Attributes; using Dapplo.Config.Ini; diff --git a/src/Greenshot.Addons/Core/WindowCapture.cs b/src/Greenshot.Addons/Core/WindowCapture.cs index fc009b81d..06e65e3a1 100644 --- a/src/Greenshot.Addons/Core/WindowCapture.cs +++ b/src/Greenshot.Addons/Core/WindowCapture.cs @@ -59,34 +59,6 @@ namespace Greenshot.Addons.Core // TODO: Solve, was static reference! private static readonly ICoreConfiguration Configuration = new CoreConfigurationImpl(); - /// - /// Used to cleanup the unmanged resource in the iconInfo for the CaptureCursor method - /// - /// - /// - [DllImport("gdi32", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool DeleteObject(IntPtr hObject); - - /// - /// Get the bounds of all screens combined. - /// - /// A NativeRect of the bounds of the entire display area. - public static NativeRect GetScreenBounds() - { - int left = 0, top = 0, bottom = 0, right = 0; - foreach (var screen in Screen.AllScreens) - { - left = Math.Min(left, screen.Bounds.X); - top = Math.Min(top, screen.Bounds.Y); - var screenAbsRight = screen.Bounds.X + screen.Bounds.Width; - var screenAbsBottom = screen.Bounds.Y + screen.Bounds.Height; - right = Math.Max(right, screenAbsRight); - bottom = Math.Max(bottom, screenAbsBottom); - } - return new NativeRect(left, top, right, bottom); - } - /// /// Retrieves the cursor location safely, accounting for DPI settings in Vista/Windows 7. This implementation /// can conveniently be used when the cursor location is needed to deal with a fullscreen bitmap. @@ -102,14 +74,14 @@ namespace Greenshot.Addons.Core /// /// Converts locationRelativeToScreenOrigin to be relative to top left corner of all screen bounds, which might - /// be different in multiscreen setups. This implementation + /// be different in multi screen setups. This implementation /// can conveniently be used when the cursor location is needed to deal with a fullscreen bitmap. /// /// NativePoint /// NativePoint public static NativePoint GetLocationRelativeToScreenBounds(NativePoint locationRelativeToScreenOrigin) { - var bounds = GetScreenBounds(); + var bounds = DisplayInfo.ScreenBounds; return locationRelativeToScreenOrigin.Offset(-bounds.X, -bounds.Y); } @@ -144,7 +116,7 @@ namespace Greenshot.Addons.Core using (iconInfo.ColorBitmapHandle) { var cursorLocation = User32Api.GetCursorLocation(); - // Allign cursor location to Bitmap coordinates (instead of Screen coordinates) + // Align cursor location to Bitmap coordinates (instead of Screen coordinates) var x = cursorLocation.X - iconInfo.Hotspot.X - capture.ScreenBounds.X; var y = cursorLocation.Y - iconInfo.Hotspot.Y - capture.ScreenBounds.Y; // Set the location @@ -160,10 +132,10 @@ namespace Greenshot.Addons.Core } /// - /// This method will call the CaptureRectangle with the screenbounds, therefor Capturing the whole screen. + /// This method will call the CaptureRectangle with the screen bounds, therefor Capturing the whole screen. /// /// A Capture Object with the Screen as an Image - public static ICapture CaptureScreen(ICapture capture) + public static ICapture CaptureScreen(ICapture capture = null) { if (capture == null) { @@ -350,7 +322,7 @@ namespace Greenshot.Addons.Core // throw exception throw exceptionToThrow; } - // Create BITMAPINFOHEADER for CreateDIBSection + // Create BitmapInfoHeader for CreateDIBSection var bmi = BitmapInfoHeader.Create(captureBounds.Width, captureBounds.Height, 24); // TODO: Enable when the function is available again @@ -358,9 +330,8 @@ namespace Greenshot.Addons.Core Win32.SetLastError(0); // create a bitmap we can copy it to, using GetDeviceCaps to get the width/height - IntPtr bits0; // not used for our purposes. It returns a pointer to the raw bits that make up the bitmap. - // TODO: Change the usage to an enum? - using (var safeDibSectionHandle = Gdi32Api.CreateDIBSection(desktopDcHandle, ref bmi, 0, out bits0, IntPtr.Zero, 0)) + // the returned (out) IntPtr _ is not used for our purposes. It returns a pointer to the raw bits that make up the bitmap. + using (var safeDibSectionHandle = Gdi32Api.CreateDIBSection(desktopDcHandle, ref bmi, DibColors.PalColors, out _, IntPtr.Zero, 0)) { if (safeDibSectionHandle.IsInvalid) { @@ -375,7 +346,7 @@ namespace Greenshot.Addons.Core // select the bitmap object and store the old handle using (safeCompatibleDcHandle.SelectObject(safeDibSectionHandle)) { - // bitblt over (make copy) + // bit-blt over (make copy) // ReSharper disable once BitwiseOperatorOnEnumWithoutFlags Gdi32Api.BitBlt(safeCompatibleDcHandle, 0, 0, captureBounds.Width, captureBounds.Height, desktopDcHandle, captureBounds.X, captureBounds.Y, RasterOperations.SourceCopy | RasterOperations.CaptureBlt); @@ -427,7 +398,7 @@ namespace Greenshot.Addons.Core // For all screens copy the content to the new bitmap foreach (var screen in Screen.AllScreens) { - // Make sure the bounds are offsetted to the capture bounds + // Make sure the bounds are with an offset to the capture bounds var screenBounds = screen.Bounds; screenBounds.Offset(-captureBounds.X, -captureBounds.Y); graphics.DrawImage(tmpBitmap, screenBounds, screenBounds.X, screenBounds.Y, screenBounds.Width, screenBounds.Height, GraphicsUnit.Pixel); diff --git a/src/Greenshot.Addons/Greenshot.Addons.csproj b/src/Greenshot.Addons/Greenshot.Addons.csproj index f1e57114a..44c108648 100644 --- a/src/Greenshot.Addons/Greenshot.Addons.csproj +++ b/src/Greenshot.Addons/Greenshot.Addons.csproj @@ -44,13 +44,13 @@ - 1.2.7 + 1.2.10 - 1.2.7 + 1.2.10 - 1.2.7 + 1.2.10 0.9.18 @@ -62,10 +62,10 @@ 0.9.18 - 0.7.26 + 0.8.3 - 0.7.26 + 0.8.3 all diff --git a/src/Greenshot.Core/Extensions/InteropWindowCaptureExtensions.cs b/src/Greenshot.Core/Extensions/InteropWindowCaptureExtensions.cs index 38a935c57..671430caf 100644 --- a/src/Greenshot.Core/Extensions/InteropWindowCaptureExtensions.cs +++ b/src/Greenshot.Core/Extensions/InteropWindowCaptureExtensions.cs @@ -40,7 +40,6 @@ using Dapplo.Windows.DesktopWindowsManager; using Dapplo.Windows.DesktopWindowsManager.Structs; using Dapplo.Windows.Gdi32; using Dapplo.Windows.User32; -using Dapplo.Windows.User32.Structs; using Greenshot.Core.Configuration; using Greenshot.Core.Enums; using Greenshot.Core.Interfaces; @@ -178,7 +177,7 @@ namespace Greenshot.Core.Extensions using (var workingArea = new Region()) { // Find the screen where the window is and check if it fits - foreach (var displayInfo in User32Api.AllDisplays()) + foreach (var displayInfo in DisplayInfo.AllDisplayInfos) { workingArea.Union(displayInfo.WorkingArea); } @@ -187,7 +186,7 @@ namespace Greenshot.Core.Extensions if (!workingArea.AreRectangleCornersVisisble(windowRectangle)) { // If none found we find the biggest screen - foreach (var displayInfo in User32Api.AllDisplays()) + foreach (var displayInfo in DisplayInfo.AllDisplayInfos) { var newWindowRectangle = new NativeRect(displayInfo.WorkingArea.Location, windowRectangle.Size); if (!workingArea.AreRectangleCornersVisisble(newWindowRectangle)) @@ -261,7 +260,7 @@ namespace Greenshot.Core.Extensions tempFormShown = true; // Intersect with screen - captureRectangle = captureRectangle.Intersect(DisplayInfo.GetAllScreenBounds()); + captureRectangle = captureRectangle.Intersect(DisplayInfo.ScreenBounds); // Check if we make a transparent capture if (captureConfiguration.WindowCaptureMode == WindowCaptureModes.AeroTransparent) diff --git a/src/Greenshot.Core/Greenshot.Core.csproj b/src/Greenshot.Core/Greenshot.Core.csproj index fb2fe5c33..ba95a1421 100644 --- a/src/Greenshot.Core/Greenshot.Core.csproj +++ b/src/Greenshot.Core/Greenshot.Core.csproj @@ -29,7 +29,7 @@ - 0.7.26 + 0.8.3 diff --git a/src/Greenshot.Core/Sources/ScreenSource.cs b/src/Greenshot.Core/Sources/ScreenSource.cs index b524d7bf5..1ee9eefd1 100644 --- a/src/Greenshot.Core/Sources/ScreenSource.cs +++ b/src/Greenshot.Core/Sources/ScreenSource.cs @@ -38,7 +38,6 @@ using Dapplo.Windows.Gdi32.Enums; using Dapplo.Windows.Gdi32.SafeHandles; using Dapplo.Windows.Gdi32.Structs; using Dapplo.Windows.User32; -using Dapplo.Windows.User32.Structs; using Greenshot.Core.Enums; using Greenshot.Core.Interfaces; using Greenshot.Gfx.Extensions; @@ -52,7 +51,7 @@ namespace Greenshot.Core.Sources { public ValueTask> Import(CancellationToken cancellationToken = default) { - var screenbounds = DisplayInfo.GetAllScreenBounds(); + var screenbounds = DisplayInfo.ScreenBounds; var result = CaptureRectangle(screenbounds); return new ValueTask>(result); } @@ -145,7 +144,7 @@ namespace Greenshot.Core.Sources // Collect all screens inside this capture var displaysInsideCapture = new List(); - foreach (var displayInfo in User32Api.AllDisplays()) + foreach (var displayInfo in DisplayInfo.AllDisplayInfos) { if (displayInfo.Bounds.IntersectsWith(captureBounds)) { @@ -171,7 +170,7 @@ namespace Greenshot.Core.Sources if (offscreenContent) { var modifiedImage = new WriteableBitmap(capturedBitmapSource.PixelWidth, capturedBitmapSource.PixelHeight, capturedBitmapSource.DpiX, capturedBitmapSource.DpiY, PixelFormats.Bgr32, capturedBitmapSource.Palette); - foreach (var displayInfo in User32Api.AllDisplays()) + foreach (var displayInfo in DisplayInfo.AllDisplayInfos) { modifiedImage.CopyPixels(capturedBitmapSource, displayInfo.Bounds); } diff --git a/src/Greenshot.Gfx/Greenshot.Gfx.csproj b/src/Greenshot.Gfx/Greenshot.Gfx.csproj index 9dc228c0f..bf6e3f287 100644 --- a/src/Greenshot.Gfx/Greenshot.Gfx.csproj +++ b/src/Greenshot.Gfx/Greenshot.Gfx.csproj @@ -29,7 +29,7 @@ - 1.2.7 + 1.2.10 2.3.0 diff --git a/src/Greenshot.PerformanceTests/CapturePerformance.cs b/src/Greenshot.PerformanceTests/CapturePerformance.cs new file mode 100644 index 000000000..dd2afb506 --- /dev/null +++ b/src/Greenshot.PerformanceTests/CapturePerformance.cs @@ -0,0 +1,29 @@ +using System; +using BenchmarkDotNet.Attributes; +using Greenshot.Addons.Core; + +namespace Greenshot.PerformanceTests +{ + /// + /// This defines the benchmarks which can be done + /// + [MinColumn, MaxColumn, MemoryDiagnoser] + public class CapturePerformance + { + [Benchmark] + public void Capture() + { + using (var capture = WindowCapture.CaptureScreen()) + { + if (capture.Bitmap == null) + { + throw new NotSupportedException(); + } + if (capture.Bitmap.Width <= 0 || capture.Bitmap.Height <= 0) + { + throw new NotSupportedException(); + } + } + } + } +} diff --git a/src/Greenshot.PerformanceTests/Program.cs b/src/Greenshot.PerformanceTests/Program.cs index 45f6d2e46..8a3007b75 100644 --- a/src/Greenshot.PerformanceTests/Program.cs +++ b/src/Greenshot.PerformanceTests/Program.cs @@ -16,7 +16,8 @@ namespace Greenshot.PerformanceTests { var job = Job.Default.With(Platform.X64); var config = DefaultConfig.Instance.With(job).KeepBenchmarkFiles(true); - BenchmarkRunner.Run(config); + //BenchmarkRunner.Run(config); + BenchmarkRunner.Run(config); Console.ReadLine(); } } diff --git a/src/Greenshot.Tests/Greenshot.Tests.csproj b/src/Greenshot.Tests/Greenshot.Tests.csproj index ed2663672..9e660bb1f 100644 --- a/src/Greenshot.Tests/Greenshot.Tests.csproj +++ b/src/Greenshot.Tests/Greenshot.Tests.csproj @@ -69,7 +69,7 @@ - + diff --git a/src/Greenshot/Configuration/IMetroConfiguration.cs b/src/Greenshot/Configuration/IMetroConfiguration.cs index cea89ffdc..05193b6e0 100644 --- a/src/Greenshot/Configuration/IMetroConfiguration.cs +++ b/src/Greenshot/Configuration/IMetroConfiguration.cs @@ -22,7 +22,6 @@ #endregion using System.ComponentModel; -using Dapplo.CaliburnMicro.Metro; using Dapplo.CaliburnMicro.Metro.Configuration; using Dapplo.Config.Ini; diff --git a/src/Greenshot/Configuration/Impl/MetroConfigurationImpl.cs b/src/Greenshot/Configuration/Impl/MetroConfigurationImpl.cs index 397f29203..5a2d7e452 100644 --- a/src/Greenshot/Configuration/Impl/MetroConfigurationImpl.cs +++ b/src/Greenshot/Configuration/Impl/MetroConfigurationImpl.cs @@ -21,7 +21,7 @@ #endregion -using Dapplo.CaliburnMicro.Metro; +using Dapplo.CaliburnMicro.Metro.Configuration; using Dapplo.Config.Ini; namespace Greenshot.Configuration.Impl diff --git a/src/Greenshot/Forms/CaptureForm.cs b/src/Greenshot/Forms/CaptureForm.cs index 78224fa9d..5b65492c2 100644 --- a/src/Greenshot/Forms/CaptureForm.cs +++ b/src/Greenshot/Forms/CaptureForm.cs @@ -39,7 +39,6 @@ using Dapplo.Windows.Common.Extensions; using Dapplo.Windows.Common.Structs; using Dapplo.Windows.User32; using Dapplo.Windows.User32.Enums; -using Dapplo.Windows.User32.Structs; using Greenshot.Addons.Animation; using Greenshot.Addons.Controls; using Greenshot.Addons.Core; @@ -639,7 +638,7 @@ namespace Greenshot.Forms } else if (UsedCaptureMode != CaptureMode.Window) { - var allScreenBounds = WindowCapture.GetScreenBounds(); + var allScreenBounds = DisplayInfo.ScreenBounds; allScreenBounds = allScreenBounds.MoveTo(WindowCapture.GetLocationRelativeToScreenBounds(allScreenBounds.Location)); if (verticalMove) diff --git a/src/Greenshot/Forms/LanguageDialog.cs b/src/Greenshot/Forms/LanguageDialog.cs index 99434c97f..276ac26e5 100644 --- a/src/Greenshot/Forms/LanguageDialog.cs +++ b/src/Greenshot/Forms/LanguageDialog.cs @@ -24,11 +24,9 @@ #region Usings using System; -using System.Linq; using System.Threading; using System.Windows.Forms; using Dapplo.Log; -using Greenshot.Addons.Core; using Greenshot.Addons.Resources; #endregion diff --git a/src/Greenshot/Forms/MainForm.cs b/src/Greenshot/Forms/MainForm.cs index 5da89403b..3f555f600 100644 --- a/src/Greenshot/Forms/MainForm.cs +++ b/src/Greenshot/Forms/MainForm.cs @@ -60,7 +60,7 @@ using Greenshot.Ui.Configuration.ViewModels; using Message = System.Windows.Forms.Message; using Screen = System.Windows.Forms.Screen; using Dapplo.Config.Ini; -using Dapplo.Addons; +using Dapplo.Windows.User32; using Greenshot.Addons.Resources; #endregion @@ -457,7 +457,7 @@ namespace Greenshot.Forms } } - private void CaptureIE() + private void CaptureIe() { if (_coreConfiguration.IECapture) { @@ -597,28 +597,28 @@ namespace Greenshot.Forms { return; } - var allScreensBounds = WindowCapture.GetScreenBounds(); + var allScreensBounds = DisplayInfo.ScreenBounds; var captureScreenItem = new ToolStripMenuItem(_greenshotLanguage.ContextmenuCapturefullscreenAll); captureScreenItem.Click += (o, args) => BeginInvoke((MethodInvoker) (() => CaptureHelper.CaptureFullscreen(false, ScreenCaptureMode.FullScreen))); captureScreenMenuItem.DropDownItems.Add(captureScreenItem); - foreach (var screen in Screen.AllScreens) + foreach (var displayInfo in DisplayInfo.AllDisplayInfos) { - var screenToCapture = screen; + var screenToCapture = displayInfo; var deviceAlignment = ""; - if (screen.Bounds.Top == allScreensBounds.Top && screen.Bounds.Bottom != allScreensBounds.Bottom) + if (displayInfo.Bounds.Top == allScreensBounds.Top && displayInfo.Bounds.Bottom != allScreensBounds.Bottom) { deviceAlignment += " " + _greenshotLanguage.ContextmenuCapturefullscreenTop; } - else if (screen.Bounds.Top != allScreensBounds.Top && screen.Bounds.Bottom == allScreensBounds.Bottom) + else if (displayInfo.Bounds.Top != allScreensBounds.Top && displayInfo.Bounds.Bottom == allScreensBounds.Bottom) { deviceAlignment += " " + _greenshotLanguage.ContextmenuCapturefullscreenBottom; } - if (screen.Bounds.Left == allScreensBounds.Left && screen.Bounds.Right != allScreensBounds.Right) + if (displayInfo.Bounds.Left == allScreensBounds.Left && displayInfo.Bounds.Right != allScreensBounds.Right) { deviceAlignment += " " + _greenshotLanguage.ContextmenuCapturefullscreenLeft; } - else if (screen.Bounds.Left != allScreensBounds.Left && screen.Bounds.Right == allScreensBounds.Right) + else if (displayInfo.Bounds.Left != allScreensBounds.Left && displayInfo.Bounds.Right == allScreensBounds.Right) { deviceAlignment += " " + _greenshotLanguage.ContextmenuCapturefullscreenRight; } @@ -765,7 +765,7 @@ namespace Greenshot.Forms private void Contextmenu_captureie_Click(object sender, EventArgs e) { - CaptureIE(); + CaptureIe(); } private void Contextmenu_captureiefromlist_Click(object sender, EventArgs e) diff --git a/src/Greenshot/Greenshot.csproj b/src/Greenshot/Greenshot.csproj index 63e18ae53..e8eec24c0 100644 --- a/src/Greenshot/Greenshot.csproj +++ b/src/Greenshot/Greenshot.csproj @@ -79,18 +79,18 @@ - - - - - + + + + + - - - + + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Greenshot/Help/HelpFileLoader.cs b/src/Greenshot/Help/HelpFileLoader.cs index cb0e9d1d6..b25d63e73 100644 --- a/src/Greenshot/Help/HelpFileLoader.cs +++ b/src/Greenshot/Help/HelpFileLoader.cs @@ -28,7 +28,6 @@ using System.Diagnostics; using System.Net; using Dapplo.HttpExtensions; using Dapplo.Log; -using Greenshot.Addons.Core; #endregion diff --git a/src/Greenshot/Helpers/CaptureHelper.cs b/src/Greenshot/Helpers/CaptureHelper.cs index 72208a745..ab843da6f 100644 --- a/src/Greenshot/Helpers/CaptureHelper.cs +++ b/src/Greenshot/Helpers/CaptureHelper.cs @@ -369,12 +369,14 @@ namespace Greenshot.Helpers var mouseLocation = User32Api.GetCursorLocation(); foreach (var screen in Screen.AllScreens) { - if (screen.Bounds.Contains(mouseLocation)) + if (!screen.Bounds.Contains(mouseLocation)) { - _capture = WindowCapture.CaptureRectangle(_capture, screen.Bounds); - captureTaken = true; - break; + continue; } + + _capture = WindowCapture.CaptureRectangle(_capture, screen.Bounds); + captureTaken = true; + break; } break; case ScreenCaptureMode.Fixed: diff --git a/src/Greenshot/Startup.cs b/src/Greenshot/Startup.cs index 8f8e770d5..5ce639996 100644 --- a/src/Greenshot/Startup.cs +++ b/src/Greenshot/Startup.cs @@ -34,14 +34,11 @@ using Dapplo.Addons.Bootstrapper; using Dapplo.CaliburnMicro.Dapp; using Dapplo.Config.Ini.Converters; using Dapplo.Config.Language; -using Dapplo.Log; -using Dapplo.Log.Loggers; using Dapplo.Utils; using Dapplo.Windows.Common.Structs; using Dapplo.Windows.Dpi.Forms; using Dapplo.Windows.Kernel32; using Greenshot.Addons; -using Greenshot.Addons.Core; using Greenshot.Addons.Resources; using Greenshot.Ui.Misc.ViewModels; diff --git a/src/Greenshot/Ui/Configuration/ViewModels/UiConfigViewModel.cs b/src/Greenshot/Ui/Configuration/ViewModels/UiConfigViewModel.cs index 676016190..3df66c02d 100644 --- a/src/Greenshot/Ui/Configuration/ViewModels/UiConfigViewModel.cs +++ b/src/Greenshot/Ui/Configuration/ViewModels/UiConfigViewModel.cs @@ -26,10 +26,10 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Reactive.Disposables; -using Caliburn.Micro; using Dapplo.CaliburnMicro.Configuration; using Dapplo.CaliburnMicro.Extensions; using Dapplo.CaliburnMicro.Metro; +using Dapplo.CaliburnMicro.Metro.Configuration; using Dapplo.Utils.Extensions; using Greenshot.Addons; using Greenshot.Addons.Core; diff --git a/src/Greenshot/Ui/Notifications/ViewModels/UpdateNotificationViewModel.cs b/src/Greenshot/Ui/Notifications/ViewModels/UpdateNotificationViewModel.cs index 53799eea1..5b1c8d3e8 100644 --- a/src/Greenshot/Ui/Notifications/ViewModels/UpdateNotificationViewModel.cs +++ b/src/Greenshot/Ui/Notifications/ViewModels/UpdateNotificationViewModel.cs @@ -27,7 +27,6 @@ using System.Windows.Media; using Dapplo.CaliburnMicro.Toasts.ViewModels; using Dapplo.Log; using Greenshot.Addons; -using Greenshot.Addons.Core; using Greenshot.Addons.Resources; namespace Greenshot.Ui.Notifications.ViewModels