mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
CodeMaid cleanup
This commit is contained in:
parent
f5ce4fcf49
commit
ebd7420f2e
18 changed files with 9 additions and 45 deletions
|
@ -31,7 +31,6 @@
|
|||
using GreenshotPlugin.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.IO;
|
||||
|
|
|
@ -24,9 +24,6 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace HelpersLib
|
||||
{
|
||||
|
|
|
@ -23,11 +23,8 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace HelpersLib
|
||||
|
@ -37,7 +34,8 @@ public static class CodeMenu
|
|||
public static ContextMenuStrip Create<TEntry>(TextBox tb, params TEntry[] ignoreList)
|
||||
where TEntry : CodeMenuEntry
|
||||
{
|
||||
ContextMenuStrip cms = new ContextMenuStrip {
|
||||
ContextMenuStrip cms = new ContextMenuStrip
|
||||
{
|
||||
Font = new Font("Lucida Console", 8),
|
||||
AutoClose = false,
|
||||
Opacity = 0.9,
|
||||
|
@ -45,12 +43,14 @@ public static ContextMenuStrip Create<TEntry>(TextBox tb, params TEntry[] ignore
|
|||
};
|
||||
|
||||
var variables = Helpers.GetValueFields<TEntry>().Where(x => !ignoreList.Contains(x)).
|
||||
Select(x => new {
|
||||
Select(x => new
|
||||
{
|
||||
Name = x.ToPrefixString(),
|
||||
Description = x.Description,
|
||||
});
|
||||
|
||||
foreach (var variable in variables) {
|
||||
foreach (var variable in variables)
|
||||
{
|
||||
ToolStripMenuItem tsmi = new ToolStripMenuItem { Text = string.Format("{0} - {1}", variable.Name, variable.Description), Tag = variable.Name };
|
||||
tsmi.Click += (sender, e) =>
|
||||
{
|
||||
|
@ -78,7 +78,8 @@ public static ContextMenuStrip Create<TEntry>(TextBox tb, params TEntry[] ignore
|
|||
|
||||
tb.KeyDown += (sender, e) =>
|
||||
{
|
||||
if ((e.KeyCode == Keys.Enter || e.KeyCode == Keys.Escape) && cms.Visible) {
|
||||
if ((e.KeyCode == Keys.Enter || e.KeyCode == Keys.Escape) && cms.Visible)
|
||||
{
|
||||
cms.Close();
|
||||
e.SuppressKeyPress = true;
|
||||
}
|
||||
|
|
|
@ -24,9 +24,6 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace HelpersLib
|
||||
{
|
||||
|
@ -42,7 +39,7 @@ public CodeMenuEntry(string value, string description)
|
|||
|
||||
public String Value { get { return _value; } }
|
||||
public String Description { get { return _description; } }
|
||||
|
||||
|
||||
public abstract string ToPrefixString();
|
||||
}
|
||||
}
|
|
@ -23,13 +23,11 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace HelpersLib
|
||||
{
|
||||
|
|
|
@ -24,13 +24,8 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace HelpersLib
|
||||
|
|
|
@ -23,7 +23,6 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using HelpersLib;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Design;
|
||||
|
|
|
@ -24,7 +24,6 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
|
|
|
@ -24,12 +24,9 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace HelpersLib
|
||||
{
|
||||
|
|
|
@ -27,7 +27,6 @@ You should have received a copy of the GNU General Public License
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
|
||||
namespace ScreenCaptureLib
|
||||
{
|
||||
|
|
|
@ -31,7 +31,6 @@ You should have received a copy of the GNU General Public License
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
|
|
@ -24,7 +24,6 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using HelpersLib;
|
||||
using ScreenCaptureLib;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
|
|
|
@ -24,7 +24,6 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using HelpersLib;
|
||||
using ShareX.Properties;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
|
|
|
@ -25,12 +25,7 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
using HelpersLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ShareX
|
||||
|
|
|
@ -23,11 +23,7 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace ShareX
|
||||
{
|
||||
|
|
|
@ -33,7 +33,6 @@ You should have received a copy of the GNU General Public License
|
|||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Text;
|
||||
using System.IO;
|
||||
using System.Media;
|
||||
using System.Windows.Forms;
|
||||
using UploadersLib;
|
||||
using UploadersLib.HelperClasses;
|
||||
|
|
|
@ -29,7 +29,6 @@ You should have received a copy of the GNU General Public License
|
|||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Media;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ShareX
|
||||
|
|
|
@ -24,11 +24,8 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace UploadersLib.FileUploaders
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue