Small cleanups

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@902 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2010-09-23 09:09:33 +00:00
commit 0424692315
30 changed files with 40 additions and 41 deletions

View file

@ -38,7 +38,7 @@ namespace GreenshotOCR {
/// OCR Plugin Greenshot
/// </summary>
public class OcrPlugin : IGreenshotPlugin {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(OcrPlugin));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(OcrPlugin));
private const string MODI_OFFICE11 = @"Software\Microsoft\Office\11.0\MODI";
private const string MODI_OFFICE12 = @"Software\Microsoft\Office\12.0\MODI";

View file

@ -37,7 +37,7 @@ namespace RunAtOutput {
/// An Plugin to run commands after an image was written
/// </summary>
public class RunAtOutputPlugin : IGreenshotPlugin {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(RunAtOutputPlugin));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(RunAtOutputPlugin));
private IGreenshotPluginHost host;
private ICaptureHost captureHost = null;
private PluginAttribute myAttributes;

View file

@ -29,7 +29,7 @@ namespace RunAtOutput {
/// Description of SettingsForm.
/// </summary>
public partial class SettingsForm : Form {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(SettingsForm));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(SettingsForm));
private RunAtOutputConfiguration config;
public SettingsForm() {

View file

@ -34,7 +34,7 @@ namespace TitleFix {
/// An example Plugin so developers can see how they can develop their own plugin
/// </summary>
public class TitleFix : IGreenshotPlugin {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(TitleFix));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(TitleFix));
private IGreenshotPluginHost host;
private ICaptureHost captureHost = null;

View file

@ -42,7 +42,7 @@ namespace Greenshot.Forms {
/// Description of CaptureForm.
/// </summary>
public partial class CaptureForm : Form, ICaptureHost {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(CaptureForm));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(CaptureForm));
private int mX;
private int mY;

View file

@ -89,7 +89,7 @@ namespace Confluence {
this.credentials = null;
e.Data.Add("user", user);
e.Data.Add("url", url);
throw e;
throw;
}
return true;
}

View file

@ -37,7 +37,7 @@ namespace GreenshotConfluencePlugin {
/// This is the ConfluencePlugin base code
/// </summary>
public class ConfluencePlugin : IGreenshotPlugin {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ConfluencePlugin));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ConfluencePlugin));
private ILanguage lang = Language.GetInstance();
private IGreenshotPluginHost host;
private ICaptureHost captureHost = null;

View file

@ -79,7 +79,7 @@ namespace Greenshot.Core {
}
public class IniConfig {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(IniConfig));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(IniConfig));
private const string CONFIG_FILE_NAME = "greenshot.ini";
private const string DEFAULTS_CONFIG_FILE_NAME = "greenshot-defaults.ini";

View file

@ -60,7 +60,7 @@ namespace Greenshot.Core {
/// Description of Language.
/// </summary>
public class LanguageContainer : ILanguage {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(LanguageContainer));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(LanguageContainer));
private static char [] TRIMCHARS = new char[] {' ', '\t', '\n', '\r'};
private const string DEFAULT_LANGUAGE= "en-US";
private static string APPLICATIONDATA_LANGUAGE_PATH = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),@"Greenshot\Languages\");
@ -350,7 +350,7 @@ namespace Greenshot.Core {
public class LanguageConfiguration {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(LanguageConfiguration));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(LanguageConfiguration));
public string description;
public string Description {get;set;}

View file

@ -27,7 +27,7 @@ namespace Greenshot.Core {
/// A Class to representate a simple "java" properties file
/// </summary>
public class Properties : Dictionary<string, string >{
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(Properties));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(Properties));
public string GetProperty(string key) {
try {

View file

@ -38,7 +38,7 @@ namespace Greenshot.Forms {
/// For some reason SFD is sealed :(
/// </summary>
public class SaveImageFileDialog {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(SaveImageFileDialog));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(SaveImageFileDialog));
protected SaveFileDialog saveFileDialog;
private FilterOption[] filterOptions;
private DirectoryInfo eagerlyCreatedDirectory;

View file

@ -37,7 +37,7 @@ namespace Greenshot {
/// Description of SettingsForm.
/// </summary>
public partial class SettingsForm : Form {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(SettingsForm));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(SettingsForm));
ILanguage lang;
private CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
private ToolTip toolTip;

View file

@ -30,7 +30,7 @@ namespace Greenshot.Helpers {
/// Description of HotkeyHelper.
/// </summary>
public class HotkeyHelper {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(HotkeyHelper));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(HotkeyHelper));
private const uint WM_HOTKEY = 0x312;
public const uint VK_SNAPSHOT = 0x2C;

View file

@ -26,7 +26,7 @@ namespace Greenshot.Helpers {
/// Description of ImageHelper.
/// </summary>
public class ImageHelper {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImageHelper));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImageHelper));
private ImageHelper() {
}

