A bit of refactoring to be able to find some issue...

This commit is contained in:
Krom, Robertus 2020-02-18 16:32:51 +01:00
commit 42cd533862
308 changed files with 2705 additions and 2454 deletions

View file

@ -22,6 +22,7 @@
using System;
using System.Windows.Forms;
using GreenshotPlugin.UnmanagedHelpers;
using GreenshotPlugin.UnmanagedHelpers.Enums;
using log4net;
namespace GreenshotPlugin.Controls {

View file

@ -20,7 +20,7 @@
*/
using System;
using System.Windows.Forms;
using GreenshotInterop.Interop;
using GreenshotPlugin.Interop;
namespace GreenshotPlugin.Controls {
public class ExtendedWebBrowser : WebBrowser {

View file

@ -23,10 +23,10 @@ using System.Collections.Generic;
using System.Windows.Forms;
using System.Reflection;
using GreenshotPlugin.Core;
using Greenshot.IniFile;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.IO;
using GreenshotPlugin.IniFile;
using log4net;
namespace GreenshotPlugin.Controls {

View file

@ -25,10 +25,9 @@ using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
using Greenshot.Plugin;
using log4net;
using GreenshotPlugin.Core;
using GreenshotPlugin.Interfaces.Plugin;
namespace GreenshotPlugin.Controls {
/// <summary>
@ -292,13 +291,13 @@ namespace GreenshotPlugin.Controls {
private void Redraw(bool bCalledProgramatically = false) {
// No hotkey set
if (_hotkey == Keys.None) {
Text = "";
Text = string.Empty;
return;
}
// LWin/RWin doesn't work as hotkeys (neither do they work as modifier keys in .NET 2.0)
if (_hotkey == Keys.LWin || _hotkey == Keys.RWin) {
Text = "";
Text = string.Empty;
return;
}
@ -318,7 +317,7 @@ namespace GreenshotPlugin.Controls {
// User pressed Shift and an invalid key (e.g. a letter or a number),
// that needs another set of modifier keys
_hotkey = Keys.None;
Text = "";
Text = string.Empty;
return;
}
}
@ -326,7 +325,7 @@ namespace GreenshotPlugin.Controls {
if ((_modifiers == (Keys.Alt | Keys.Control)) && _needNonAltGrModifier.Contains((int)_hotkey)) {
// Ctrl+Alt+4 etc won't work; reset hotkey and tell the user
_hotkey = Keys.None;
Text = "";
Text = string.Empty;
return;
}
}
@ -534,7 +533,7 @@ namespace GreenshotPlugin.Controls {
break;
case Keys.Multiply:
GetKeyNameText(numpad << 16, keyName, 100);
keyString = keyName.ToString().Replace("*","").Trim().ToLower();
keyString = keyName.ToString().Replace("*", string.Empty).Trim().ToLower();
if (keyString.IndexOf("(", StringComparison.Ordinal) >= 0) {
return "* " + keyString;
}
@ -542,7 +541,7 @@ namespace GreenshotPlugin.Controls {
return keyString + " *";
case Keys.Divide:
GetKeyNameText(numpad << 16, keyName, 100);
keyString = keyName.ToString().Replace("*","").Trim().ToLower();
keyString = keyName.ToString().Replace("*", string.Empty).Trim().ToLower();
if (keyString.IndexOf("(", StringComparison.Ordinal) >= 0) {
return "/ " + keyString;
}

View file

@ -20,8 +20,8 @@
*/
using System;
using GreenshotPlugin.Core;
using Greenshot.IniFile;
using Greenshot.Plugin;
using GreenshotPlugin.IniFile;
using GreenshotPlugin.Interfaces.Plugin;
namespace GreenshotPlugin.Controls {
/// <summary>

View file

@ -21,10 +21,9 @@
using System;
using System.IO;
using System.Windows.Forms;
using Greenshot.Plugin;
using GreenshotPlugin.Core;
using Greenshot.IniFile;
using GreenshotPlugin.IniFile;
using GreenshotPlugin.Interfaces;
using log4net;
namespace GreenshotPlugin.Controls {
@ -89,7 +88,7 @@ namespace GreenshotPlugin.Controls {
private void ApplyFilterOptions() {
PrepareFilterOptions();
string fdf = "";
string fdf = string.Empty;
int preselect = 0;
var outputFileFormatAsString = Enum.GetName(typeof(OutputFormat), conf.OutputFileFormat);
for(int i=0; i<_filterOptions.Length; i++){

View file

@ -21,9 +21,11 @@
using System;
using System.Windows.Forms;
using GreenshotPlugin.Core;
using Greenshot.IniFile;
using System.Drawing;
using GreenshotPlugin.IniFile;
using GreenshotPlugin.UnmanagedHelpers;
using GreenshotPlugin.UnmanagedHelpers.Enums;
using GreenshotPlugin.UnmanagedHelpers.Structs;
namespace GreenshotPlugin.Controls {
/// <summary>