CodeMaid cleanup

This commit is contained in:
Jaex 2014-09-13 15:07:05 +03:00
parent f5ce4fcf49
commit ebd7420f2e
18 changed files with 9 additions and 45 deletions

View file

@ -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;

View file

@ -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
{

View file

@ -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;
}

View file

@ -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();
}
}

View file

@ -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
{

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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
{

View file

@ -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
{

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -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
{

View file

@ -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;

View file

@ -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

View file

@ -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
{