View file

@ -166,8 +166,7 @@ namespace Greenshot.Helpers {
}
public bool RegisterHotKey(uint modifierKeyCode, uint virtualKeyCode, HotKeyHandler handler) {
//return HotkeyHelper.RegisterHotKey(MainForm.instance.Handle, modifierKeyCode, virtualKeyCode, handler);
return false; // TODO
return false; //HotkeyHelper.RegisterHotKey(MainForm.instance.Handle, modifierKeyCode, virtualKeyCode, handler);
}
#endregion

View file

@ -104,7 +104,7 @@ namespace Greenshot.Helpers {
/// Having the Bitmap, eventually the Windows Title and cursor all together.
/// </summary>
public class Capture : IDisposable, ICapture {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(Capture));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(Capture));
private Rectangle screenBounds;
/// <summary>

View file

@ -216,7 +216,7 @@ namespace Greenshot.Helpers {
/// enumeration
/// </summary>
public class WindowDetails {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(WindowDetails));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(WindowDetails));
private static Dictionary<string, List<string>> classnameTree = new Dictionary<string, List<string>>();
private const string CONFIG_FILE_NAME = "windowcontent.properties";
private static string configfilename = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),@"Greenshot\" + CONFIG_FILE_NAME);

View file

@ -30,7 +30,7 @@ namespace Greenshot.Drawing {
/// </summary>
[Serializable()]
public unsafe class BitmapBuffer : IDisposable {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(BitmapBuffer));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(BitmapBuffer));
private Bitmap bitmap;
public Bitmap Bitmap {
get {return bitmap;}

View file

@ -32,7 +32,7 @@ namespace Greenshot.Drawing {
/// </summary>
[Serializable()]
public class BitmapContainer : DrawableContainer, IBitmapContainer {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(BitmapContainer));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(BitmapContainer));
protected Bitmap bitmap;

View file

@ -33,7 +33,7 @@ namespace Greenshot.Drawing {
/// </summary>
[Serializable()]
public class CursorContainer : DrawableContainer, ICursorContainer {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(CursorContainer));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(CursorContainer));
protected Cursor cursor;

View file

@ -28,7 +28,7 @@ using Greenshot.Drawing.Fields;
namespace Greenshot.Drawing.Filters {
[Serializable()]
public class FastSmoothFilter : AbstractFilter {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(FastSmoothFilter));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(FastSmoothFilter));
public FastSmoothFilter(DrawableContainer parent) : base(parent) {
AddField(FieldFactory.CreateField(FieldType.BLUR_RADIUS, GetType()));

View file

@ -34,7 +34,7 @@ namespace Greenshot.Drawing {
/// </summary>
[Serializable()]
public class HtmlContainer : DrawableContainer {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(HtmlContainer));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(HtmlContainer));
private const string SCRIPT_PATTERN = "<script(.*?)</script>";
private string html = null;
private Bitmap bitmap = null;

View file

@ -32,7 +32,7 @@ namespace Greenshot.Drawing {
/// </summary>
[Serializable()]
public class IconContainer : DrawableContainer, IIconContainer {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(IconContainer));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(IconContainer));
protected Icon icon;

View file

@ -33,7 +33,7 @@ namespace Greenshot.Drawing {
/// </summary>
[Serializable()]
public class MetafileContainer : DrawableContainer, IMetafileContainer {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(MetafileContainer));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(MetafileContainer));
protected Metafile metafile;

View file

@ -45,7 +45,7 @@ namespace Greenshot.Drawing {
/// Description of Surface.
/// </summary>
public class Surface : PictureBox, ISurface {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(Surface));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(Surface));
public event SurfaceElementEventHandler MovingElementChanged;
public event SurfaceDrawingModeEventHandler DrawingModeChanged;

View file

@ -33,7 +33,7 @@ namespace Greenshot.Drawing {
/// </summary>
[Serializable()]
public class UrlContainer : DrawableContainer {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(UrlContainer));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(UrlContainer));
protected Bitmap bitmap = null;
protected string url = null;

View file

@ -27,7 +27,7 @@ using System.Reflection;
namespace Greenshot.Helpers {
public class WebsiteImageGenerator {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(WebsiteImageGenerator));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(WebsiteImageGenerator));
private const int MAX_HEIGHT = 2048;
private const int MAX_WIDTH = 2048;

View file

@ -40,7 +40,7 @@ namespace GreenshotFlickrPlugin {
/// OCR Plugin Greenshot
/// </summary>
public class FlickrPlugin : IGreenshotPlugin {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(FlickrPlugin));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(FlickrPlugin));
private const string ApiKey = "f967e5148945cb3c4e149cc5be97796a";
private const string SharedSecret = "4180a21a1d2f8666";
private ILanguage lang = Language.GetInstance();

View file

@ -100,16 +100,16 @@ namespace GreenshotJiraPlugin {
}
public void upload(string text) {
jiraConnector.addAttachment(selectedIssue.key, jiraFilenameBox.Text, text);
jiraConnector.addAttachment(selectedIssue.Key, jiraFilenameBox.Text, text);
if (jiraCommentBox.Text != null && jiraCommentBox.Text.Length > 0) {
jiraConnector.addComment(selectedIssue.key, jiraCommentBox.Text);
jiraConnector.addComment(selectedIssue.Key, jiraCommentBox.Text);
}
}
public void upload(byte [] attachment) {
jiraConnector.addAttachment(selectedIssue.key, jiraFilenameBox.Text, attachment);
jiraConnector.addAttachment(selectedIssue.Key, jiraFilenameBox.Text, attachment);
if (jiraCommentBox.Text != null && jiraCommentBox.Text.Length > 0) {
jiraConnector.addComment(selectedIssue.key, jiraCommentBox.Text);
jiraConnector.addComment(selectedIssue.Key, jiraCommentBox.Text);
}
}
@ -126,7 +126,7 @@ namespace GreenshotJiraPlugin {
if (jiraConnector.isLoggedIn()) {
JiraFilter filter = (JiraFilter)jiraFilterBox.SelectedItem;
if (filter != null) {
JiraIssue[] issues = jiraConnector.getIssuesForFilter(filter.id);
JiraIssue[] issues = jiraConnector.getIssuesForFilter(filter.Id);
jiraListView.BeginUpdate();
jiraListView.Items.Clear();
if (issues.Length > 0) {
@ -136,12 +136,12 @@ namespace GreenshotJiraPlugin {
jiraListView.Columns.Add(language.GetString(column));
}
foreach (JiraIssue issue in issues) {
ListViewItem item = new ListViewItem(issue.key);
ListViewItem item = new ListViewItem(issue.Key);
item.Tag = issue;
item.SubItems.Add(issue.created.Value.ToString("d", DateTimeFormatInfo.InvariantInfo));
item.SubItems.Add(issue.assignee);
item.SubItems.Add(issue.reporter);
item.SubItems.Add(issue.summary);
item.SubItems.Add(issue.Created.Value.ToString("d", DateTimeFormatInfo.InvariantInfo));
item.SubItems.Add(issue.Assignee);
item.SubItems.Add(issue.Reporter);
item.SubItems.Add(issue.Summary);
jiraListView.Items.Add(item);
}
for (int i = 0; i < columns.Length; i++) {

View file

@ -37,7 +37,7 @@ namespace GreenshotJiraPlugin {
/// This is the JiraPlugin base code
/// </summary>
public class JiraPlugin : IGreenshotPlugin {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(JiraPlugin));
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(JiraPlugin));
private ILanguage lang = Language.GetInstance();
private IGreenshotPluginHost host;
private ICaptureHost captureHost = null;