diff --git a/src/Greenshot.Base/Core/CredentialsHelper.cs b/src/Greenshot.Base/Core/CredentialsHelper.cs index 24063b7a8..f35b65ad5 100644 --- a/src/Greenshot.Base/Core/CredentialsHelper.cs +++ b/src/Greenshot.Base/Core/CredentialsHelper.cs @@ -35,28 +35,28 @@ namespace Greenshot.Base.Core /// doesn't show all credentials use the tool here: https://www.microsoft.com/indonesia/msdn/credmgmt.aspx /// The following code is an example for a login, it will call the Authenticate with user/password /// which should return true if the login worked, false if not. - /// private static bool Login(string system, string name) { - /// try { - /// CredentialsDialog dialog = new CredentialsDialog(system); - /// dialog.Name = name; - /// while (dialog.Show(dialog.Name) == DialogResult.OK) { - /// if (Authenticate(dialog.Name, dialog.Password)) { - /// if (dialog.SaveChecked) dialog.Confirm(true); - /// return true; - /// } else { - /// try { - /// dialog.Confirm(false); - /// } catch (ApplicationException) { - /// // exception handling ... - /// } - /// dialog.IncorrectPassword = true; - /// } - /// } - /// } catch (ApplicationException) { - /// // exception handling ... - /// } - /// return false; - /// } + /// private static bool Login(string system, string name) { + /// try { + /// CredentialsDialog dialog = new CredentialsDialog(system); + /// dialog.Name = name; + /// while (dialog.Show(dialog.Name) == DialogResult.OK) { + /// if (Authenticate(dialog.Name, dialog.Password)) { + /// if (dialog.SaveChecked) dialog.Confirm(true); + /// return true; + /// } else { + /// try { + /// dialog.Confirm(false); + /// } catch (ApplicationException) { + /// // exception handling ... + /// } + /// dialog.IncorrectPassword = true; + /// } + /// } + /// } catch (ApplicationException) { + /// // exception handling ... + /// } + /// return false; + /// } /// /// Encapsulates dialog functionality from the Credential Management API. public sealed class CredentialsDialog diff --git a/src/Greenshot.Base/Core/IEHelper.cs b/src/Greenshot.Base/Core/IEHelper.cs index f7fa3242b..877e8359a 100644 --- a/src/Greenshot.Base/Core/IEHelper.cs +++ b/src/Greenshot.Base/Core/IEHelper.cs @@ -128,7 +128,7 @@ namespace Greenshot.Base.Core { ModifyRegistry("HKEY_CURRENT_USER", applicationName + ".exe", ieVersion); #if DEBUG - ModifyRegistry("HKEY_CURRENT_USER", applicationName + ".vshost.exe", ieVersion); + ModifyRegistry("HKEY_CURRENT_USER", applicationName + ".vshost.exe", ieVersion); #endif } diff --git a/src/Greenshot.Base/Core/ImageHelper.cs b/src/Greenshot.Base/Core/ImageHelper.cs index f75cc9def..93073d365 100644 --- a/src/Greenshot.Base/Core/ImageHelper.cs +++ b/src/Greenshot.Base/Core/ImageHelper.cs @@ -1171,9 +1171,9 @@ namespace Greenshot.Base.Core /// /// Clone an image, taking some rules into account: /// 1) When sourceRect is the whole bitmap there is a GDI+ bug in Clone - /// Clone will than return the same PixelFormat as the source - /// a quick workaround is using new Bitmap which uses a default of Format32bppArgb - /// 2) When going from a transparent to a non transparent bitmap, we draw the background white! + /// Clone will than return the same PixelFormat as the source + /// a quick workaround is using new Bitmap which uses a default of Format32bppArgb + /// 2) When going from a transparent to a non transparent bitmap, we draw the background white! /// /// Source bitmap to clone /// NativeRect to copy from the source, use NativeRect.Empty for all diff --git a/src/Greenshot.Base/Core/OAuth/OAuth2Helper.cs b/src/Greenshot.Base/Core/OAuth/OAuth2Helper.cs index 8c77a0fff..510be8873 100644 --- a/src/Greenshot.Base/Core/OAuth/OAuth2Helper.cs +++ b/src/Greenshot.Base/Core/OAuth/OAuth2Helper.cs @@ -87,9 +87,9 @@ namespace Greenshot.Base.Core.OAuth // gives as described here: https://developers.google.com/identity/protocols/OAuth2InstalledApp // "access_token":"1/fFAGRNJru1FTz70BzhT3Zg", - // "expires_in":3920, - // "token_type":"Bearer", - // "refresh_token":"1/xEoDL4iW3cxlI7yDbSRFYNG01kVKM2C-259HOF2aQbI" + // "expires_in":3920, + // "token_type":"Bearer", + // "refresh_token":"1/xEoDL4iW3cxlI7yDbSRFYNG01kVKM2C-259HOF2aQbI" if (refreshTokenResult.ContainsKey(AccessToken)) { settings.AccessToken = (string) refreshTokenResult[AccessToken]; @@ -181,8 +181,8 @@ namespace Greenshot.Base.Core.OAuth // gives as described here: https://developers.google.com/identity/protocols/OAuth2InstalledApp // "access_token":"1/fFAGRNJru1FTz70BzhT3Zg", - // "expires_in":3920, - // "token_type":"Bearer", + // "expires_in":3920, + // "token_type":"Bearer", IDictionary accessTokenResult = JSONHelper.JsonDecode(accessTokenJsonResult); if (accessTokenResult.ContainsKey("error")) diff --git a/src/Greenshot.Base/Core/QuantizerHelper.cs b/src/Greenshot.Base/Core/QuantizerHelper.cs index ec414968b..a63a080fe 100644 --- a/src/Greenshot.Base/Core/QuantizerHelper.cs +++ b/src/Greenshot.Base/Core/QuantizerHelper.cs @@ -621,7 +621,7 @@ namespace Greenshot.Base.Core } /// - /// Finds the optimal (maximal) position for the cut. + /// Finds the optimal (maximal) position for the cut. /// private float Maximize(WuColorCube cube, int direction, int first, int last, int[] cut, long wholeRed, long wholeGreen, long wholeBlue, long wholeWeight) { diff --git a/src/Greenshot.Base/Core/WindowCapture.cs b/src/Greenshot.Base/Core/WindowCapture.cs index 01e1bce56..0b614488b 100644 --- a/src/Greenshot.Base/Core/WindowCapture.cs +++ b/src/Greenshot.Base/Core/WindowCapture.cs @@ -274,7 +274,7 @@ namespace Greenshot.Base.Core // See https://connect.microsoft.com/VisualStudio/feedback/details/344752/gdi-object-leak-when-calling-graphics-copyfromscreen // Bitmap capturedBitmap = new Bitmap(captureBounds.Width, captureBounds.Height); // using (Graphics graphics = Graphics.FromImage(capturedBitmap)) { - // graphics.CopyFromScreen(captureBounds.Location, Point.Empty, captureBounds.Size, CopyPixelOperation.CaptureBlt); + // graphics.CopyFromScreen(captureBounds.Location, Point.Empty, captureBounds.Size, CopyPixelOperation.CaptureBlt); // } // capture.Image = capturedBitmap; // capture.Location = captureBounds.Location; diff --git a/src/Greenshot.Base/IEInterop/IWebBrowser2.cs b/src/Greenshot.Base/IEInterop/IWebBrowser2.cs index 074917726..2443095ce 100644 --- a/src/Greenshot.Base/IEInterop/IWebBrowser2.cs +++ b/src/Greenshot.Base/IEInterop/IWebBrowser2.cs @@ -24,16 +24,16 @@ using System.Runtime.InteropServices; namespace Greenshot.Base.IEInterop { // IWebBrowser: EAB22AC1-30C1-11CF-A7EB-0000C05BAE0B -// [ComVisible(true), ComImport(), Guid("D30C1661-CDAF-11D0-8A3E-00C04FC9E26E"), -// TypeLibType(TypeLibTypeFlags.FDual), -// InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] -// public interface IWebBrowser2 { -// [DispId(203)] -// object Document { -// [return: MarshalAs(UnmanagedType.IDispatch)] -// get; -// } -// } +// [ComVisible(true), ComImport(), Guid("D30C1661-CDAF-11D0-8A3E-00C04FC9E26E"), +// TypeLibType(TypeLibTypeFlags.FDual), +// InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] +// public interface IWebBrowser2 { +// [DispId(203)] +// object Document { +// [return: MarshalAs(UnmanagedType.IDispatch)] +// get; +// } +// } [ComImport, /*SuppressUnmanagedCodeSecurity,*/ TypeLibType(TypeLibTypeFlags.FOleAutomation | TypeLibTypeFlags.FDual | diff --git a/src/Greenshot.Editor/Drawing/DrawableContainerList.cs b/src/Greenshot.Editor/Drawing/DrawableContainerList.cs index ef30c037f..80fc5740b 100644 --- a/src/Greenshot.Editor/Drawing/DrawableContainerList.cs +++ b/src/Greenshot.Editor/Drawing/DrawableContainerList.cs @@ -443,66 +443,66 @@ namespace Greenshot.Editor.Drawing public void SetForegroundColor(Color color) { - var dcs = ToArray(); - var field = FieldType.LINE_COLOR; - foreach (var dc in dcs) - { - if (dc is not AbstractFieldHolderWithChildren fh) continue; - if (!fh.HasField(field)) continue; - - fh.SetFieldValue(field, color); - } + var dcs = ToArray(); + var field = FieldType.LINE_COLOR; + foreach (var dc in dcs) + { + if (dc is not AbstractFieldHolderWithChildren fh) continue; + if (!fh.HasField(field)) continue; + + fh.SetFieldValue(field, color); + } } public void SetBackgroundColor(Color color) { - var dcs = ToArray(); - var field = FieldType.FILL_COLOR; - foreach (var dc in dcs) - { - if (dc is not AbstractFieldHolderWithChildren fh) continue; - if (!fh.HasField(field)) continue; + var dcs = ToArray(); + var field = FieldType.FILL_COLOR; + foreach (var dc in dcs) + { + if (dc is not AbstractFieldHolderWithChildren fh) continue; + if (!fh.HasField(field)) continue; - fh.SetFieldValue(field, color); - } + fh.SetFieldValue(field, color); + } } public int IncreaseLineThickness(int increaseBy) { - var dcs = ToArray(); - var field = FieldType.LINE_THICKNESS; - var lastThickness = 0; - foreach (var dc in dcs) - { - if (dc is not AbstractFieldHolderWithChildren fh) continue; - if (!fh.HasField(field)) continue; + var dcs = ToArray(); + var field = FieldType.LINE_THICKNESS; + var lastThickness = 0; + foreach (var dc in dcs) + { + if (dc is not AbstractFieldHolderWithChildren fh) continue; + if (!fh.HasField(field)) continue; - var currentThickness = (int)fh.GetFieldValue(field); - var thickness = Math.Max(0, currentThickness + increaseBy); - fh.SetFieldValue(field, thickness); - lastThickness = thickness; - } + var currentThickness = (int)fh.GetFieldValue(field); + var thickness = Math.Max(0, currentThickness + increaseBy); + fh.SetFieldValue(field, thickness); + lastThickness = thickness; + } - return lastThickness; + return lastThickness; } public bool FlipShadow() { - var dcs = ToArray(); - var field = FieldType.SHADOW; - var lastShadow = false; - foreach (var dc in dcs) - { - if (dc is not AbstractFieldHolderWithChildren fh) continue; - if (!fh.HasField(field)) continue; + var dcs = ToArray(); + var field = FieldType.SHADOW; + var lastShadow = false; + foreach (var dc in dcs) + { + if (dc is not AbstractFieldHolderWithChildren fh) continue; + if (!fh.HasField(field)) continue; - var currentShadow = (bool)fh.GetFieldValue(field); - var shadow = !currentShadow; - fh.SetFieldValue(field, shadow); - lastShadow = shadow; - } + var currentShadow = (bool)fh.GetFieldValue(field); + var shadow = !currentShadow; + fh.SetFieldValue(field, shadow); + lastShadow = shadow; + } - return lastShadow; + return lastShadow; } /// diff --git a/src/Greenshot.Editor/Drawing/IconContainer.cs b/src/Greenshot.Editor/Drawing/IconContainer.cs index 185c17cd2..76ae1ba1d 100644 --- a/src/Greenshot.Editor/Drawing/IconContainer.cs +++ b/src/Greenshot.Editor/Drawing/IconContainer.cs @@ -80,9 +80,9 @@ namespace Greenshot.Editor.Drawing } /** - * This Dispose is called from the Dispose and the Destructor. - * When disposing==true all non-managed resources should be freed too! - */ + * This Dispose is called from the Dispose and the Destructor. + * When disposing==true all non-managed resources should be freed too! + */ protected override void Dispose(bool disposing) { if (disposing) diff --git a/src/Greenshot.Editor/Drawing/Surface.cs b/src/Greenshot.Editor/Drawing/Surface.cs index 6d47a67a6..defad5e24 100644 --- a/src/Greenshot.Editor/Drawing/Surface.cs +++ b/src/Greenshot.Editor/Drawing/Surface.cs @@ -2606,31 +2606,31 @@ namespace Greenshot.Editor.Drawing // for laptops without numPads, also allow shift modifier private void SetSelectedElementColor(Color color, bool numPad, bool shift) { - if (numPad || shift) - { - selectedElements.SetForegroundColor(color); - UpdateForegroundColorEvent(this, color); - } - else - { - selectedElements.SetBackgroundColor(color); - UpdateBackgroundColorEvent(this, color); - } - selectedElements.Invalidate(); + if (numPad || shift) + { + selectedElements.SetForegroundColor(color); + UpdateForegroundColorEvent(this, color); + } + else + { + selectedElements.SetBackgroundColor(color); + UpdateBackgroundColorEvent(this, color); + } + selectedElements.Invalidate(); } private void ChangeLineThickness(int increaseBy) { - var newThickness = selectedElements.IncreaseLineThickness(increaseBy); - UpdateLineThicknessEvent(this, newThickness); - selectedElements.Invalidate(); + var newThickness = selectedElements.IncreaseLineThickness(increaseBy); + UpdateLineThicknessEvent(this, newThickness); + selectedElements.Invalidate(); } private void FlipShadow() { - var shadow = selectedElements.FlipShadow(); - UpdateShadowEvent(this, shadow); - selectedElements.Invalidate(); + var shadow = selectedElements.FlipShadow(); + UpdateShadowEvent(this, shadow); + selectedElements.Invalidate(); } /// diff --git a/src/Greenshot.Editor/Forms/ImageEditorForm.cs b/src/Greenshot.Editor/Forms/ImageEditorForm.cs index 97263d8c2..ab3520e07 100644 --- a/src/Greenshot.Editor/Forms/ImageEditorForm.cs +++ b/src/Greenshot.Editor/Forms/ImageEditorForm.cs @@ -635,8 +635,8 @@ namespace Greenshot.Editor.Forms } /** - * Interfaces for plugins, see GreenshotInterface for more details! - */ + * Interfaces for plugins, see GreenshotInterface for more details! + */ public Image GetImageForExport() { return _surface.GetImageForExport(); diff --git a/src/Greenshot.Plugin.Office/OfficeExport/OutlookEmailExporter.cs b/src/Greenshot.Plugin.Office/OfficeExport/OutlookEmailExporter.cs index 72724c40b..952d4972c 100644 --- a/src/Greenshot.Plugin.Office/OfficeExport/OutlookEmailExporter.cs +++ b/src/Greenshot.Plugin.Office/OfficeExport/OutlookEmailExporter.cs @@ -282,8 +282,8 @@ namespace Greenshot.Plugin.Office.OfficeExport // Use this to change the format, it will probably lose the current selection. //if (!OlBodyFormat.olFormatHTML.Equals(currentMail.BodyFormat)) { - // Log.Info().WriteLine("Changing format to HTML."); - // currentMail.BodyFormat = OlBodyFormat.olFormatHTML; + // Log.Info().WriteLine("Changing format to HTML."); + // currentMail.BodyFormat = OlBodyFormat.olFormatHTML; //} bool inlinePossible = false; diff --git a/src/Greenshot/Forms/CaptureForm.cs b/src/Greenshot/Forms/CaptureForm.cs index 107aa9096..7f9d64537 100644 --- a/src/Greenshot/Forms/CaptureForm.cs +++ b/src/Greenshot/Forms/CaptureForm.cs @@ -1019,7 +1019,7 @@ namespace Greenshot.Forms // TODO: enable when the screen capture code works reliable //if (capture.CaptureDetails.CaptureMode == CaptureMode.Video) { - // graphics.FillRectangle(RedOverlayBrush, fixedRect); + // graphics.FillRectangle(RedOverlayBrush, fixedRect); //} else { graphics.FillRectangle(GreenOverlayBrush, fixedRect); //} diff --git a/src/Greenshot/Helpers/CaptureHelper.cs b/src/Greenshot/Helpers/CaptureHelper.cs index e51b51ebe..1058d4c26 100644 --- a/src/Greenshot/Helpers/CaptureHelper.cs +++ b/src/Greenshot/Helpers/CaptureHelper.cs @@ -501,7 +501,7 @@ namespace Greenshot.Helpers _capture = WindowCapture.CaptureRectangle(_capture, CoreConfig.LastCapturedRegion); // TODO: Reactive / check if the elements code is activated //if (windowDetailsThread != null) { - // windowDetailsThread.Join(); + // windowDetailsThread.Join(); //} // Set capture title, fixing bug #3569703 diff --git a/src/Greenshot/Helpers/PrintHelper.cs b/src/Greenshot/Helpers/PrintHelper.cs index 36bf8257b..fabc33343 100644 --- a/src/Greenshot/Helpers/PrintHelper.cs +++ b/src/Greenshot/Helpers/PrintHelper.cs @@ -60,17 +60,17 @@ namespace Greenshot.Helpers } /** - * Destructor - */ + * Destructor + */ ~PrintHelper() { Dispose(false); } /** - * The public accessible Dispose - * Will call the GarbageCollector to SuppressFinalize, preventing being cleaned twice - */ + * The public accessible Dispose + * Will call the GarbageCollector to SuppressFinalize, preventing being cleaned twice + */ public void Dispose() { Dispose(true); @@ -78,9 +78,9 @@ namespace Greenshot.Helpers } /** - * This Dispose is called from the Dispose and the Destructor. - * When disposing==true all non-managed resources should be freed too! - */ + * This Dispose is called from the Dispose and the Destructor. + * When disposing==true all non-managed resources should be freed too! + */ protected virtual void Dispose(bool disposing) { if (disposing)