diff --git a/Greenshot/Configuration/EditorConfiguration.cs b/Greenshot/Configuration/EditorConfiguration.cs
index 0d74d81cd..1d1fe2df3 100644
--- a/Greenshot/Configuration/EditorConfiguration.cs
+++ b/Greenshot/Configuration/EditorConfiguration.cs
@@ -35,35 +35,35 @@ namespace Greenshot.Configuration {
[IniSection("Editor", Description="Greenshot editor configuration")]
public class EditorConfiguration : IniSection {
[IniProperty("RecentColors", Separator="|", Description="Last used colors")]
- public List RecentColors;
+ public List RecentColors { get; set; }
[IniProperty("LastFieldValue", Separator="|", Description="Field values, make sure the last used settings are re-used")]
- public Dictionary LastUsedFieldValues;
+ public Dictionary LastUsedFieldValues { get; set; }
[IniProperty("MatchSizeToCapture", Description="Match the editor window size to the capture", DefaultValue="True")]
- public bool MatchSizeToCapture;
+ public bool MatchSizeToCapture { get; set; }
[IniProperty("WindowPlacementFlags", Description="Placement flags", DefaultValue="0")]
- public WindowPlacementFlags WindowPlacementFlags;
+ public WindowPlacementFlags WindowPlacementFlags { get; set; }
[IniProperty("WindowShowCommand", Description="Show command", DefaultValue="Normal")]
- public ShowWindowCommand ShowWindowCommand;
+ public ShowWindowCommand ShowWindowCommand { get; set; }
[IniProperty("WindowMinPosition", Description="Position of minimized window", DefaultValue="-1,-1")]
- public Point WindowMinPosition;
+ public Point WindowMinPosition { get; set; }
[IniProperty("WindowMaxPosition", Description="Position of maximized window", DefaultValue="-1,-1")]
- public Point WindowMaxPosition;
+ public Point WindowMaxPosition { get; set; }
[IniProperty("WindowNormalPosition", Description="Position of normal window", DefaultValue="100,100,400,400")]
- public Rectangle WindowNormalPosition;
+ public Rectangle WindowNormalPosition { get; set; }
[IniProperty("ReuseEditor", Description = "Reuse already open editor", DefaultValue = "false")]
- public bool ReuseEditor;
+ public bool ReuseEditor { get; set; }
[IniProperty("FreehandSensitivity", Description = "The smaller this number, the less smoothing is used. Decrease for detailed drawing, e.g. when using a pen. Increase for smoother lines. e.g. when you want to draw a smooth line.", DefaultValue = "3")]
- public int FreehandSensitivity;
+ public int FreehandSensitivity { get; set; }
[IniProperty("SuppressSaveDialogAtClose", Description="Suppressed the 'do you want to save' dialog when closing the editor.", DefaultValue="False")]
- public bool SuppressSaveDialogAtClose;
+ public bool SuppressSaveDialogAtClose { get; set; }
[IniProperty("DropShadowEffectSettings", Description = "Settings for the drop shadow effect.")]
- public DropShadowEffect DropShadowEffectSettings;
+ public DropShadowEffect DropShadowEffectSettings { get; set; }
[IniProperty("TornEdgeEffectSettings", Description = "Settings for the torn edge effect.")]
- public TornEdgeEffect TornEdgeEffectSettings;
+ public TornEdgeEffect TornEdgeEffectSettings { get; set; }
public override void AfterLoad() {
base.AfterLoad();
diff --git a/Greenshot/Configuration/LanguageKeys.cs b/Greenshot/Configuration/LanguageKeys.cs
index 240fcd3e8..a6c75441a 100644
--- a/Greenshot/Configuration/LanguageKeys.cs
+++ b/Greenshot/Configuration/LanguageKeys.cs
@@ -19,7 +19,10 @@
* along with this program. If not, see .
*/
+using System.Diagnostics.CodeAnalysis;
+
namespace Greenshot.Configuration {
+ [SuppressMessage("ReSharper", "InconsistentNaming")]
public enum LangKey {
none,
about_bugs,
diff --git a/Greenshot/Controls/ColorButton.cs b/Greenshot/Controls/ColorButton.cs
index 80e77399c..a0b988ab5 100644
--- a/Greenshot/Controls/ColorButton.cs
+++ b/Greenshot/Controls/ColorButton.cs
@@ -31,7 +31,7 @@ namespace Greenshot.Controls {
///
public class ColorButton : Button, IGreenshotLanguageBindable {
public event PropertyChangedEventHandler PropertyChanged;
- private Color selectedColor = Color.White;
+ private Color _selectedColor = Color.White;
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey {
@@ -44,9 +44,9 @@ namespace Greenshot.Controls {
}
public Color SelectedColor {
- get {return selectedColor;}
+ get {return _selectedColor;}
set {
- selectedColor = value;
+ _selectedColor = value;
Brush brush;
if(value != Color.Transparent) {
diff --git a/Greenshot/Controls/Pipette.cs b/Greenshot/Controls/Pipette.cs
index 179642335..cf91299ad 100644
--- a/Greenshot/Controls/Pipette.cs
+++ b/Greenshot/Controls/Pipette.cs
@@ -30,22 +30,22 @@ namespace Greenshot.Controls {
/// This code was supplied by Hi-Coder as a patch for Greenshot
/// Needed some modifications to be stable.
///
- public class Pipette : Label, IMessageFilter, IDisposable {
- private MovableShowColorForm movableShowColorForm;
- private bool dragging;
+ public sealed class Pipette : Label, IMessageFilter, IDisposable {
+ private MovableShowColorForm _movableShowColorForm;
+ private bool _dragging;
private Cursor _cursor;
private readonly Bitmap _image;
- private const int VK_ESC = 27;
+ private const int VkEsc = 27;
public event EventHandler PipetteUsed;
public Pipette() {
BorderStyle = BorderStyle.FixedSingle;
- dragging = false;
+ _dragging = false;
_image = (Bitmap)new ComponentResourceManager(typeof(ColorDialog)).GetObject("pipette.Image");
Image = _image;
- _cursor = CreateCursor((Bitmap)_image, 1, 14);
- movableShowColorForm = new MovableShowColorForm();
+ _cursor = CreateCursor(_image, 1, 14);
+ _movableShowColorForm = new MovableShowColorForm();
Application.AddMessageFilter(this);
}
@@ -58,13 +58,12 @@ namespace Greenshot.Controls {
/// Cursor
private static Cursor CreateCursor(Bitmap bitmap, int hotspotX, int hotspotY) {
using (SafeIconHandle iconHandle = new SafeIconHandle( bitmap.GetHicon())) {
- IntPtr icon;
- IconInfo iconInfo = new IconInfo();
+ IconInfo iconInfo;
User32.GetIconInfo(iconHandle, out iconInfo);
iconInfo.xHotspot = hotspotX;
iconInfo.yHotspot = hotspotY;
iconInfo.fIcon = false;
- icon = User32.CreateIconIndirect(ref iconInfo);
+ var icon = User32.CreateIconIndirect(ref iconInfo);
return new Cursor(icon);
}
}
@@ -85,11 +84,11 @@ namespace Greenshot.Controls {
if (_cursor != null) {
_cursor.Dispose();
}
- if (movableShowColorForm != null) {
- movableShowColorForm.Dispose();
+ if (_movableShowColorForm != null) {
+ _movableShowColorForm.Dispose();
}
}
- movableShowColorForm = null;
+ _movableShowColorForm = null;
_cursor = null;
base.Dispose(disposing);
}
@@ -101,7 +100,7 @@ namespace Greenshot.Controls {
protected override void OnMouseDown(MouseEventArgs e) {
if (e.Button == MouseButtons.Left) {
User32.SetCapture(Handle);
- movableShowColorForm.MoveTo(PointToScreen(new Point(e.X, e.Y)));
+ _movableShowColorForm.MoveTo(PointToScreen(new Point(e.X, e.Y)));
}
base.OnMouseDown(e);
}
@@ -117,7 +116,7 @@ namespace Greenshot.Controls {
User32.ReleaseCapture();
if (PipetteUsed != null)
{
- PipetteUsed(this, new PipetteUsedArgs(movableShowColorForm.color));
+ PipetteUsed(this, new PipetteUsedArgs(_movableShowColorForm.color));
}
}
base.OnMouseUp(e);
@@ -128,10 +127,10 @@ namespace Greenshot.Controls {
///
/// MouseEventArgs
protected override void OnMouseMove(MouseEventArgs e) {
- if (dragging) {
+ if (_dragging) {
//display the form on the right side of the cursor by default;
Point zp = PointToScreen(new Point(e.X, e.Y));
- movableShowColorForm.MoveTo(zp);
+ _movableShowColorForm.MoveTo(zp);
}
base.OnMouseMove(e);
}
@@ -142,16 +141,16 @@ namespace Greenshot.Controls {
///
protected override void OnMouseCaptureChanged(EventArgs e) {
if (Capture) {
- dragging = true;
+ _dragging = true;
Image = null;
Cursor c = _cursor;
Cursor = c;
- movableShowColorForm.Visible = true;
+ _movableShowColorForm.Visible = true;
} else {
- dragging = false;
+ _dragging = false;
Image = _image;
Cursor = Cursors.Arrow;
- movableShowColorForm.Visible = false;
+ _movableShowColorForm.Visible = false;
}
Update();
base.OnMouseCaptureChanged(e);
@@ -160,9 +159,9 @@ namespace Greenshot.Controls {
#region IMessageFilter Members
public bool PreFilterMessage(ref Message m) {
- if (dragging) {
+ if (_dragging) {
if (m.Msg == (int)WindowsMessages.WM_CHAR) {
- if ((int)m.WParam == VK_ESC) {
+ if ((int)m.WParam == VkEsc) {
User32.ReleaseCapture();
}
}
@@ -174,10 +173,10 @@ namespace Greenshot.Controls {
}
public class PipetteUsedArgs : EventArgs {
- public Color color;
+ public Color Color;
public PipetteUsedArgs(Color c) {
- color = c;
+ Color = c;
}
}
}
diff --git a/Greenshot/Controls/ToolStripColorButton.cs b/Greenshot/Controls/ToolStripColorButton.cs
index cbabe38fb..5f29db4aa 100644
--- a/Greenshot/Controls/ToolStripColorButton.cs
+++ b/Greenshot/Controls/ToolStripColorButton.cs
@@ -35,16 +35,16 @@ namespace Greenshot.Controls {
set;
}
- private Color selectedColor = Color.Transparent;
+ private Color _selectedColor = Color.Transparent;
public ToolStripColorButton() {
Click+= ColorButtonClick;
}
public Color SelectedColor {
- get {return selectedColor;}
+ get {return _selectedColor;}
set {
- selectedColor = value;
+ _selectedColor = value;
Brush brush;
if(value != Color.Transparent) {
diff --git a/Greenshot/Destinations/FileDestination.cs b/Greenshot/Destinations/FileDestination.cs
index 076cb1d67..8a8275274 100644
--- a/Greenshot/Destinations/FileDestination.cs
+++ b/Greenshot/Destinations/FileDestination.cs
@@ -114,7 +114,7 @@ namespace Greenshot.Destinations {
}
// Don't overwrite filename if no output is made
if (outputMade) {
- exportInformation.ExportMade = outputMade;
+ exportInformation.ExportMade = true;
exportInformation.Filepath = fullPath;
if (captureDetails != null)
{
diff --git a/Greenshot/Destinations/FileWithDialogDestination.cs b/Greenshot/Destinations/FileWithDialogDestination.cs
index cf4733e7f..a12194788 100644
--- a/Greenshot/Destinations/FileWithDialogDestination.cs
+++ b/Greenshot/Destinations/FileWithDialogDestination.cs
@@ -26,14 +26,12 @@ using Greenshot.Configuration;
using GreenshotPlugin.Core;
using Greenshot.Plugin;
using Greenshot.IniFile;
-using log4net;
namespace Greenshot.Destinations {
///
/// Description of FileWithDialog.
///
public class FileWithDialogDestination : AbstractDestination {
- private static ILog LOG = LogManager.GetLogger(typeof(FileWithDialogDestination));
private static readonly CoreConfiguration conf = IniConfig.GetIniSection();
public const string DESIGNATION = "FileDialog";
@@ -69,9 +67,8 @@ namespace Greenshot.Destinations {
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(Designation, Description);
- string savedTo = null;
// Bug #2918756 don't overwrite path if SaveWithDialog returns null!
- savedTo = ImageOutput.SaveWithDialog(surface, captureDetails);
+ var savedTo = ImageOutput.SaveWithDialog(surface, captureDetails);
if (savedTo != null) {
exportInformation.ExportMade = true;
exportInformation.Filepath = savedTo;
diff --git a/Greenshot/Destinations/PrinterDestination.cs b/Greenshot/Destinations/PrinterDestination.cs
index 4b584add4..29698a70d 100644
--- a/Greenshot/Destinations/PrinterDestination.cs
+++ b/Greenshot/Destinations/PrinterDestination.cs
@@ -35,7 +35,7 @@ namespace Greenshot.Destinations {
///
public class PrinterDestination : AbstractDestination {
public const string DESIGNATION = "Printer";
- public string printerName;
+ public readonly string printerName;
public PrinterDestination() {
}
@@ -85,7 +85,7 @@ namespace Greenshot.Destinations {
///
/// Create destinations for all the installed printers
///
- /// IEnumerable
+ /// IEnumerable of IDestination
public override IEnumerable DynamicDestinations() {
PrinterSettings settings = new PrinterSettings();
string defaultPrinter = settings.PrinterName;
@@ -117,7 +117,7 @@ namespace Greenshot.Destinations {
/// ExportInformation
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(Designation, Description);
- PrinterSettings printerSettings = null;
+ PrinterSettings printerSettings;
if (!string.IsNullOrEmpty(printerName)) {
using (PrintHelper printHelper = new PrintHelper(surface, captureDetails)) {
printerSettings = printHelper.PrintTo(printerName);
diff --git a/Greenshot/Drawing/Adorners/AbstractAdorner.cs b/Greenshot/Drawing/Adorners/AbstractAdorner.cs
index 685ec779f..03648a784 100644
--- a/Greenshot/Drawing/Adorners/AbstractAdorner.cs
+++ b/Greenshot/Drawing/Adorners/AbstractAdorner.cs
@@ -24,7 +24,6 @@ using Greenshot.Plugin.Drawing.Adorners;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
-using System;
namespace Greenshot.Drawing.Adorners
{
diff --git a/Greenshot/Drawing/Adorners/MoveAdorner.cs b/Greenshot/Drawing/Adorners/MoveAdorner.cs
index 78e00e2dd..998192a12 100644
--- a/Greenshot/Drawing/Adorners/MoveAdorner.cs
+++ b/Greenshot/Drawing/Adorners/MoveAdorner.cs
@@ -21,7 +21,6 @@
using Greenshot.Helpers;
using Greenshot.Plugin.Drawing;
-using Greenshot.Plugin.Drawing.Adorners;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
diff --git a/Greenshot/Drawing/Adorners/ResizeAdorner.cs b/Greenshot/Drawing/Adorners/ResizeAdorner.cs
index da536b1f5..325d6de9d 100644
--- a/Greenshot/Drawing/Adorners/ResizeAdorner.cs
+++ b/Greenshot/Drawing/Adorners/ResizeAdorner.cs
@@ -21,7 +21,6 @@
using Greenshot.Helpers;
using Greenshot.Plugin.Drawing;
-using Greenshot.Plugin.Drawing.Adorners;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
diff --git a/Greenshot/Drawing/DrawableContainerList.cs b/Greenshot/Drawing/DrawableContainerList.cs
index 60a25cf24..35df2644b 100644
--- a/Greenshot/Drawing/DrawableContainerList.cs
+++ b/Greenshot/Drawing/DrawableContainerList.cs
@@ -20,7 +20,6 @@
*/
using Greenshot.Configuration;
-using Greenshot.Drawing.Fields;
using Greenshot.Memento;
using Greenshot.Plugin;
using Greenshot.Plugin.Drawing;
diff --git a/Greenshot/Drawing/Fields/AbstractFieldHolderWithChildren.cs b/Greenshot/Drawing/Fields/AbstractFieldHolderWithChildren.cs
index ae610a5fa..a4e5986ee 100644
--- a/Greenshot/Drawing/Fields/AbstractFieldHolderWithChildren.cs
+++ b/Greenshot/Drawing/Fields/AbstractFieldHolderWithChildren.cs
@@ -28,7 +28,7 @@ namespace Greenshot.Drawing.Fields
{
///
/// Basic IFieldHolderWithChildren implementation. Similar to IFieldHolder,
- /// but has a List of children.
+ /// but has a List of IFieldHolder for children.
/// Field values are passed to and from children as well.
///
[Serializable()]
diff --git a/Greenshot/Drawing/Fields/Binding/DecimalDoublePercentageConverter.cs b/Greenshot/Drawing/Fields/Binding/DecimalDoublePercentageConverter.cs
index d7e92247f..9a0495f56 100644
--- a/Greenshot/Drawing/Fields/Binding/DecimalDoublePercentageConverter.cs
+++ b/Greenshot/Drawing/Fields/Binding/DecimalDoublePercentageConverter.cs
@@ -22,7 +22,7 @@ using System;
namespace Greenshot.Drawing.Fields.Binding {
///
- /// Converts decimal to double (%) and vice versa, e.g. 95f <---> 0.95d
+ /// Converts decimal to double (%) and vice versa, e.g. 95f to 0.95d
///
public class DecimalDoublePercentageConverter : AbstractBindingConverter
{
diff --git a/Greenshot/Drawing/Fields/FieldAggregator.cs b/Greenshot/Drawing/Fields/FieldAggregator.cs
index 7c2e7558f..748cf8576 100644
--- a/Greenshot/Drawing/Fields/FieldAggregator.cs
+++ b/Greenshot/Drawing/Fields/FieldAggregator.cs
@@ -23,7 +23,6 @@ using Greenshot.Configuration;
using Greenshot.IniFile;
using Greenshot.Plugin;
using Greenshot.Plugin.Drawing;
-using GreenshotPlugin.Interfaces;
using GreenshotPlugin.Interfaces.Drawing;
using log4net;
using System.Collections.Generic;
diff --git a/Greenshot/Drawing/Filters/AbstractFilter.cs b/Greenshot/Drawing/Filters/AbstractFilter.cs
index af9f8cb9f..e33aa0291 100644
--- a/Greenshot/Drawing/Filters/AbstractFilter.cs
+++ b/Greenshot/Drawing/Filters/AbstractFilter.cs
@@ -25,12 +25,12 @@ using System.Drawing;
using Greenshot.Drawing.Fields;
using Greenshot.Plugin.Drawing;
-///
-/// Graphical filter which can be added to DrawableContainer.
-/// Subclasses should fulfill INotifyPropertyChanged contract, i.e. call
-/// OnPropertyChanged whenever a public property has been changed.
-///
namespace Greenshot.Drawing.Filters {
+ ///
+ /// Graphical filter which can be added to DrawableContainer.
+ /// Subclasses should fulfill INotifyPropertyChanged contract, i.e. call
+ /// OnPropertyChanged whenever a public property has been changed.
+ ///
[Serializable()]
public abstract class AbstractFilter : AbstractFieldHolder, IFilter {
diff --git a/Greenshot/Drawing/StepLabelContainer.cs b/Greenshot/Drawing/StepLabelContainer.cs
index 08f6fbd01..fd1da0091 100644
--- a/Greenshot/Drawing/StepLabelContainer.cs
+++ b/Greenshot/Drawing/StepLabelContainer.cs
@@ -34,7 +34,7 @@ namespace Greenshot.Drawing {
/// To make sure that deleting recalculates, we check the location before every draw.
///
[Serializable]
- public class StepLabelContainer : DrawableContainer {
+ public sealed class StepLabelContainer : DrawableContainer {
[NonSerialized]
private StringFormat _stringFormat = new StringFormat();
@@ -103,7 +103,7 @@ namespace Greenshot.Drawing {
}
base.SwitchParent(newParent);
if (newParent != null) {
- ((Surface)Parent).AddStepLabel(this);
+ ((Surface)Parent)?.AddStepLabel(this);
}
}
@@ -207,8 +207,8 @@ namespace Greenshot.Drawing {
EllipseContainer.DrawEllipse(rect, graphics, rm, 0, Color.Transparent, fillColor, false);
}
using (FontFamily fam = new FontFamily(FontFamily.GenericSansSerif.Name)) {
- using (Font _font = new Font(fam, fontSize, FontStyle.Bold, GraphicsUnit.Pixel)) {
- TextContainer.DrawText(graphics, rect, 0, lineColor, false, _stringFormat, text, _font);
+ using (Font font = new Font(fam, fontSize, FontStyle.Bold, GraphicsUnit.Pixel)) {
+ TextContainer.DrawText(graphics, rect, 0, lineColor, false, _stringFormat, text, font);
}
}
}
diff --git a/Greenshot/Drawing/Surface.cs b/Greenshot/Drawing/Surface.cs
index 2ec781963..65d4adb35 100644
--- a/Greenshot/Drawing/Surface.cs
+++ b/Greenshot/Drawing/Surface.cs
@@ -46,7 +46,7 @@ namespace Greenshot.Drawing
///
/// Description of Surface.
///
- public class Surface : Control, ISurface
+ public sealed class Surface : Control, ISurface
{
private static ILog LOG = LogManager.GetLogger(typeof(Surface));
public static int Count = 0;
@@ -1609,6 +1609,7 @@ namespace Greenshot.Drawing
/// Element to remove
/// flag specifying if the remove needs to be undoable
/// flag specifying if an surface invalidate needs to be called
+ /// false to skip event generation
public void RemoveElement(IDrawableContainer elementToRemove, bool makeUndoable = true, bool invalidate = true, bool generateEvents = true)
{
DeselectElement(elementToRemove, generateEvents);
@@ -1639,7 +1640,6 @@ namespace Greenshot.Drawing
///
/// DrawableContainerList
/// true if the adding should be undoable
- /// true if invalidate needs to be called
public void AddElements(IDrawableContainerList elementsToAdd, bool makeUndoable = true)
{
// fix potential issues with iterating a changing list
@@ -1901,7 +1901,8 @@ namespace Greenshot.Drawing
///
/// Deselect the specified element
///
- ///
+ /// IDrawableContainerList
+ /// false to skip event generation
public void DeselectElement(IDrawableContainer container, bool generateEvents = true)
{
container.Selected = false;
@@ -1909,8 +1910,7 @@ namespace Greenshot.Drawing
FieldAggregator.UnbindElement(container);
if (generateEvents && _movingElementChanged != null)
{
- SurfaceElementEventArgs eventArgs = new SurfaceElementEventArgs();
- eventArgs.Elements = selectedElements;
+ SurfaceElementEventArgs eventArgs = new SurfaceElementEventArgs {Elements = selectedElements};
_movingElementChanged(this, eventArgs);
}
}
@@ -1918,7 +1918,7 @@ namespace Greenshot.Drawing
///
/// Deselect the specified elements
///
- ///
+ /// IDrawableContainerList
public void DeselectElements(IDrawableContainerList elements)
{
if (elements.Count == 0)
@@ -1951,6 +1951,8 @@ namespace Greenshot.Drawing
/// Select the supplied element
///
///
+ /// false to skip invalidation
+ /// false to skip event generation
public void SelectElement(IDrawableContainer container, bool invalidate = true, bool generateEvents = true)
{
if (!selectedElements.Contains(container))
diff --git a/Greenshot/Forms/ColorDialog.cs b/Greenshot/Forms/ColorDialog.cs
index 4891f6124..889b38f7f 100644
--- a/Greenshot/Forms/ColorDialog.cs
+++ b/Greenshot/Forms/ColorDialog.cs
@@ -235,7 +235,7 @@ namespace Greenshot {
#endregion
private void PipetteUsed(object sender, PipetteUsedArgs e) {
- Color = e.color;
+ Color = e.Color;
}
}
}
diff --git a/Greenshot/Forms/SettingsForm.cs b/Greenshot/Forms/SettingsForm.cs
index 567185e7b..c881960a0 100644
--- a/Greenshot/Forms/SettingsForm.cs
+++ b/Greenshot/Forms/SettingsForm.cs
@@ -114,7 +114,8 @@ namespace Greenshot {
/// with the items from the enumeration
///
/// ComboBox to populate
- /// Enum to populate with
+ ///
+ ///
private void PopulateComboBox(ComboBox comboBox, ET[] availableValues, ET selectedValue) where ET : struct {
comboBox.Items.Clear();
foreach(ET enumValue in availableValues) {
diff --git a/Greenshot/Forms/ToolStripMenuSelectList.cs b/Greenshot/Forms/ToolStripMenuSelectList.cs
index 0b42181cf..ab6ddb071 100644
--- a/Greenshot/Forms/ToolStripMenuSelectList.cs
+++ b/Greenshot/Forms/ToolStripMenuSelectList.cs
@@ -200,12 +200,11 @@ namespace Greenshot.Forms {
}
- //
+ ///
/// adds an item to the select list
///
/// the label to be displayed
/// the icon to be displayed
- /// whether the item is initially selected
/// whether the item is initially checked
public void AddItem(string label, Image image, bool isChecked) {
AddItem(label, image, null, isChecked);
diff --git a/Greenshot/Helpers/CaptureHelper.cs b/Greenshot/Helpers/CaptureHelper.cs
index e70685a93..9142cb0df 100644
--- a/Greenshot/Helpers/CaptureHelper.cs
+++ b/Greenshot/Helpers/CaptureHelper.cs
@@ -209,7 +209,7 @@ namespace Greenshot.Helpers {
///
/// Make Capture for region
///
- /// filename
+ /// Rectangle
private void MakeCapture(Rectangle region) {
_captureRect = region;
MakeCapture();
diff --git a/Greenshot/Helpers/DestinationHelper.cs b/Greenshot/Helpers/DestinationHelper.cs
index bdb8ad64c..fd13e3d38 100644
--- a/Greenshot/Helpers/DestinationHelper.cs
+++ b/Greenshot/Helpers/DestinationHelper.cs
@@ -75,7 +75,7 @@ namespace Greenshot.Helpers {
///
/// Method to get all the destinations from the plugins
///
- /// List
+ /// List of IDestination
private static List GetPluginDestinations() {
List destinations = new List();
foreach (PluginAttribute pluginAttribute in PluginHelper.Instance.Plugins.Keys) {
@@ -130,6 +130,7 @@ namespace Greenshot.Helpers {
///
/// A simple helper method which will call ExportCapture for the destination with the specified designation
///
+ ///
///
///
///
diff --git a/Greenshot/Helpers/IECaptureHelper.cs b/Greenshot/Helpers/IECaptureHelper.cs
index 805afb0f1..0511cb05c 100644
--- a/Greenshot/Helpers/IECaptureHelper.cs
+++ b/Greenshot/Helpers/IECaptureHelper.cs
@@ -125,7 +125,7 @@ namespace Greenshot.Helpers {
///
/// Gets a list of all IE Windows & tabs with the captions of the instances
///
- /// List>
+ /// List with KeyValuePair of WindowDetails and string
public static List> GetBrowserTabs() {
List ieHandleList = new List();
Dictionary> browserWindows = new Dictionary>();
@@ -217,7 +217,6 @@ namespace Greenshot.Helpers {
/// or return the first if none is supplied.
///
/// The WindowDetails to get the IHTMLDocument2 for
- /// Ref to the IHTMLDocument2 to return
/// The WindowDetails to which the IHTMLDocument2 belongs
private static DocumentContainer CreateDocumentContainer(WindowDetails browserWindow) {
DocumentContainer returnDocumentContainer = null;
@@ -587,8 +586,9 @@ namespace Greenshot.Helpers {
///
/// This method takes the actual capture of the document (frame)
///
- ///
+ /// DocumentContainer
/// Needed for referencing the location of the frame
+ /// Graphics
/// Bitmap with the capture
private static void DrawDocument(DocumentContainer documentContainer, WindowDetails contentWindowDetails, Graphics graphicsTarget) {
documentContainer.SetAttribute("scroll", 1);
diff --git a/Greenshot/Helpers/MailHelper.cs b/Greenshot/Helpers/MailHelper.cs
index 79d1c0267..f8cb29ae6 100644
--- a/Greenshot/Helpers/MailHelper.cs
+++ b/Greenshot/Helpers/MailHelper.cs
@@ -35,7 +35,7 @@ namespace Greenshot.Helpers {
///
/// Author: Andrew Baker
/// Datum: 10.03.2006
- /// Available from: http://www.vbusers.com/codecsharp/codeget.asp?ThreadID=71&PostID=1
+ /// Available from here
///
#region Public MapiMailMessage Class
diff --git a/Greenshot/Helpers/SoundHelper.cs b/Greenshot/Helpers/SoundHelper.cs
index fe36cbb56..1f3d6b8ec 100644
--- a/Greenshot/Helpers/SoundHelper.cs
+++ b/Greenshot/Helpers/SoundHelper.cs
@@ -27,15 +27,13 @@ using GreenshotPlugin.UnmanagedHelpers;
using GreenshotPlugin.Core;
using Greenshot.IniFile;
using System.IO;
-///
-/// Create to fix the sometimes wrongly played sample, especially after first start from IDE
-/// See: http://www.codeproject.com/KB/audio-video/soundplayerbug.aspx?msg=2487569
-///
+
using log4net;
namespace Greenshot.Helpers {
///
- /// Description of SoundHelper.
+ /// Create to fix the sometimes wrongly played sample, especially after first start from IDE
+ /// See: http://www.codeproject.com/KB/audio-video/soundplayerbug.aspx?msg=2487569
///
public static class SoundHelper {
private static readonly ILog LOG = LogManager.GetLogger(typeof(SoundHelper));
diff --git a/Greenshot/Languages/help-de-DE.html b/Greenshot/Languages/help-de-DE.html
index 8491ba3f2..f2228ee42 100644
--- a/Greenshot/Languages/help-de-DE.html
+++ b/Greenshot/Languages/help-de-DE.html
@@ -84,7 +84,7 @@
Mit Hilfe der Leertaste können Sie vom Bereichsmodus in den
- Fenstermodus wechseln (und umgekehrt).
+ Fenstermodus wechseln (und umgekehrt).
Wenn Sie einen exakten Bereich abfotografieren, ist es eventuell einfacher, zuerst
diff --git a/Greenshot/Languages/help-es-ES.html b/Greenshot/Languages/help-es-ES.html
index 43437a96a..e248bd90a 100644
--- a/Greenshot/Languages/help-es-ES.html
+++ b/Greenshot/Languages/help-es-ES.html
@@ -168,7 +168,7 @@
Usted puede mover o redimensionar formas existentes después de elegir la
- Herramienta de Selección ESC desde la barra de herramientas.
Herramienta de Selección ESC desde la barra de herramientas.
Para cada tipo de elemento hay un conjunto específico de opciones disponibles
para cambiar la apariencia del elemento (por ej. grosor de la línea, color
de la línea, color de relleno). Usted puede cambiar las opciones para un
diff --git a/Greenshot/Languages/help-it-IT.html b/Greenshot/Languages/help-it-IT.html
index 7d0d69e3b..1d5744287 100644
--- a/Greenshot/Languages/help-it-IT.html
+++ b/Greenshot/Languages/help-it-IT.html
@@ -335,7 +335,6 @@
Stampa con colori inverititi (negativo): Trasformerà l'immagine in negativo prima di stamparla, utile per esempio quando si stampa un'immagine con testo bianco su sfondo nero (per risparmiare toner o inchiostro).
Visualizza scelta opzioni di stampa ogni volta che si stampa un'immagine: Permette di scegliere se visualizzare o meno la finestra di scelta opzioni per le stampe successive alla prima.
-
Impostazioni Componenti Aggiuntivi
diff --git a/Greenshot/Languages/help-ru-RU.html b/Greenshot/Languages/help-ru-RU.html
index f04d2548d..33eb7d114 100644
--- a/Greenshot/Languages/help-ru-RU.html
+++ b/Greenshot/Languages/help-ru-RU.html
@@ -23,7 +23,7 @@
- Version 0.8
Содержание
diff --git a/Greenshot/Languages/help-sv-SE.html b/Greenshot/Languages/help-sv-SE.html
index 5225f0797..cdff974f1 100644
--- a/Greenshot/Languages/help-sv-SE.html
+++ b/Greenshot/Languages/help-sv-SE.html
@@ -316,7 +316,7 @@
Som standard lter Greenshot dig vlja en destination dynamiskt efter en skrmdump, genom att visa en liten meny med olika destinationer att vlja mellan. Om du inte vill eller behver vlja mellan destinationer direkt kanske du fredrar att konfigurera Greenshot till att exportera till en eller fler destinationer direkt, utan att visa destinationsvljaren.
- Liksom exportering frn redigerarfnstret kommer de visade destinationerna variera baserat p de insticksprogram du har installerade med Greenshot.
+ Liksom exportering frn redigerarfnstret kommer de visade destinationerna variera baserat p de insticksprogram du har installerade med Greenshot.
diff --git a/Greenshot/Memento/AddElementMemento.cs b/Greenshot/Memento/AddElementMemento.cs
index 493539bb7..873408071 100644
--- a/Greenshot/Memento/AddElementMemento.cs
+++ b/Greenshot/Memento/AddElementMemento.cs
@@ -19,7 +19,6 @@
* along with this program. If not, see .
*/
using System;
-using Greenshot.Configuration;
using Greenshot.Drawing;
using Greenshot.Plugin.Drawing;
diff --git a/Greenshot/Memento/DeleteElementMemento.cs b/Greenshot/Memento/DeleteElementMemento.cs
index ed7350243..e73700901 100644
--- a/Greenshot/Memento/DeleteElementMemento.cs
+++ b/Greenshot/Memento/DeleteElementMemento.cs
@@ -19,7 +19,6 @@
* along with this program. If not, see .
*/
using System;
-using Greenshot.Configuration;
using Greenshot.Drawing;
using Greenshot.Plugin.Drawing;
diff --git a/Greenshot/Memento/SurfaceBackgroundChangeMemento.cs b/Greenshot/Memento/SurfaceBackgroundChangeMemento.cs
index 13b3da9ea..ae5c2e07f 100644
--- a/Greenshot/Memento/SurfaceBackgroundChangeMemento.cs
+++ b/Greenshot/Memento/SurfaceBackgroundChangeMemento.cs
@@ -19,9 +19,7 @@
* along with this program. If not, see .
*/
-using Greenshot.Configuration;
using Greenshot.Drawing;
-using System;
using System.Drawing;
using System.Drawing.Drawing2D;
diff --git a/Greenshot/Memento/TextChangeMemento.cs b/Greenshot/Memento/TextChangeMemento.cs
index 973f59c94..dab958704 100644
--- a/Greenshot/Memento/TextChangeMemento.cs
+++ b/Greenshot/Memento/TextChangeMemento.cs
@@ -18,9 +18,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-using System;
+
using Greenshot.Drawing;
-using Greenshot.Configuration;
namespace Greenshot.Memento {
///
diff --git a/GreenshotBoxPlugin/BoxConfiguration.cs b/GreenshotBoxPlugin/BoxConfiguration.cs
index 5c42cb1a5..1707b1080 100644
--- a/GreenshotBoxPlugin/BoxConfiguration.cs
+++ b/GreenshotBoxPlugin/BoxConfiguration.cs
@@ -31,30 +31,21 @@ namespace GreenshotBoxPlugin {
[IniSection("Box", Description = "Greenshot Box Plugin configuration")]
public class BoxConfiguration : IniSection {
[IniProperty("UploadFormat", Description="What file type to use for uploading", DefaultValue="png")]
- public OutputFormat UploadFormat;
+ public OutputFormat UploadFormat { get; set; }
[IniProperty("UploadJpegQuality", Description="JPEG file save quality in %.", DefaultValue="80")]
- public int UploadJpegQuality;
+ public int UploadJpegQuality { get; set; }
[IniProperty("AfterUploadLinkToClipBoard", Description = "After upload send Box link to clipboard.", DefaultValue = "true")]
- public bool AfterUploadLinkToClipBoard;
+ public bool AfterUploadLinkToClipBoard { get; set; }
[IniProperty("UseSharedLink", Description = "Use the shared link, instead of the private, on the clipboard", DefaultValue = "True")]
- public bool UseSharedLink {
- get;
- set;
- }
+ public bool UseSharedLink { get; set; }
[IniProperty("FolderId", Description = "Folder ID to upload to, only change if you know what you are doing!", DefaultValue = "0")]
- public string FolderId {
- get;
- set;
- }
+ public string FolderId { get; set; }
[IniProperty("RefreshToken", Description = "Box authorization refresh Token", Encrypted = true)]
- public string RefreshToken {
- get;
- set;
- }
+ public string RefreshToken { get; set; }
///
/// Not stored
diff --git a/GreenshotBoxPlugin/BoxPlugin.cs b/GreenshotBoxPlugin/BoxPlugin.cs
index 6131a4654..2e8a40719 100644
--- a/GreenshotBoxPlugin/BoxPlugin.cs
+++ b/GreenshotBoxPlugin/BoxPlugin.cs
@@ -105,16 +105,6 @@ namespace GreenshotBoxPlugin {
_config.ShowConfigDialog();
}
- ///
- /// This will be called when Greenshot is shutting down
- ///
- ///
- ///
- public void Closing(object sender, FormClosingEventArgs e) {
- LOG.Debug("Application closing, de-registering Box Plugin!");
- Shutdown();
- }
-
public void ConfigMenuClick(object sender, EventArgs eventArgs) {
_config.ShowConfigDialog();
}
diff --git a/GreenshotConfluencePlugin/Confluence.cs b/GreenshotConfluencePlugin/Confluence.cs
index 8b4f3958b..128e30e01 100644
--- a/GreenshotConfluencePlugin/Confluence.cs
+++ b/GreenshotConfluencePlugin/Confluence.cs
@@ -26,22 +26,18 @@ using GreenshotConfluencePlugin;
using GreenshotConfluencePlugin.confluence;
using GreenshotPlugin.Core;
-///
-/// For details see the Confluence API site
-/// See: http://confluence.atlassian.com/display/CONFDEV/Remote+API+Specification
-///
namespace Confluence {
#region transport classes
public class Page {
public Page(RemotePage page) {
- id = page.id;
+ Id = page.id;
Title = page.title;
SpaceKey = page.space;
Url = page.url;
Content = page.content;
}
public Page(RemoteSearchResult searchResult, string space) {
- id = searchResult.id;
+ Id = searchResult.id;
Title = searchResult.title;
SpaceKey = space;
Url = searchResult.url;
@@ -49,12 +45,12 @@ namespace Confluence {
}
public Page(RemotePageSummary pageSummary) {
- id = pageSummary.id;
+ Id = pageSummary.id;
Title = pageSummary.title;
SpaceKey = pageSummary.space;
Url =pageSummary.url;
}
- public long id {
+ public long Id {
get;
set;
}
@@ -91,46 +87,52 @@ namespace Confluence {
}
#endregion
+ ///
+ /// For details see the Confluence API site
+ /// See: http://confluence.atlassian.com/display/CONFDEV/Remote+API+Specification
+ ///
public class ConfluenceConnector : IDisposable {
- private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ConfluenceConnector));
- private const string AUTH_FAILED_EXCEPTION_NAME = "com.atlassian.confluence.rpc.AuthenticationFailedException";
- private const string V2_FAILED = "AXIS";
- private static readonly ConfluenceConfiguration config = IniConfig.GetIniSection();
- private string credentials = null;
- private DateTime loggedInTime = DateTime.Now;
- private bool loggedIn = false;
- private ConfluenceSoapServiceService confluence;
- private readonly int timeout;
- private string url;
- private readonly Cache pageCache = new Cache(60 * config.Timeout);
+ private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(ConfluenceConnector));
+ private const string AuthFailedExceptionName = "com.atlassian.confluence.rpc.AuthenticationFailedException";
+ private const string V2Failed = "AXIS";
+ private static readonly ConfluenceConfiguration Config = IniConfig.GetIniSection();
+ private string _credentials;
+ private DateTime _loggedInTime = DateTime.Now;
+ private bool _loggedIn;
+ private ConfluenceSoapServiceService _confluence;
+ private readonly int _timeout;
+ private string _url;
+ private readonly Cache _pageCache = new Cache(60 * Config.Timeout);
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
- protected virtual void Dispose(bool disposing) {
- if (confluence != null) {
- logout();
+ protected void Dispose(bool disposing) {
+ if (_confluence != null) {
+ Logout();
}
if (disposing) {
- if (confluence != null) {
- confluence.Dispose();
- confluence = null;
+ if (_confluence != null) {
+ _confluence.Dispose();
+ _confluence = null;
}
}
}
public ConfluenceConnector(string url, int timeout) {
- this.timeout = timeout;
- init(url);
+ _timeout = timeout;
+ Init(url);
}
- private void init(string url) {
- this.url = url;
- confluence = new ConfluenceSoapServiceService();
- confluence.Url = url;
- confluence.Proxy = NetworkHelper.CreateProxy(new Uri(url));
+ private void Init(string url) {
+ _url = url;
+ _confluence = new ConfluenceSoapServiceService
+ {
+ Url = url,
+ Proxy = NetworkHelper.CreateProxy(new Uri(url))
+ };
}
~ConfluenceConnector() {
@@ -141,41 +143,43 @@ namespace Confluence {
/// Internal login which catches the exceptions
///
/// true if login was done sucessfully
- private bool doLogin(string user, string password) {
+ private bool DoLogin(string user, string password) {
try {
- credentials = confluence.login(user, password);
- loggedInTime = DateTime.Now;
- loggedIn = true;
+ _credentials = _confluence.login(user, password);
+ _loggedInTime = DateTime.Now;
+ _loggedIn = true;
} catch (Exception e) {
// Check if confluence-v2 caused an error, use v1 instead
- if (e.Message.Contains(V2_FAILED) && url.Contains("v2")) {
- init(url.Replace("v2", "v1"));
- return doLogin(user, password);
+ if (e.Message.Contains(V2Failed) && _url.Contains("v2")) {
+ Init(_url.Replace("v2", "v1"));
+ return DoLogin(user, password);
}
// check if auth failed
- if (e.Message.Contains(AUTH_FAILED_EXCEPTION_NAME)) {
+ if (e.Message.Contains(AuthFailedExceptionName)) {
return false;
}
// Not an authentication issue
- loggedIn = false;
- credentials = null;
+ _loggedIn = false;
+ _credentials = null;
e.Data.Add("user", user);
- e.Data.Add("url", url);
+ e.Data.Add("url", _url);
throw;
}
return true;
}
- public void login() {
- logout();
+ public void Login() {
+ Logout();
try {
// Get the system name, so the user knows where to login to
- string systemName = url.Replace(ConfluenceConfiguration.DEFAULT_POSTFIX1,"");
- systemName = url.Replace(ConfluenceConfiguration.DEFAULT_POSTFIX2, "");
- CredentialsDialog dialog = new CredentialsDialog(systemName);
- dialog.Name = null;
+ string systemName = _url.Replace(ConfluenceConfiguration.DEFAULT_POSTFIX1,"");
+ systemName = systemName.Replace(ConfluenceConfiguration.DEFAULT_POSTFIX2, "");
+ CredentialsDialog dialog = new CredentialsDialog(systemName)
+ {
+ Name = null
+ };
while (dialog.Show(dialog.Name) == DialogResult.OK) {
- if (doLogin(dialog.Name, dialog.Password)) {
+ if (DoLogin(dialog.Name, dialog.Password)) {
if (dialog.SaveChecked) {
dialog.Confirm(true);
}
@@ -185,7 +189,7 @@ namespace Confluence {
dialog.Confirm(false);
} catch (ApplicationException e) {
// exception handling ...
- LOG.Error("Problem using the credentials dialog", e);
+ Log.Error("Problem using the credentials dialog", e);
}
// For every windows version after XP show an incorrect password baloon
dialog.IncorrectPassword = true;
@@ -195,119 +199,119 @@ namespace Confluence {
}
} catch (ApplicationException e) {
// exception handling ...
- LOG.Error("Problem using the credentials dialog", e);
+ Log.Error("Problem using the credentials dialog", e);
}
}
- public void logout() {
- if (credentials != null) {
- confluence.logout(credentials);
- credentials = null;
- loggedIn = false;
+ public void Logout() {
+ if (_credentials != null) {
+ _confluence.logout(_credentials);
+ _credentials = null;
+ _loggedIn = false;
}
}
- private void checkCredentials() {
- if (loggedIn) {
- if (loggedInTime.AddMinutes(timeout-1).CompareTo(DateTime.Now) < 0) {
- logout();
- login();
+ private void CheckCredentials() {
+ if (_loggedIn) {
+ if (_loggedInTime.AddMinutes(_timeout-1).CompareTo(DateTime.Now) < 0) {
+ Logout();
+ Login();
}
} else {
- login();
+ Login();
}
}
- public bool isLoggedIn {
+ public bool IsLoggedIn {
get {
- return loggedIn;
+ return _loggedIn;
}
}
- public void addAttachment(long pageId, string mime, string comment, string filename, IBinaryContainer image) {
- checkCredentials();
+ public void AddAttachment(long pageId, string mime, string comment, string filename, IBinaryContainer image) {
+ CheckCredentials();
RemoteAttachment attachment = new RemoteAttachment();
// Comment is ignored, see: http://jira.atlassian.com/browse/CONF-9395
attachment.comment = comment;
attachment.fileName = filename;
attachment.contentType = mime;
- confluence.addAttachment(credentials, pageId, attachment, image.ToByteArray());
+ _confluence.addAttachment(_credentials, pageId, attachment, image.ToByteArray());
}
- public Page getPage(string spaceKey, string pageTitle) {
+ public Page GetPage(string spaceKey, string pageTitle) {
RemotePage page = null;
string cacheKey = spaceKey + pageTitle;
- if (pageCache.Contains(cacheKey)) {
- page = pageCache[cacheKey];
+ if (_pageCache.Contains(cacheKey)) {
+ page = _pageCache[cacheKey];
}
if (page == null) {
- checkCredentials();
- page = confluence.getPage(credentials, spaceKey, pageTitle);
- pageCache.Add(cacheKey, page);
+ CheckCredentials();
+ page = _confluence.getPage(_credentials, spaceKey, pageTitle);
+ _pageCache.Add(cacheKey, page);
}
return new Page(page);
}
- public Page getPage(long pageId) {
+ public Page GetPage(long pageId) {
RemotePage page = null;
string cacheKey = "" + pageId;
- if (pageCache.Contains(cacheKey)) {
- page = pageCache[cacheKey];
+ if (_pageCache.Contains(cacheKey)) {
+ page = _pageCache[cacheKey];
}
if (page == null) {
- checkCredentials();
- page = confluence.getPage(credentials, pageId);
- pageCache.Add(cacheKey, page);
+ CheckCredentials();
+ page = _confluence.getPage(_credentials, pageId);
+ _pageCache.Add(cacheKey, page);
}
return new Page(page);
}
- public Page getSpaceHomepage(Space spaceSummary) {
- checkCredentials();
- RemoteSpace spaceDetail = confluence.getSpace(credentials, spaceSummary.Key);
- RemotePage page = confluence.getPage(credentials, spaceDetail.homePage);
+ public Page GetSpaceHomepage(Space spaceSummary) {
+ CheckCredentials();
+ RemoteSpace spaceDetail = _confluence.getSpace(_credentials, spaceSummary.Key);
+ RemotePage page = _confluence.getPage(_credentials, spaceDetail.homePage);
return new Page(page);
}
- public List getSpaceSummaries() {
- checkCredentials();
- RemoteSpaceSummary [] spaces = confluence.getSpaces(credentials);
+ public List GetSpaceSummaries() {
+ CheckCredentials();
+ RemoteSpaceSummary [] spaces = _confluence.getSpaces(_credentials);
List returnSpaces = new List();
foreach(RemoteSpaceSummary space in spaces) {
returnSpaces.Add(new Space(space));
}
- returnSpaces.Sort((x, y) => string.Compare(x.Name, y.Name));
+ returnSpaces.Sort((x, y) => string.CompareOrdinal(x.Name, y.Name));
return returnSpaces;
}
- public List getPageChildren(Page parentPage) {
- checkCredentials();
+ public List GetPageChildren(Page parentPage) {
+ CheckCredentials();
List returnPages = new List();
- RemotePageSummary[] pages = confluence.getChildren(credentials, parentPage.id);
+ RemotePageSummary[] pages = _confluence.getChildren(_credentials, parentPage.Id);
foreach(RemotePageSummary page in pages) {
returnPages.Add(new Page(page));
}
- returnPages.Sort((x, y) => string.Compare(x.Title, y.Title));
+ returnPages.Sort((x, y) => string.CompareOrdinal(x.Title, y.Title));
return returnPages;
}
- public List getPageSummaries(Space space) {
- checkCredentials();
+ public List GetPageSummaries(Space space) {
+ CheckCredentials();
List returnPages = new List();
- RemotePageSummary[] pages = confluence.getPages(credentials, space.Key);
+ RemotePageSummary[] pages = _confluence.getPages(_credentials, space.Key);
foreach(RemotePageSummary page in pages) {
returnPages.Add(new Page(page));
}
- returnPages.Sort((x, y) => string.Compare(x.Title, y.Title));
+ returnPages.Sort((x, y) => string.CompareOrdinal(x.Title, y.Title));
return returnPages;
}
- public List searchPages(string query, string space) {
- checkCredentials();
+ public List SearchPages(string query, string space) {
+ CheckCredentials();
List results = new List();
- foreach(RemoteSearchResult searchResult in confluence.search(credentials, query, 20)) {
- LOG.DebugFormat("Got result of type {0}", searchResult.type);
+ foreach(RemoteSearchResult searchResult in _confluence.search(_credentials, query, 20)) {
+ Log.DebugFormat("Got result of type {0}", searchResult.type);
if ("page".Equals(searchResult.type)) {
results.Add(new Page(searchResult, space));
}
diff --git a/GreenshotConfluencePlugin/ConfluenceDestination.cs b/GreenshotConfluencePlugin/ConfluenceDestination.cs
index 8765ecba9..18612c525 100644
--- a/GreenshotConfluencePlugin/ConfluenceDestination.cs
+++ b/GreenshotConfluencePlugin/ConfluenceDestination.cs
@@ -102,7 +102,7 @@ namespace GreenshotConfluencePlugin {
}
public override IEnumerable DynamicDestinations() {
- if (ConfluencePlugin.ConfluenceConnectorNoLogin == null || !ConfluencePlugin.ConfluenceConnectorNoLogin.isLoggedIn) {
+ if (ConfluencePlugin.ConfluenceConnectorNoLogin == null || !ConfluencePlugin.ConfluenceConnectorNoLogin.IsLoggedIn) {
yield break;
}
List currentPages = ConfluenceUtils.GetCurrentPages();
@@ -117,7 +117,7 @@ namespace GreenshotConfluencePlugin {
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(Designation, Description);
// force password check to take place before the pages load
- if (!ConfluencePlugin.ConfluenceConnector.isLoggedIn) {
+ if (!ConfluencePlugin.ConfluenceConnector.IsLoggedIn) {
return exportInformation;
}
@@ -129,7 +129,7 @@ namespace GreenshotConfluencePlugin {
Nullable dialogResult = confluenceUpload.ShowDialog();
if (dialogResult.HasValue && dialogResult.Value) {
selectedPage = confluenceUpload.SelectedPage;
- if (confluenceUpload.isOpenPageSelected) {
+ if (confluenceUpload.IsOpenPageSelected) {
openPage = false;
}
filename = confluenceUpload.Filename;
@@ -164,7 +164,7 @@ namespace GreenshotConfluencePlugin {
try {
new PleaseWaitForm().ShowAndWait(Description, Language.GetString("confluence", LangKey.communication_wait),
delegate() {
- ConfluencePlugin.ConfluenceConnector.addAttachment(page.id, "image/" + config.UploadFormat.ToString().ToLower(), null, filename, new SurfaceContainer(surfaceToUpload, outputSettings, filename));
+ ConfluencePlugin.ConfluenceConnector.AddAttachment(page.Id, "image/" + config.UploadFormat.ToString().ToLower(), null, filename, new SurfaceContainer(surfaceToUpload, outputSettings, filename));
}
);
LOG.Debug("Uploaded to Confluence.");
diff --git a/GreenshotConfluencePlugin/ConfluencePlugin.cs b/GreenshotConfluencePlugin/ConfluencePlugin.cs
index c8a86ec20..4f1c7224e 100644
--- a/GreenshotConfluencePlugin/ConfluencePlugin.cs
+++ b/GreenshotConfluencePlugin/ConfluencePlugin.cs
@@ -68,8 +68,8 @@ namespace GreenshotConfluencePlugin {
CreateConfluenceConntector();
}
try {
- if (_confluenceConnector != null && !_confluenceConnector.isLoggedIn) {
- _confluenceConnector.login();
+ if (_confluenceConnector != null && !_confluenceConnector.IsLoggedIn) {
+ _confluenceConnector.Login();
}
} catch (Exception e) {
MessageBox.Show(Language.GetFormattedString("confluence", LangKey.login_error, e.Message));
@@ -112,7 +112,7 @@ namespace GreenshotConfluencePlugin {
public virtual void Shutdown() {
LOG.Debug("Confluence Plugin shutdown.");
if (_confluenceConnector != null) {
- _confluenceConnector.logout();
+ _confluenceConnector.Logout();
_confluenceConnector = null;
}
}
@@ -131,8 +131,8 @@ namespace GreenshotConfluencePlugin {
IniConfig.Save();
if (_confluenceConnector != null) {
if (!url.Equals(_config.Url)) {
- if (_confluenceConnector.isLoggedIn) {
- _confluenceConnector.logout();
+ if (_confluenceConnector.IsLoggedIn) {
+ _confluenceConnector.Logout();
}
_confluenceConnector = null;
}
diff --git a/GreenshotConfluencePlugin/ConfluenceUtils.cs b/GreenshotConfluencePlugin/ConfluenceUtils.cs
index f7d95c145..6f699e8f1 100644
--- a/GreenshotConfluencePlugin/ConfluenceUtils.cs
+++ b/GreenshotConfluencePlugin/ConfluenceUtils.cs
@@ -50,14 +50,14 @@ namespace GreenshotConfluencePlugin {
try {
bool pageDouble = false;
foreach(Confluence.Page page in pages) {
- if (page.id == pageId) {
+ if (page.Id == pageId) {
pageDouble = true;
LOG.DebugFormat("Skipping double page with ID {0}", pageId);
break;
}
}
if (!pageDouble) {
- Confluence.Page page = ConfluencePlugin.ConfluenceConnector.getPage(pageId);
+ Confluence.Page page = ConfluencePlugin.ConfluenceConnector.GetPage(pageId);
LOG.DebugFormat("Adding page {0}", page.Title);
pages.Add(page);
}
@@ -89,7 +89,7 @@ namespace GreenshotConfluencePlugin {
}
}
if (!pageDouble) {
- Confluence.Page page = ConfluencePlugin.ConfluenceConnector.getPage(space, title);
+ Confluence.Page page = ConfluencePlugin.ConfluenceConnector.GetPage(space, title);
LOG.DebugFormat("Adding page {0}", page.Title);
pages.Add(page);
diff --git a/GreenshotConfluencePlugin/Forms/ConfluencePagePicker.xaml b/GreenshotConfluencePlugin/Forms/ConfluencePagePicker.xaml
index 4fe9f18e6..6455e86b5 100644
--- a/GreenshotConfluencePlugin/Forms/ConfluencePagePicker.xaml
+++ b/GreenshotConfluencePlugin/Forms/ConfluencePagePicker.xaml
@@ -1,7 +1,7 @@
+ Loaded="Page_Loaded">
diff --git a/GreenshotConfluencePlugin/Forms/ConfluencePagePicker.xaml.cs b/GreenshotConfluencePlugin/Forms/ConfluencePagePicker.xaml.cs
index 31c236cf3..5eb08f4eb 100644
--- a/GreenshotConfluencePlugin/Forms/ConfluencePagePicker.xaml.cs
+++ b/GreenshotConfluencePlugin/Forms/ConfluencePagePicker.xaml.cs
@@ -44,7 +44,7 @@ namespace GreenshotConfluencePlugin {
if (PageListView.HasItems && PageListView.SelectedItems.Count > 0) {
confluenceUpload.SelectedPage = (Page)PageListView.SelectedItem;
// Make sure the uploader knows we selected an already opened page
- confluenceUpload.isOpenPageSelected = true;
+ confluenceUpload.IsOpenPageSelected = true;
} else {
confluenceUpload.SelectedPage = null;
}
diff --git a/GreenshotConfluencePlugin/Forms/ConfluenceSearch.xaml.cs b/GreenshotConfluencePlugin/Forms/ConfluenceSearch.xaml.cs
index 2f7f59362..01b6e0526 100644
--- a/GreenshotConfluencePlugin/Forms/ConfluenceSearch.xaml.cs
+++ b/GreenshotConfluencePlugin/Forms/ConfluenceSearch.xaml.cs
@@ -77,7 +77,7 @@ namespace GreenshotConfluencePlugin {
void doSearch() {
string spaceKey = (string)SpaceComboBox.SelectedValue;
config.SearchSpaceKey = spaceKey;
- List searchResult = ConfluencePlugin.ConfluenceConnector.searchPages(searchText.Text, spaceKey);
+ List searchResult = ConfluencePlugin.ConfluenceConnector.SearchPages(searchText.Text, spaceKey);
pages.Clear();
foreach(Confluence.Page page in searchResult) {
pages.Add(page);
diff --git a/GreenshotConfluencePlugin/Forms/ConfluenceTreePicker.xaml.cs b/GreenshotConfluencePlugin/Forms/ConfluenceTreePicker.xaml.cs
index 214c1f315..36d32ec7d 100644
--- a/GreenshotConfluencePlugin/Forms/ConfluenceTreePicker.xaml.cs
+++ b/GreenshotConfluencePlugin/Forms/ConfluenceTreePicker.xaml.cs
@@ -58,7 +58,7 @@ namespace GreenshotConfluencePlugin {
LOG.Debug("Loading pages for page: " + page.Title);
(new Thread(() => {
Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)(() => {ShowBusy.Visibility = Visibility.Visible;}));
- List pages = confluenceConnector.getPageChildren(page);
+ List pages = confluenceConnector.GetPageChildren(page);
Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)(() => {
foreach(Confluence.Page childPage in pages) {
LOG.Debug("Adding page: " + childPage.Title);
@@ -105,7 +105,7 @@ namespace GreenshotConfluencePlugin {
// Get homepage
try {
- Confluence.Page page = confluenceConnector.getSpaceHomepage(space);
+ Confluence.Page page = confluenceConnector.GetSpaceHomepage(space);
TreeViewItem pageTreeViewItem = new TreeViewItem();
pageTreeViewItem.Header = page.Title;
pageTreeViewItem.Tag = page;
diff --git a/GreenshotConfluencePlugin/Forms/ConfluenceUpload.xaml.cs b/GreenshotConfluencePlugin/Forms/ConfluenceUpload.xaml.cs
index d9783fc6e..026990847 100644
--- a/GreenshotConfluencePlugin/Forms/ConfluenceUpload.xaml.cs
+++ b/GreenshotConfluencePlugin/Forms/ConfluenceUpload.xaml.cs
@@ -29,56 +29,56 @@ namespace GreenshotConfluencePlugin {
/// Interaction logic for ConfluenceUpload.xaml
///
public partial class ConfluenceUpload : Window {
- private Page pickerPage = null;
+ private Page _pickerPage;
public Page PickerPage {
get {
- if (pickerPage == null) {
+ if (_pickerPage == null) {
List pages = ConfluenceUtils.GetCurrentPages();
if (pages != null && pages.Count > 0) {
- pickerPage = new ConfluencePagePicker(this, pages);
+ _pickerPage = new ConfluencePagePicker(this, pages);
}
}
- return pickerPage;
+ return _pickerPage;
}
}
- private Page searchPage = null;
+ private Page _searchPage;
public Page SearchPage {
get {
- if (searchPage == null) {
- searchPage = new ConfluenceSearch(this);
+ if (_searchPage == null) {
+ _searchPage = new ConfluenceSearch(this);
}
- return searchPage;
+ return _searchPage;
}
}
- private Page browsePage = null;
+ private Page _browsePage;
public Page BrowsePage {
get {
- if (browsePage == null) {
- browsePage = new ConfluenceTreePicker(this);
+ if (_browsePage == null) {
+ _browsePage = new ConfluenceTreePicker(this);
}
- return browsePage;
+ return _browsePage;
}
}
- private Confluence.Page selectedPage = null;
+ private Confluence.Page _selectedPage;
public Confluence.Page SelectedPage {
get {
- return selectedPage;
+ return _selectedPage;
}
set {
- selectedPage = value;
- if (selectedPage != null) {
+ _selectedPage = value;
+ if (_selectedPage != null) {
Upload.IsEnabled = true;
} else {
Upload.IsEnabled = false;
}
- isOpenPageSelected = false;
+ IsOpenPageSelected = false;
}
}
- public bool isOpenPageSelected {
+ public bool IsOpenPageSelected {
get;
set;
}
@@ -87,39 +87,39 @@ namespace GreenshotConfluencePlugin {
set;
}
- private static DateTime lastLoad = DateTime.Now;
- private static List spaces;
+ private static DateTime _lastLoad = DateTime.Now;
+ private static List _spaces;
public List Spaces {
get {
- updateSpaces();
- while (spaces == null) {
+ UpdateSpaces();
+ while (_spaces == null) {
Thread.Sleep(300);
}
- return spaces;
+ return _spaces;
}
}
public ConfluenceUpload(string filename) {
Filename = filename;
InitializeComponent();
- this.DataContext = this;
- updateSpaces();
+ DataContext = this;
+ UpdateSpaces();
if (PickerPage == null) {
PickerTab.Visibility = Visibility.Collapsed;
SearchTab.IsSelected = true;
}
}
- void updateSpaces() {
- if (spaces != null && DateTime.Now.AddMinutes(-60).CompareTo(lastLoad) > 0) {
+ void UpdateSpaces() {
+ if (_spaces != null && DateTime.Now.AddMinutes(-60).CompareTo(_lastLoad) > 0) {
// Reset
- spaces = null;
+ _spaces = null;
}
// Check if load is needed
- if (spaces == null) {
+ if (_spaces == null) {
(new Thread(() => {
- spaces = ConfluencePlugin.ConfluenceConnector.getSpaceSummaries();
- lastLoad = DateTime.Now;
+ _spaces = ConfluencePlugin.ConfluenceConnector.GetSpaceSummaries();
+ _lastLoad = DateTime.Now;
}) { Name = "Loading spaces for confluence"}).Start();
}
}
diff --git a/GreenshotConfluencePlugin/Support/ITranslationProvider.cs b/GreenshotConfluencePlugin/Support/ITranslationProvider.cs
index a19c27fd8..79efd538c 100644
--- a/GreenshotConfluencePlugin/Support/ITranslationProvider.cs
+++ b/GreenshotConfluencePlugin/Support/ITranslationProvider.cs
@@ -6,11 +6,5 @@
/// The key.
///
object Translate(string key);
-
- ///
- /// Gets the available languages.
- ///
- /// The available languages.
- //IEnumerable Languages { get; }
}
}
diff --git a/GreenshotConfluencePlugin/Support/LanguageXMLTranslationProvider.cs b/GreenshotConfluencePlugin/Support/LanguageXMLTranslationProvider.cs
index f3ebcaca0..72a94da31 100644
--- a/GreenshotConfluencePlugin/Support/LanguageXMLTranslationProvider.cs
+++ b/GreenshotConfluencePlugin/Support/LanguageXMLTranslationProvider.cs
@@ -34,20 +34,5 @@ namespace TranslationByMarkupExtension {
}
#endregion
-
- #region ITranslationProvider Members
-
- ///
- /// See
- ///
- /*public IEnumerable Languages {
- get {
- foreach (LanguageFile supportedLanguage in Language.SupportedLanguages) {
- yield return new CultureInfo(supportedLanguage.Ietf);
- }
- }
- }*/
-
- #endregion
}
}
diff --git a/GreenshotDropboxPlugin/DropboxPlugin.cs b/GreenshotDropboxPlugin/DropboxPlugin.cs
index 4fd1dd01c..2f22c0b4e 100644
--- a/GreenshotDropboxPlugin/DropboxPlugin.cs
+++ b/GreenshotDropboxPlugin/DropboxPlugin.cs
@@ -34,12 +34,12 @@ namespace GreenshotDropboxPlugin {
/// This is the Dropbox base code
///
public class DropboxPlugin : IGreenshotPlugin {
- private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(DropboxPlugin));
- private static DropboxPluginConfiguration config;
+ private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(DropboxPlugin));
+ private static DropboxPluginConfiguration _config;
public static PluginAttribute Attributes;
- private IGreenshotHost host;
- private ComponentResourceManager resources;
- private ToolStripMenuItem itemPlugInConfig;
+ private IGreenshotHost _host;
+ private ComponentResourceManager _resources;
+ private ToolStripMenuItem _itemPlugInConfig;
public void Dispose() {
Dispose(true);
@@ -48,9 +48,9 @@ namespace GreenshotDropboxPlugin {
protected virtual void Dispose(bool disposing) {
if (disposing) {
- if (itemPlugInConfig != null) {
- itemPlugInConfig.Dispose();
- itemPlugInConfig = null;
+ if (_itemPlugInConfig != null) {
+ _itemPlugInConfig.Dispose();
+ _itemPlugInConfig = null;
}
}
}
@@ -70,56 +70,48 @@ namespace GreenshotDropboxPlugin {
///
/// Implementation of the IGreenshotPlugin.Initialize
///
- /// Use the IGreenshotPluginHost interface to register events
- /// My own attributes
+ /// Use the IGreenshotPluginHost interface to register events
+ /// My own attributes
public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
- host = (IGreenshotHost)pluginHost;
+ _host = pluginHost;
Attributes = myAttributes;
// Register configuration (don't need the configuration itself)
- config = IniConfig.GetIniSection();
- resources = new ComponentResourceManager(typeof(DropboxPlugin));
+ _config = IniConfig.GetIniSection();
+ _resources = new ComponentResourceManager(typeof(DropboxPlugin));
- itemPlugInConfig = new ToolStripMenuItem();
- itemPlugInConfig.Text = Language.GetString("dropbox", LangKey.Configure);
- itemPlugInConfig.Tag = host;
- itemPlugInConfig.Click += new EventHandler(ConfigMenuClick);
- itemPlugInConfig.Image = (Image)resources.GetObject("Dropbox");
+ _itemPlugInConfig = new ToolStripMenuItem
+ {
+ Text = Language.GetString("dropbox", LangKey.Configure),
+ Tag = _host,
+ Image = (Image)_resources.GetObject("Dropbox")
+ };
+ _itemPlugInConfig.Click += ConfigMenuClick;
- PluginUtils.AddToContextMenu(host, itemPlugInConfig);
- Language.LanguageChanged += new LanguageChangedHandler(OnLanguageChanged);
+ PluginUtils.AddToContextMenu(_host, _itemPlugInConfig);
+ Language.LanguageChanged += OnLanguageChanged;
return true;
}
public void OnLanguageChanged(object sender, EventArgs e) {
- if (itemPlugInConfig != null) {
- itemPlugInConfig.Text = Language.GetString("dropbox", LangKey.Configure);
+ if (_itemPlugInConfig != null) {
+ _itemPlugInConfig.Text = Language.GetString("dropbox", LangKey.Configure);
}
}
public virtual void Shutdown() {
- LOG.Debug("Dropbox Plugin shutdown.");
+ Log.Debug("Dropbox Plugin shutdown.");
}
///
/// Implementation of the IPlugin.Configure
///
public virtual void Configure() {
- config.ShowConfigDialog();
- }
-
- ///
- /// This will be called when Greenshot is shutting down
- ///
- ///
- ///
- public void Closing(object sender, FormClosingEventArgs e) {
- LOG.Debug("Application closing, de-registering Dropbox Plugin!");
- Shutdown();
+ _config.ShowConfigDialog();
}
public void ConfigMenuClick(object sender, EventArgs eventArgs) {
- config.ShowConfigDialog();
+ _config.ShowConfigDialog();
}
///
@@ -127,12 +119,12 @@ namespace GreenshotDropboxPlugin {
///
public bool Upload(ICaptureDetails captureDetails, ISurface surfaceToUpload, out string uploadUrl) {
uploadUrl = null;
- SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(config.UploadFormat, config.UploadJpegQuality, false);
+ SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(_config.UploadFormat, _config.UploadJpegQuality, false);
try {
string dropboxUrl = null;
new PleaseWaitForm().ShowAndWait(Attributes.Name, Language.GetString("dropbox", LangKey.communication_wait),
delegate() {
- string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails));
+ string filename = Path.GetFileName(FilenameHelper.GetFilename(_config.UploadFormat, captureDetails));
dropboxUrl = DropboxUtils.UploadToDropbox(surfaceToUpload, outputSettings, filename);
}
);
@@ -142,7 +134,7 @@ namespace GreenshotDropboxPlugin {
uploadUrl = dropboxUrl;
return true;
} catch (Exception e) {
- LOG.Error(e);
+ Log.Error(e);
MessageBox.Show(Language.GetString("dropbox", LangKey.upload_failure) + " " + e.Message);
return false;
}
diff --git a/GreenshotDropboxPlugin/DropboxPluginConfiguration.cs b/GreenshotDropboxPlugin/DropboxPluginConfiguration.cs
index 2d75754ad..57199fc17 100644
--- a/GreenshotDropboxPlugin/DropboxPluginConfiguration.cs
+++ b/GreenshotDropboxPlugin/DropboxPluginConfiguration.cs
@@ -30,19 +30,19 @@ namespace GreenshotDropboxPlugin {
[IniSection("Dropbox", Description = "Greenshot Dropbox Plugin configuration")]
public class DropboxPluginConfiguration : IniSection {
[IniProperty("UploadFormat", Description="What file type to use for uploading", DefaultValue="png")]
- public OutputFormat UploadFormat;
+ public OutputFormat UploadFormat { get; set; }
[IniProperty("UploadJpegQuality", Description="JPEG file save quality in %.", DefaultValue="80")]
- public int UploadJpegQuality;
+ public int UploadJpegQuality { get; set; }
[IniProperty("AfterUploadLinkToClipBoard", Description = "After upload send Dropbox link to clipboard.", DefaultValue = "true")]
- public bool AfterUploadLinkToClipBoard;
+ public bool AfterUploadLinkToClipBoard { get; set; }
[IniProperty("DropboxToken", Description = "The Dropbox token", Encrypted = true, ExcludeIfNull = true)]
- public string DropboxToken;
+ public string DropboxToken { get; set; }
[IniProperty("DropboxTokenSecret", Description = "The Dropbox token secret", Encrypted = true, ExcludeIfNull = true)]
- public string DropboxTokenSecret;
-
+ public string DropboxTokenSecret { get; set; }
+
///
/// A form for token
///
diff --git a/GreenshotExternalCommandPlugin/ExternalCommandConfiguration.cs b/GreenshotExternalCommandPlugin/ExternalCommandConfiguration.cs
index 3536083de..af223ebde 100644
--- a/GreenshotExternalCommandPlugin/ExternalCommandConfiguration.cs
+++ b/GreenshotExternalCommandPlugin/ExternalCommandConfiguration.cs
@@ -31,34 +31,34 @@ namespace ExternalCommand {
[IniSection("ExternalCommand", Description="Greenshot ExternalCommand Plugin configuration")]
public class ExternalCommandConfiguration : IniSection {
[IniProperty("Commands", Description="The commands that are available.")]
- public List commands;
+ public List Commands { get; set; }
[IniProperty("RedirectStandardError", Description = "Redirect the standard error of all external commands, used to output as warning to the greenshot.log.", DefaultValue = "true")]
- public bool RedirectStandardError;
+ public bool RedirectStandardError { get; set; }
[IniProperty("RedirectStandardOutput", Description = "Redirect the standard output of all external commands, used for different other functions (more below).", DefaultValue = "true")]
- public bool RedirectStandardOutput;
+ public bool RedirectStandardOutput { get; set; }
[IniProperty("ShowStandardOutputInLog", Description = "Depends on 'RedirectStandardOutput': Show standard output of all external commands to the Greenshot log, this can be usefull for debugging.", DefaultValue = "false")]
- public bool ShowStandardOutputInLog;
+ public bool ShowStandardOutputInLog { get; set; }
[IniProperty("ParseForUri", Description = "Depends on 'RedirectStandardOutput': Parse the output and take the first found URI, if a URI is found than clicking on the notify bubble goes there.", DefaultValue = "true")]
- public bool ParseOutputForUri;
+ public bool ParseOutputForUri { get; set; }
[IniProperty("OutputToClipboard", Description = "Depends on 'RedirectStandardOutput': Place the standard output on the clipboard.", DefaultValue = "false")]
- public bool OutputToClipboard;
+ public bool OutputToClipboard { get; set; }
[IniProperty("UriToClipboard", Description = "Depends on 'RedirectStandardOutput' & 'ParseForUri': If an URI is found in the standard input, place it on the clipboard. (This overwrites the output from OutputToClipboard setting.)", DefaultValue = "true")]
- public bool UriToClipboard;
+ public bool UriToClipboard { get; set; }
[IniProperty("Commandline", Description="The commandline for the output command.")]
- public Dictionary commandlines;
+ public Dictionary commandlines { get; set; }
[IniProperty("Argument", Description="The arguments for the output command.")]
- public Dictionary arguments;
+ public Dictionary arguments { get; set; }
[IniProperty("RunInbackground", Description = "Should the command be started in the background.")]
- public Dictionary runInbackground;
+ public Dictionary runInbackground { get; set; }
private const string MSPAINT = "MS Paint";
private static readonly string paintPath;
diff --git a/GreenshotExternalCommandPlugin/ExternalCommandPlugin.cs b/GreenshotExternalCommandPlugin/ExternalCommandPlugin.cs
index b6f785e5d..c74ebd15d 100644
--- a/GreenshotExternalCommandPlugin/ExternalCommandPlugin.cs
+++ b/GreenshotExternalCommandPlugin/ExternalCommandPlugin.cs
@@ -55,7 +55,7 @@ namespace ExternalCommand {
}
public IEnumerable Destinations() {
- foreach(string command in config.commands) {
+ foreach(string command in config.Commands) {
yield return new ExternalCommandDestination(command);
}
}
@@ -96,15 +96,14 @@ namespace ExternalCommand {
///
/// Implementation of the IGreenshotPlugin.Initialize
///
- /// Use the IGreenshotPluginHost interface to register events
- /// Use the ICaptureHost interface to register in the MainContextMenu
- /// My own attributes
+ /// Use the IGreenshotPluginHost interface to register events
+ /// My own attributes
public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
LOG.DebugFormat("Initialize called of {0}", myAttributes.Name);
List commandsToDelete = new List();
// Check configuration
- foreach(string command in config.commands) {
+ foreach(string command in config.Commands) {
if (!isCommandValid(command)) {
commandsToDelete.Add(command);
}
@@ -115,18 +114,17 @@ namespace ExternalCommand {
config.runInbackground.Remove(command);
config.commandlines.Remove(command);
config.arguments.Remove(command);
- config.commands.Remove(command);
+ config.Commands.Remove(command);
}
_host = pluginHost;
_myAttributes = myAttributes;
- _itemPlugInRoot = new ToolStripMenuItem();
- _itemPlugInRoot.Tag = _host;
+ _itemPlugInRoot = new ToolStripMenuItem {Tag = _host};
OnIconSizeChanged(this, new PropertyChangedEventArgs("IconSize"));
OnLanguageChanged(this, null);
- _itemPlugInRoot.Click += new EventHandler(ConfigMenuClick);
+ _itemPlugInRoot.Click += ConfigMenuClick;
PluginUtils.AddToContextMenu(_host, _itemPlugInRoot);
Language.LanguageChanged += OnLanguageChanged;
diff --git a/GreenshotExternalCommandPlugin/SettingsForm.cs b/GreenshotExternalCommandPlugin/SettingsForm.cs
index 2e525f351..9f4923f81 100644
--- a/GreenshotExternalCommandPlugin/SettingsForm.cs
+++ b/GreenshotExternalCommandPlugin/SettingsForm.cs
@@ -56,7 +56,7 @@ namespace ExternalCommand {
void ButtonDeleteClick(object sender, EventArgs e) {
foreach(ListViewItem item in listView1.SelectedItems) {
string commando = item.Tag as string;
- config.commands.Remove(commando);
+ config.Commands.Remove(commando);
config.commandlines.Remove(commando);
config.arguments.Remove(commando);
}
@@ -65,12 +65,12 @@ namespace ExternalCommand {
void UpdateView() {
listView1.Items.Clear();
- if(config.commands != null) {
+ if(config.Commands != null) {
listView1.ListViewItemSorter = new ListviewComparer();
ImageList imageList = new ImageList();
listView1.SmallImageList = imageList;
int imageNr = 0;
- foreach(string commando in config.commands) {
+ foreach(string commando in config.Commands) {
ListViewItem item = null;
Image iconForExe = IconCache.IconForCommand(commando);
if(iconForExe != null) {
diff --git a/GreenshotExternalCommandPlugin/SettingsFormDetail.cs b/GreenshotExternalCommandPlugin/SettingsFormDetail.cs
index 772a9b4a2..ed940646a 100644
--- a/GreenshotExternalCommandPlugin/SettingsFormDetail.cs
+++ b/GreenshotExternalCommandPlugin/SettingsFormDetail.cs
@@ -47,7 +47,7 @@ namespace ExternalCommand {
textBox_name.Text = commando;
textBox_commandline.Text = config.commandlines[commando];
textBox_arguments.Text = config.arguments[commando];
- _commandIndex = config.commands.FindIndex(delegate(string s) { return s == commando; });
+ _commandIndex = config.Commands.FindIndex(delegate(string s) { return s == commando; });
} else {
textBox_arguments.Text = "\"{0}\"";
}
@@ -59,13 +59,13 @@ namespace ExternalCommand {
string commandLine = textBox_commandline.Text;
string arguments = textBox_arguments.Text;
if(_commando != null) {
- config.commands[_commandIndex] = commandName;
+ config.Commands[_commandIndex] = commandName;
config.commandlines.Remove(_commando);
config.commandlines.Add(commandName, commandLine);
config.arguments.Remove(_commando);
config.arguments.Add(commandName, arguments);
} else {
- config.commands.Add(commandName);
+ config.Commands.Add(commandName);
config.commandlines.Add(commandName, commandLine);
config.arguments.Add(commandName, arguments);
}
@@ -112,7 +112,7 @@ namespace ExternalCommand {
buttonOk.Enabled = false;
}
// Check if commandname is unique
- if(_commando == null && !string.IsNullOrEmpty(textBox_name.Text) && config.commands.Contains(textBox_name.Text)) {
+ if(_commando == null && !string.IsNullOrEmpty(textBox_name.Text) && config.Commands.Contains(textBox_name.Text)) {
buttonOk.Enabled = false;
textBox_name.BackColor = Color.Red;
}
diff --git a/GreenshotFlickrPlugin/FlickrConfiguration.cs b/GreenshotFlickrPlugin/FlickrConfiguration.cs
index 6c784dc9d..e0751739b 100644
--- a/GreenshotFlickrPlugin/FlickrConfiguration.cs
+++ b/GreenshotFlickrPlugin/FlickrConfiguration.cs
@@ -34,36 +34,36 @@ namespace GreenshotFlickrPlugin {
[IniSection("Flickr", Description = "Greenshot Flickr Plugin configuration")]
public class FlickrConfiguration : IniSection {
[IniProperty("flickrIsPublic", Description = "IsPublic.", DefaultValue = "true")]
- public bool IsPublic;
+ public bool IsPublic { get; set; }
[IniProperty("flickrIsFamily", Description = "IsFamily.", DefaultValue = "true")]
- public bool IsFamily;
+ public bool IsFamily { get; set; }
[IniProperty("flickrIsFriend", Description = "IsFriend.", DefaultValue = "true")]
- public bool IsFriend;
+ public bool IsFriend { get; set; }
[IniProperty("SafetyLevel", Description = "Safety level", DefaultValue = "Safe")]
- public SafetyLevel SafetyLevel;
+ public SafetyLevel SafetyLevel { get; set; }
[IniProperty("HiddenFromSearch", Description = "Hidden from search", DefaultValue = "false")]
- public bool HiddenFromSearch;
-
+ public bool HiddenFromSearch { get; set; }
+
[IniProperty("UploadFormat", Description="What file type to use for uploading", DefaultValue="png")]
- public OutputFormat UploadFormat;
+ public OutputFormat UploadFormat { get; set; }
[IniProperty("UploadJpegQuality", Description="JPEG file save quality in %.", DefaultValue="80")]
- public int UploadJpegQuality;
+ public int UploadJpegQuality { get; set; }
[IniProperty("AfterUploadLinkToClipBoard", Description = "After upload send flickr link to clipboard.", DefaultValue = "true")]
- public bool AfterUploadLinkToClipBoard;
+ public bool AfterUploadLinkToClipBoard { get; set; }
[IniProperty("UsePageLink", Description = "Use pagelink instead of direct link on the clipboard", DefaultValue = "False")]
- public bool UsePageLink;
-
+ public bool UsePageLink { get; set; }
+
[IniProperty("FlickrToken", Description = "The Flickr token", Encrypted = true, ExcludeIfNull = true)]
- public string FlickrToken;
+ public string FlickrToken { get; set; }
[IniProperty("FlickrTokenSecret", Description = "The Flickr token secret", Encrypted = true, ExcludeIfNull = true)]
- public string FlickrTokenSecret;
+ public string FlickrTokenSecret { get; set; }
///
/// A form for token
diff --git a/GreenshotFlickrPlugin/FlickrPlugin.cs b/GreenshotFlickrPlugin/FlickrPlugin.cs
index f6d06f15d..6a67d285f 100644
--- a/GreenshotFlickrPlugin/FlickrPlugin.cs
+++ b/GreenshotFlickrPlugin/FlickrPlugin.cs
@@ -111,16 +111,6 @@ namespace GreenshotFlickrPlugin
_config.ShowConfigDialog();
}
- ///
- /// This will be called when Greenshot is shutting down
- ///
- ///
- ///
- public void Closing(object sender, FormClosingEventArgs e) {
- LOG.Debug("Application closing, de-registering Flickr Plugin!");
- Shutdown();
- }
-
public void ConfigMenuClick(object sender, EventArgs eventArgs) {
_config.ShowConfigDialog();
}
diff --git a/GreenshotImgurPlugin/Forms/ImgurHistory.cs b/GreenshotImgurPlugin/Forms/ImgurHistory.cs
index cb5e0d929..c086f5594 100644
--- a/GreenshotImgurPlugin/Forms/ImgurHistory.cs
+++ b/GreenshotImgurPlugin/Forms/ImgurHistory.cs
@@ -31,20 +31,20 @@ namespace GreenshotImgurPlugin {
///
/// Description of ImgurHistory.
///
- public partial class ImgurHistory : ImgurForm {
- private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImgurHistory));
- private readonly GreenshotColumnSorter columnSorter;
- private static readonly ImgurConfiguration config = IniConfig.GetIniSection();
- private static ImgurHistory instance;
+ public sealed partial class ImgurHistory : ImgurForm {
+ private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(ImgurHistory));
+ private readonly GreenshotColumnSorter _columnSorter;
+ private static readonly ImgurConfiguration Config = IniConfig.GetIniSection();
+ private static ImgurHistory _instance;
public static void ShowHistory() {
// Make sure the history is loaded, will be done only once
ImgurUtils.LoadHistory();
- if (instance == null) {
- instance = new ImgurHistory();
+ if (_instance == null) {
+ _instance = new ImgurHistory();
}
- instance.Show();
- instance.redraw();
+ _instance.Show();
+ _instance.Redraw();
}
private ImgurHistory() {
@@ -56,21 +56,21 @@ namespace GreenshotImgurPlugin {
AcceptButton = finishedButton;
CancelButton = finishedButton;
// Init sorting
- columnSorter = new GreenshotColumnSorter();
- listview_imgur_uploads.ListViewItemSorter = columnSorter;
- columnSorter.SortColumn = 3;
- columnSorter.Order = SortOrder.Descending;
- redraw();
+ _columnSorter = new GreenshotColumnSorter();
+ listview_imgur_uploads.ListViewItemSorter = _columnSorter;
+ _columnSorter.SortColumn = 3;
+ _columnSorter.Order = SortOrder.Descending;
+ Redraw();
if (listview_imgur_uploads.Items.Count > 0) {
listview_imgur_uploads.Items[0].Selected = true;
}
ApplyLanguage();
- if (config.Credits > 0) {
- Text = Text + " (" + config.Credits + " credits)";
+ if (Config.Credits > 0) {
+ Text = Text + " (" + Config.Credits + " credits)";
}
}
- private void redraw() {
+ private void Redraw() {
// Should fix Bug #3378699
pictureBox1.Image = pictureBox1.ErrorImage;
listview_imgur_uploads.BeginUpdate();
@@ -80,7 +80,7 @@ namespace GreenshotImgurPlugin {
foreach (string column in columns) {
listview_imgur_uploads.Columns.Add(column);
}
- foreach (ImgurInfo imgurInfo in config.runtimeImgurHistory.Values) {
+ foreach (ImgurInfo imgurInfo in Config.runtimeImgurHistory.Values) {
ListViewItem item = new ListViewItem(imgurInfo.Hash);
item.Tag = imgurInfo;
item.SubItems.Add(imgurInfo.Title);
@@ -132,14 +132,14 @@ namespace GreenshotImgurPlugin {
}
);
} catch (Exception ex) {
- LOG.Warn("Problem communicating with Imgur: ", ex);
+ Log.Warn("Problem communicating with Imgur: ", ex);
}
imgurInfo.Dispose();
}
}
}
- redraw();
+ Redraw();
}
private void ClipboardButtonClick(object sender, EventArgs e) {
@@ -147,7 +147,7 @@ namespace GreenshotImgurPlugin {
if (listview_imgur_uploads.SelectedItems != null && listview_imgur_uploads.SelectedItems.Count > 0) {
for (int i = 0; i < listview_imgur_uploads.SelectedItems.Count; i++) {
ImgurInfo imgurInfo = (ImgurInfo)listview_imgur_uploads.SelectedItems[i].Tag;
- if (config.UsePageLink) {
+ if (Config.UsePageLink) {
links.AppendLine(imgurInfo.Page);
} else {
links.AppendLine(imgurInfo.Original);
@@ -160,10 +160,10 @@ namespace GreenshotImgurPlugin {
private void ClearHistoryButtonClick(object sender, EventArgs e) {
DialogResult result = MessageBox.Show(Language.GetString("imgur", LangKey.clear_question), "Imgur", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes) {
- config.runtimeImgurHistory.Clear();
- config.ImgurUploadHistory.Clear();
+ Config.runtimeImgurHistory.Clear();
+ Config.ImgurUploadHistory.Clear();
IniConfig.Save();
- redraw();
+ Redraw();
}
}
@@ -183,17 +183,17 @@ namespace GreenshotImgurPlugin {
private void listview_imgur_uploads_ColumnClick(object sender, ColumnClickEventArgs e) {
// Determine if clicked column is already the column that is being sorted.
- if (e.Column == columnSorter.SortColumn) {
+ if (e.Column == _columnSorter.SortColumn) {
// Reverse the current sort direction for this column.
- if (columnSorter.Order == SortOrder.Ascending) {
- columnSorter.Order = SortOrder.Descending;
+ if (_columnSorter.Order == SortOrder.Ascending) {
+ _columnSorter.Order = SortOrder.Descending;
} else {
- columnSorter.Order = SortOrder.Ascending;
+ _columnSorter.Order = SortOrder.Ascending;
}
} else {
// Set the column number that is to be sorted; default to ascending.
- columnSorter.SortColumn = e.Column;
- columnSorter.Order = SortOrder.Ascending;
+ _columnSorter.SortColumn = e.Column;
+ _columnSorter.Order = SortOrder.Ascending;
}
// Perform the sort with these new sort options.
@@ -203,7 +203,7 @@ namespace GreenshotImgurPlugin {
void ImgurHistoryFormClosing(object sender, FormClosingEventArgs e)
{
- instance = null;
+ _instance = null;
}
}
}
diff --git a/GreenshotImgurPlugin/ImgurConfiguration.cs b/GreenshotImgurPlugin/ImgurConfiguration.cs
index db8edf152..440c993d2 100644
--- a/GreenshotImgurPlugin/ImgurConfiguration.cs
+++ b/GreenshotImgurPlugin/ImgurConfiguration.cs
@@ -33,44 +33,44 @@ namespace GreenshotImgurPlugin {
[IniSection("Imgur", Description="Greenshot Imgur Plugin configuration")]
public class ImgurConfiguration : IniSection {
[IniProperty("ImgurApi3Url", Description = "Url to Imgur system.", DefaultValue = "https://api.imgur.com/3")]
- public string ImgurApi3Url;
+ public string ImgurApi3Url { get; set; }
[IniProperty("UploadFormat", Description="What file type to use for uploading", DefaultValue="png")]
- public OutputFormat UploadFormat;
+ public OutputFormat UploadFormat { get; set; }
[IniProperty("UploadJpegQuality", Description="JPEG file save quality in %.", DefaultValue="80")]
- public int UploadJpegQuality;
+ public int UploadJpegQuality { get; set; }
[IniProperty("UploadReduceColors", Description="Reduce color amount of the uploaded image to 256", DefaultValue="False")]
- public bool UploadReduceColors;
+ public bool UploadReduceColors { get; set; }
[IniProperty("CopyLinkToClipboard", Description = "Copy the link, which one is controlled by the UsePageLink, on the clipboard", DefaultValue = "True")]
- public bool CopyLinkToClipboard;
+ public bool CopyLinkToClipboard { get; set; }
[IniProperty("UsePageLink", Description = "Use pagelink instead of direct link on the clipboard", DefaultValue = "False")]
- public bool UsePageLink;
+ public bool UsePageLink { get; set; }
[IniProperty("AnonymousAccess", Description = "Use anonymous access to Imgur", DefaultValue="true")]
- public bool AnonymousAccess;
+ public bool AnonymousAccess { get; set; }
[IniProperty("RefreshToken", Description = "Imgur refresh Token", Encrypted = true, ExcludeIfNull = true)]
- public string RefreshToken;
+ public string RefreshToken { get; set; }
///
/// AccessToken, not stored
///
- public string AccessToken;
+ public string AccessToken { get; set; }
///
/// AccessTokenExpires, not stored
///
- public DateTimeOffset AccessTokenExpires;
+ public DateTimeOffset AccessTokenExpires { get; set; }
[IniProperty("AddTitle", Description = "Is the title passed on to Imgur", DefaultValue = "False")]
- public bool AddTitle;
+ public bool AddTitle { get; set; }
[IniProperty("AddFilename", Description = "Is the filename passed on to Imgur", DefaultValue = "False")]
- public bool AddFilename;
+ public bool AddFilename { get; set; }
[IniProperty("FilenamePattern", Description = "Filename for the Imgur upload", DefaultValue = "${capturetime:d\"yyyyMMdd-HHmm\"}")]
- public string FilenamePattern;
+ public string FilenamePattern { get; set; }
[IniProperty("ImgurUploadHistory", Description="Imgur upload history (ImgurUploadHistory.hash=deleteHash)")]
- public Dictionary ImgurUploadHistory;
-
+ public Dictionary ImgurUploadHistory { get; set; }
+
// Not stored, only run-time!
public Dictionary runtimeImgurHistory = new Dictionary();
public int Credits {
diff --git a/GreenshotImgurPlugin/ImgurPlugin.cs b/GreenshotImgurPlugin/ImgurPlugin.cs
index 7655a7a76..d26083f35 100644
--- a/GreenshotImgurPlugin/ImgurPlugin.cs
+++ b/GreenshotImgurPlugin/ImgurPlugin.cs
@@ -35,13 +35,13 @@ namespace GreenshotImgurPlugin {
/// This is the ImgurPlugin code
///
public class ImgurPlugin : IGreenshotPlugin {
- private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImgurPlugin));
- private static ImgurConfiguration config;
+ private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(ImgurPlugin));
+ private static ImgurConfiguration _config;
public static PluginAttribute Attributes;
- private IGreenshotHost host;
- private ComponentResourceManager resources;
- private ToolStripMenuItem historyMenuItem = null;
- private ToolStripMenuItem itemPlugInConfig;
+ private IGreenshotHost _host;
+ private ComponentResourceManager _resources;
+ private ToolStripMenuItem _historyMenuItem;
+ private ToolStripMenuItem _itemPlugInConfig;
public void Dispose() {
Dispose(true);
@@ -50,13 +50,13 @@ namespace GreenshotImgurPlugin {
protected virtual void Dispose(bool disposing) {
if (disposing) {
- if (historyMenuItem != null) {
- historyMenuItem.Dispose();
- historyMenuItem = null;
+ if (_historyMenuItem != null) {
+ _historyMenuItem.Dispose();
+ _historyMenuItem = null;
}
- if (itemPlugInConfig != null) {
- itemPlugInConfig.Dispose();
- itemPlugInConfig = null;
+ if (_itemPlugInConfig != null) {
+ _itemPlugInConfig.Dispose();
+ _itemPlugInConfig = null;
}
}
}
@@ -75,114 +75,112 @@ namespace GreenshotImgurPlugin {
///
/// Implementation of the IGreenshotPlugin.Initialize
///
- /// Use the IGreenshotPluginHost interface to register events
- /// Use the ICaptureHost interface to register in the MainContextMenu
- /// My own attributes
+ /// Use the IGreenshotPluginHost interface to register events
+ /// My own attributes
/// true if plugin is initialized, false if not (doesn't show)
public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
- host = (IGreenshotHost)pluginHost;
+ _host = pluginHost;
Attributes = myAttributes;
// Get configuration
- config = IniConfig.GetIniSection();
- resources = new ComponentResourceManager(typeof(ImgurPlugin));
-
- ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem("Imgur");
- itemPlugInRoot.Image = (Image)resources.GetObject("Imgur");
+ _config = IniConfig.GetIniSection();
+ _resources = new ComponentResourceManager(typeof(ImgurPlugin));
- historyMenuItem = new ToolStripMenuItem(Language.GetString("imgur", LangKey.history));
- historyMenuItem.Tag = host;
- historyMenuItem.Click += delegate {
+ ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem("Imgur")
+ {
+ Image = (Image) _resources.GetObject("Imgur")
+ };
+
+ _historyMenuItem = new ToolStripMenuItem(Language.GetString("imgur", LangKey.history))
+ {
+ Tag = _host
+ };
+ _historyMenuItem.Click += delegate {
ImgurHistory.ShowHistory();
};
- itemPlugInRoot.DropDownItems.Add(historyMenuItem);
+ itemPlugInRoot.DropDownItems.Add(_historyMenuItem);
- itemPlugInConfig = new ToolStripMenuItem(Language.GetString("imgur", LangKey.configure));
- itemPlugInConfig.Tag = host;
- itemPlugInConfig.Click += delegate {
- config.ShowConfigDialog();
+ _itemPlugInConfig = new ToolStripMenuItem(Language.GetString("imgur", LangKey.configure))
+ {
+ Tag = _host
};
- itemPlugInRoot.DropDownItems.Add(itemPlugInConfig);
+ _itemPlugInConfig.Click += delegate {
+ _config.ShowConfigDialog();
+ };
+ itemPlugInRoot.DropDownItems.Add(_itemPlugInConfig);
- PluginUtils.AddToContextMenu(host, itemPlugInRoot);
- Language.LanguageChanged += new LanguageChangedHandler(OnLanguageChanged);
+ PluginUtils.AddToContextMenu(_host, itemPlugInRoot);
+ Language.LanguageChanged += OnLanguageChanged;
// retrieve history in the background
- Thread backgroundTask = new Thread (new ThreadStart(CheckHistory));
- backgroundTask.Name = "Imgur History";
- backgroundTask.IsBackground = true;
+ Thread backgroundTask = new Thread(CheckHistory)
+ {
+ Name = "Imgur History",
+ IsBackground = true
+ };
backgroundTask.SetApartmentState(ApartmentState.STA);
backgroundTask.Start();
return true;
}
public void OnLanguageChanged(object sender, EventArgs e) {
- if (itemPlugInConfig != null) {
- itemPlugInConfig.Text = Language.GetString("imgur", LangKey.configure);
+ if (_itemPlugInConfig != null) {
+ _itemPlugInConfig.Text = Language.GetString("imgur", LangKey.configure);
}
- if (historyMenuItem != null) {
- historyMenuItem.Text = Language.GetString("imgur", LangKey.history);
+ if (_historyMenuItem != null) {
+ _historyMenuItem.Text = Language.GetString("imgur", LangKey.history);
}
}
private void CheckHistory() {
try {
ImgurUtils.LoadHistory();
- host.GreenshotForm.BeginInvoke((MethodInvoker)delegate {
- if (config.ImgurUploadHistory.Count > 0) {
- historyMenuItem.Enabled = true;
+ _host.GreenshotForm.BeginInvoke((MethodInvoker)delegate {
+ if (_config.ImgurUploadHistory.Count > 0) {
+ _historyMenuItem.Enabled = true;
} else {
- historyMenuItem.Enabled = false;
+ _historyMenuItem.Enabled = false;
}
});
} catch (Exception ex) {
- LOG.Error("Error loading history", ex);
- };
+ Log.Error("Error loading history", ex);
+ }
}
public virtual void Shutdown() {
- LOG.Debug("Imgur Plugin shutdown.");
- Language.LanguageChanged -= new LanguageChangedHandler(OnLanguageChanged);
+ Log.Debug("Imgur Plugin shutdown.");
+ Language.LanguageChanged -= OnLanguageChanged;
}
///
/// Implementation of the IPlugin.Configure
///
public virtual void Configure() {
- config.ShowConfigDialog();
+ _config.ShowConfigDialog();
}
- ///
- /// This will be called when Greenshot is shutting down
- ///
- ///
- ///
- public void Closing(object sender, FormClosingEventArgs e) {
- LOG.Debug("Application closing, de-registering Imgur Plugin!");
- Shutdown();
- }
-
///
/// Upload the capture to imgur
///
- ///
- ///
- /// out string for the url
+ /// ICaptureDetails
+ /// ISurface
+ /// out string for the url
/// true if the upload succeeded
- public bool Upload(ICaptureDetails captureDetails, ISurface surfaceToUpload, out string uploadURL) {
- SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(config.UploadFormat, config.UploadJpegQuality, config.UploadReduceColors);
+ public bool Upload(ICaptureDetails captureDetails, ISurface surfaceToUpload, out string uploadUrl) {
+ SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(_config.UploadFormat, _config.UploadJpegQuality, _config.UploadReduceColors);
try {
- string filename = Path.GetFileName(FilenameHelper.GetFilenameFromPattern(config.FilenamePattern, config.UploadFormat, captureDetails));
+ string filename = Path.GetFileName(FilenameHelper.GetFilenameFromPattern(_config.FilenamePattern, _config.UploadFormat, captureDetails));
ImgurInfo imgurInfo = null;
// Run upload in the background
new PleaseWaitForm().ShowAndWait("Imgur plug-in", Language.GetString("imgur", LangKey.communication_wait),
- delegate() {
+ delegate
+ {
imgurInfo = ImgurUtils.UploadToImgur(surfaceToUpload, outputSettings, captureDetails.Title, filename);
- if (imgurInfo != null && config.AnonymousAccess) {
- LOG.InfoFormat("Storing imgur upload for hash {0} and delete hash {1}", imgurInfo.Hash, imgurInfo.DeleteHash);
- config.ImgurUploadHistory.Add(imgurInfo.Hash, imgurInfo.DeleteHash);
- config.runtimeImgurHistory.Add(imgurInfo.Hash, imgurInfo);
+ if (imgurInfo != null && _config.AnonymousAccess) {
+ Log.InfoFormat("Storing imgur upload for hash {0} and delete hash {1}", imgurInfo.Hash, imgurInfo.DeleteHash);
+ _config.ImgurUploadHistory.Add(imgurInfo.Hash, imgurInfo.DeleteHash);
+ _config.runtimeImgurHistory.Add(imgurInfo.Hash, imgurInfo);
CheckHistory();
}
}
@@ -195,34 +193,34 @@ namespace GreenshotImgurPlugin {
}
IniConfig.Save();
- if (config.UsePageLink)
+ if (_config.UsePageLink)
{
- uploadURL = imgurInfo.Page;
+ uploadUrl = imgurInfo.Page;
}
else
{
- uploadURL = imgurInfo.Original;
+ uploadUrl = imgurInfo.Original;
}
- if (!string.IsNullOrEmpty(uploadURL) && config.CopyLinkToClipboard)
+ if (!string.IsNullOrEmpty(uploadUrl) && _config.CopyLinkToClipboard)
{
try
{
- ClipboardHelper.SetClipboardData(uploadURL);
+ ClipboardHelper.SetClipboardData(uploadUrl);
}
catch (Exception ex)
{
- LOG.Error("Can't write to clipboard: ", ex);
- uploadURL = null;
+ Log.Error("Can't write to clipboard: ", ex);
+ uploadUrl = null;
}
}
return true;
}
} catch (Exception e) {
- LOG.Error("Error uploading.", e);
+ Log.Error("Error uploading.", e);
MessageBox.Show(Language.GetString("imgur", LangKey.upload_failure) + " " + e.Message);
}
- uploadURL = null;
+ uploadUrl = null;
return false;
}
}
diff --git a/GreenshotJiraPlugin/Forms/JiraForm.Designer.cs b/GreenshotJiraPlugin/Forms/JiraForm.Designer.cs
index a749454d0..18cc71047 100644
--- a/GreenshotJiraPlugin/Forms/JiraForm.Designer.cs
+++ b/GreenshotJiraPlugin/Forms/JiraForm.Designer.cs
@@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-namespace GreenshotJiraPlugin {
+namespace GreenshotJiraPlugin.Forms {
partial class JiraForm {
///
/// Required designer variable.
diff --git a/GreenshotJiraPlugin/Forms/JiraForm.cs b/GreenshotJiraPlugin/Forms/JiraForm.cs
index 943b8619a..bb6ab54eb 100644
--- a/GreenshotJiraPlugin/Forms/JiraForm.cs
+++ b/GreenshotJiraPlugin/Forms/JiraForm.cs
@@ -18,21 +18,20 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
+
using System;
using System.Globalization;
using System.Windows.Forms;
-
+using Greenshot.IniFile;
using GreenshotPlugin.Controls;
using GreenshotPlugin.Core;
-using Greenshot.IniFile;
-using Jira;
-namespace GreenshotJiraPlugin {
+namespace GreenshotJiraPlugin.Forms {
public partial class JiraForm : Form {
- private readonly JiraConnector jiraConnector;
- private JiraIssue selectedIssue;
- private readonly GreenshotColumnSorter columnSorter;
- private readonly JiraConfiguration config = IniConfig.GetIniSection();
+ private readonly JiraConnector _jiraConnector;
+ private JiraIssue _selectedIssue;
+ private readonly GreenshotColumnSorter _columnSorter;
+ private readonly JiraConfiguration _config = IniConfig.GetIniSection();
public JiraForm(JiraConnector jiraConnector) {
InitializeComponent();
@@ -40,90 +39,90 @@ namespace GreenshotJiraPlugin {
AcceptButton = uploadButton;
CancelButton = cancelButton;
- initializeComponentText();
+ InitializeComponentText();
- columnSorter = new GreenshotColumnSorter();
- jiraListView.ListViewItemSorter = columnSorter;
+ _columnSorter = new GreenshotColumnSorter();
+ jiraListView.ListViewItemSorter = _columnSorter;
- this.jiraConnector = jiraConnector;
+ _jiraConnector = jiraConnector;
- changeModus(false);
+ ChangeModus(false);
try {
- if (!jiraConnector.isLoggedIn) {
- jiraConnector.login();
+ if (!jiraConnector.IsLoggedIn) {
+ jiraConnector.Login();
}
} catch (Exception e) {
MessageBox.Show(Language.GetFormattedString("jira", LangKey.login_error, e.Message));
}
uploadButton.Enabled = false;
- updateForm();
+ UpdateForm();
}
- private void initializeComponentText() {
+ private void InitializeComponentText() {
label_jirafilter.Text = Language.GetString("jira", LangKey.label_jirafilter);
label_comment.Text = Language.GetString("jira", LangKey.label_comment);
label_filename.Text = Language.GetString("jira", LangKey.label_filename);
}
- private void updateForm() {
- if (jiraConnector.isLoggedIn) {
- JiraFilter[] filters = jiraConnector.getFilters();
+ private void UpdateForm() {
+ if (_jiraConnector.IsLoggedIn) {
+ JiraFilter[] filters = _jiraConnector.GetFilters();
if (filters.Length > 0) {
foreach (JiraFilter filter in filters) {
jiraFilterBox.Items.Add(filter);
}
jiraFilterBox.SelectedIndex = 0;
}
- changeModus(true);
- if (config.LastUsedJira != null) {
- selectedIssue = jiraConnector.getIssue(config.LastUsedJira);
- if (selectedIssue != null) {
- jiraKey.Text = config.LastUsedJira;
+ ChangeModus(true);
+ if (_config.LastUsedJira != null) {
+ _selectedIssue = _jiraConnector.GetIssue(_config.LastUsedJira);
+ if (_selectedIssue != null) {
+ jiraKey.Text = _config.LastUsedJira;
uploadButton.Enabled = true;
}
}
}
}
- private void changeModus(bool enabled) {
+ private void ChangeModus(bool enabled) {
jiraFilterBox.Enabled = enabled;
jiraListView.Enabled = enabled;
jiraFilenameBox.Enabled = enabled;
jiraCommentBox.Enabled = enabled;
}
- public void setFilename(string filename) {
+ public void SetFilename(string filename) {
jiraFilenameBox.Text = filename;
}
- public void setComment(string comment) {
+ public void SetComment(string comment) {
jiraCommentBox.Text = comment;
}
- public JiraIssue getJiraIssue() {
- return selectedIssue;
+ public JiraIssue GetJiraIssue() {
+ return _selectedIssue;
}
- public void upload(IBinaryContainer attachment) {
- config.LastUsedJira = selectedIssue.Key;
- jiraConnector.addAttachment(selectedIssue.Key, jiraFilenameBox.Text, attachment);
- if (jiraCommentBox.Text != null && jiraCommentBox.Text.Length > 0) {
- jiraConnector.addComment(selectedIssue.Key, jiraCommentBox.Text);
+ public void Upload(IBinaryContainer attachment) {
+ _config.LastUsedJira = _selectedIssue.Key;
+ _jiraConnector.AddAttachment(_selectedIssue.Key, jiraFilenameBox.Text, attachment);
+ if (!string.IsNullOrEmpty(jiraCommentBox.Text)) {
+ _jiraConnector.AddComment(_selectedIssue.Key, jiraCommentBox.Text);
}
}
- public void logout() {
- jiraConnector.logout();
+ public void Logout() {
+ _jiraConnector.Logout();
}
private void selectJiraToolStripMenuItem_Click(object sender, EventArgs e) {
ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender;
- selectedIssue = (JiraIssue)clickedItem.Tag;
- jiraKey.Text = selectedIssue.Key;
+ _selectedIssue = (JiraIssue)clickedItem.Tag;
+ jiraKey.Text = _selectedIssue.Key;
}
private void jiraFilterBox_SelectedIndexChanged(object sender, EventArgs e) {
- if (jiraConnector.isLoggedIn) {
+ if (_jiraConnector.IsLoggedIn) {
JiraIssue[] issues = null;
uploadButton.Enabled = false;
JiraFilter filter = (JiraFilter)jiraFilterBox.SelectedItem;
@@ -133,7 +132,7 @@ namespace GreenshotJiraPlugin {
// Run upload in the background
new PleaseWaitForm().ShowAndWait(JiraPlugin.Instance.JiraPluginAttributes.Name, Language.GetString("jira", LangKey.communication_wait),
delegate() {
- issues = jiraConnector.getIssuesForFilter(filter.Id);
+ issues = _jiraConnector.GetIssuesForFilter(filter.Id);
}
);
jiraListView.BeginUpdate();
@@ -145,8 +144,10 @@ namespace GreenshotJiraPlugin {
jiraListView.Columns.Add(Language.GetString("jira", column));
}
foreach (JiraIssue issue in issues) {
- ListViewItem item = new ListViewItem(issue.Key);
- item.Tag = issue;
+ ListViewItem item = new ListViewItem(issue.Key)
+ {
+ Tag = issue
+ };
item.SubItems.Add(issue.Created.Value.ToString("d", DateTimeFormatInfo.InvariantInfo));
item.SubItems.Add(issue.Assignee);
item.SubItems.Add(issue.Reporter);
@@ -164,8 +165,8 @@ namespace GreenshotJiraPlugin {
private void jiraListView_SelectedIndexChanged(object sender, EventArgs e) {
if (jiraListView.SelectedItems != null && jiraListView.SelectedItems.Count > 0) {
- selectedIssue = (JiraIssue)jiraListView.SelectedItems[0].Tag;
- jiraKey.Text = selectedIssue.Key;
+ _selectedIssue = (JiraIssue)jiraListView.SelectedItems[0].Tag;
+ jiraKey.Text = _selectedIssue.Key;
uploadButton.Enabled = true;
} else {
uploadButton.Enabled = false;
@@ -174,17 +175,17 @@ namespace GreenshotJiraPlugin {
private void jiraListView_ColumnClick(object sender, ColumnClickEventArgs e) {
// Determine if clicked column is already the column that is being sorted.
- if (e.Column == columnSorter.SortColumn) {
+ if (e.Column == _columnSorter.SortColumn) {
// Reverse the current sort direction for this column.
- if (columnSorter.Order == SortOrder.Ascending) {
- columnSorter.Order = SortOrder.Descending;
+ if (_columnSorter.Order == SortOrder.Ascending) {
+ _columnSorter.Order = SortOrder.Descending;
} else {
- columnSorter.Order = SortOrder.Ascending;
+ _columnSorter.Order = SortOrder.Ascending;
}
} else {
// Set the column number that is to be sorted; default to ascending.
- columnSorter.SortColumn = e.Column;
- columnSorter.Order = SortOrder.Ascending;
+ _columnSorter.SortColumn = e.Column;
+ _columnSorter.Order = SortOrder.Ascending;
}
// Perform the sort with these new sort options.
@@ -196,8 +197,8 @@ namespace GreenshotJiraPlugin {
uploadButton.Enabled = false;
int dashIndex = jiranumber.IndexOf('-');
if (dashIndex > 0 && jiranumber.Length > dashIndex+1) {
- selectedIssue = jiraConnector.getIssue(jiraKey.Text);
- if (selectedIssue != null) {
+ _selectedIssue = _jiraConnector.GetIssue(jiraKey.Text);
+ if (_selectedIssue != null) {
uploadButton.Enabled = true;
}
}
diff --git a/GreenshotJiraPlugin/Forms/JiraFormBase.cs b/GreenshotJiraPlugin/Forms/JiraFormBase.cs
index ed43f199f..cd114513e 100644
--- a/GreenshotJiraPlugin/Forms/JiraFormBase.cs
+++ b/GreenshotJiraPlugin/Forms/JiraFormBase.cs
@@ -21,7 +21,7 @@
using GreenshotPlugin.Controls;
-namespace GreenshotJiraPlugin {
+namespace GreenshotJiraPlugin.Forms {
public class JiraFormBase : GreenshotForm {
}
}
diff --git a/GreenshotJiraPlugin/Forms/SettingsForm.Designer.cs b/GreenshotJiraPlugin/Forms/SettingsForm.Designer.cs
index 0b2132df6..98893e04b 100644
--- a/GreenshotJiraPlugin/Forms/SettingsForm.Designer.cs
+++ b/GreenshotJiraPlugin/Forms/SettingsForm.Designer.cs
@@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-namespace GreenshotJiraPlugin {
+namespace GreenshotJiraPlugin.Forms {
partial class SettingsForm {
///
/// Designer variable used to keep track of non-visual components.
diff --git a/GreenshotJiraPlugin/Forms/SettingsForm.cs b/GreenshotJiraPlugin/Forms/SettingsForm.cs
index 5e6e639da..673d4f4ea 100644
--- a/GreenshotJiraPlugin/Forms/SettingsForm.cs
+++ b/GreenshotJiraPlugin/Forms/SettingsForm.cs
@@ -19,12 +19,13 @@
* along with this program. If not, see .
*/
-namespace GreenshotJiraPlugin {
+namespace GreenshotJiraPlugin.Forms {
///
/// Description of PasswordRequestForm.
///
public partial class SettingsForm : JiraFormBase {
- public SettingsForm(JiraConfiguration config) :base () {
+ public SettingsForm()
+ {
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
diff --git a/GreenshotJiraPlugin/Jira.cs b/GreenshotJiraPlugin/Jira.cs
index a69a28c93..8af125b17 100644
--- a/GreenshotJiraPlugin/Jira.cs
+++ b/GreenshotJiraPlugin/Jira.cs
@@ -20,16 +20,16 @@
* along with this program. If not, see .
*/
-using Greenshot.IniFile;
-using GreenshotJiraPlugin;
-using GreenshotPlugin.Controls;
-using GreenshotPlugin.Core;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Windows.Forms;
+using Greenshot.IniFile;
+using GreenshotJiraPlugin.Web_References.JiraSoap;
+using GreenshotPlugin.Controls;
+using GreenshotPlugin.Core;
-namespace Jira {
+namespace GreenshotJiraPlugin {
#region transport classes
public class JiraFilter {
public JiraFilter(string name, string id) {
@@ -98,34 +98,34 @@ namespace Jira {
#endregion
public class JiraConnector : IDisposable {
- private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(JiraConnector));
- private const string AUTH_FAILED_EXCEPTION_NAME = "com.atlassian.jira.rpc.exception.RemoteAuthenticationException";
- private static readonly JiraConfiguration config = IniConfig.GetIniSection();
- public const string DEFAULT_POSTFIX = "/rpc/soap/jirasoapservice-v2?wsdl";
- private string credentials;
- private DateTime loggedInTime = DateTime.Now;
- private bool loggedIn;
- private JiraSoapServiceService jira;
- private readonly int timeout;
- private string url;
- private readonly Cache jiraCache = new Cache(60 * config.Timeout);
- private readonly Cache userCache = new Cache(60 * config.Timeout);
- private readonly bool suppressBackgroundForm = false;
+ private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(JiraConnector));
+ private const string AuthFailedExceptionName = "com.atlassian.jira.rpc.exception.RemoteAuthenticationException";
+ private static readonly JiraConfiguration Config = IniConfig.GetIniSection();
+ public const string DefaultPostfix = "/rpc/soap/jirasoapservice-v2?wsdl";
+ private string _credentials;
+ private DateTime _loggedInTime = DateTime.Now;
+ private bool _loggedIn;
+ private JiraSoapServiceService _jira;
+ private readonly int _timeout;
+ private string _url;
+ private readonly Cache _jiraCache = new Cache(60 * Config.Timeout);
+ private readonly Cache _userCache = new Cache(60 * Config.Timeout);
+ private readonly bool _suppressBackgroundForm;
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
- protected virtual void Dispose(bool disposing) {
- if (jira != null) {
- logout();
+ protected void Dispose(bool disposing) {
+ if (_jira != null) {
+ Logout();
}
if (disposing) {
- if (jira != null) {
- jira.Dispose();
- jira = null;
+ if (_jira != null) {
+ _jira.Dispose();
+ _jira = null;
}
}
}
@@ -134,27 +134,27 @@ namespace Jira {
}
public JiraConnector(bool suppressBackgroundForm) {
- url = config.Url;
- timeout = config.Timeout;
- this.suppressBackgroundForm = suppressBackgroundForm;
- createService();
+ _url = Config.Url;
+ _timeout = Config.Timeout;
+ _suppressBackgroundForm = suppressBackgroundForm;
+ CreateService();
}
- private void createService() {
- if (!suppressBackgroundForm) {
+ private void CreateService() {
+ if (!_suppressBackgroundForm) {
new PleaseWaitForm().ShowAndWait(JiraPlugin.Instance.JiraPluginAttributes.Name, Language.GetString("jira", LangKey.communication_wait),
- delegate() {
- jira = new JiraSoapServiceService();
+ delegate {
+ _jira = new JiraSoapServiceService();
}
);
} else {
- jira = new JiraSoapServiceService();
+ _jira = new JiraSoapServiceService();
}
- jira.Url = url;
- jira.Proxy = NetworkHelper.CreateProxy(new Uri(url));
+ _jira.Url = _url;
+ _jira.Proxy = NetworkHelper.CreateProxy(new Uri(_url));
// Do not use:
//jira.AllowAutoRedirect = true;
- jira.UserAgent = "Greenshot";
+ _jira.UserAgent = "Greenshot";
}
~JiraConnector() {
@@ -165,30 +165,30 @@ namespace Jira {
/// Internal login which catches the exceptions
///
/// true if login was done sucessfully
- private bool doLogin(string user, string password, bool suppressBackgroundForm) {
+ private bool DoLogin(string user, string password, bool suppressBackgroundForm) {
// This is what needs to be done
ThreadStart jiraLogin = delegate {
- LOG.DebugFormat("Loggin in");
+ Log.DebugFormat("Loggin in");
try {
- credentials = jira.login(user, password);
+ _credentials = _jira.login(user, password);
} catch (Exception) {
- if (!url.EndsWith("wsdl")) {
- url = url + "/rpc/soap/jirasoapservice-v2?wsdl";
+ if (!_url.EndsWith("wsdl")) {
+ _url = _url + "/rpc/soap/jirasoapservice-v2?wsdl";
// recreate the service with the new url
- createService();
- credentials = jira.login(user, password);
+ CreateService();
+ _credentials = _jira.login(user, password);
// Worked, store the url in the configuration
- config.Url = url;
+ Config.Url = _url;
IniConfig.Save();
} else {
throw;
}
}
- LOG.DebugFormat("Logged in");
- loggedInTime = DateTime.Now;
- loggedIn = true;
+ Log.DebugFormat("Logged in");
+ _loggedInTime = DateTime.Now;
+ _loggedIn = true;
};
// Here we do it
@@ -200,125 +200,126 @@ namespace Jira {
}
} catch (Exception e) {
// check if auth failed
- if (e.Message.Contains(AUTH_FAILED_EXCEPTION_NAME)) {
+ if (e.Message.Contains(AuthFailedExceptionName)) {
return false;
}
// Not an authentication issue
- loggedIn = false;
- credentials = null;
+ _loggedIn = false;
+ _credentials = null;
e.Data.Add("user", user);
- e.Data.Add("url", url);
+ e.Data.Add("url", _url);
throw;
}
return true;
}
- public void login() {
- login(false);
+ public void Login() {
+ Login(false);
}
- public void login(bool suppressBackgroundForm) {
- logout();
+ public void Login(bool suppressBackgroundForm) {
+ Logout();
try {
// Get the system name, so the user knows where to login to
- string systemName = url.Replace(DEFAULT_POSTFIX,"");
- CredentialsDialog dialog = new CredentialsDialog(systemName);
- dialog.Name = null;
+ string systemName = _url.Replace(DefaultPostfix,"");
+ CredentialsDialog dialog = new CredentialsDialog(systemName)
+ {
+ Name = null
+ };
while (dialog.Show(dialog.Name) == DialogResult.OK) {
- if (doLogin(dialog.Name, dialog.Password, suppressBackgroundForm)) {
+ if (DoLogin(dialog.Name, dialog.Password, suppressBackgroundForm)) {
if (dialog.SaveChecked) {
dialog.Confirm(true);
}
return;
- } else {
- try {
- dialog.Confirm(false);
- } catch (ApplicationException e) {
- // exception handling ...
- LOG.Error("Problem using the credentials dialog", e);
- }
- // For every windows version after XP show an incorrect password baloon
- dialog.IncorrectPassword = true;
- // Make sure the dialog is display, the password was false!
- dialog.AlwaysDisplay = true;
}
+ try {
+ dialog.Confirm(false);
+ } catch (ApplicationException e) {
+ // exception handling ...
+ Log.Error("Problem using the credentials dialog", e);
+ }
+ // For every windows version after XP show an incorrect password baloon
+ dialog.IncorrectPassword = true;
+ // Make sure the dialog is display, the password was false!
+ dialog.AlwaysDisplay = true;
}
} catch (ApplicationException e) {
// exception handling ...
- LOG.Error("Problem using the credentials dialog", e);
+ Log.Error("Problem using the credentials dialog", e);
}
}
- public void logout() {
- if (credentials != null) {
- jira.logout(credentials);
- credentials = null;
- loggedIn = false;
+ public void Logout() {
+ if (_credentials != null) {
+ _jira.logout(_credentials);
+ _credentials = null;
+ _loggedIn = false;
}
}
- private void checkCredentials() {
- if (loggedIn) {
- if (loggedInTime.AddMinutes(timeout-1).CompareTo(DateTime.Now) < 0) {
- logout();
- login();
+ private void CheckCredentials() {
+ if (_loggedIn) {
+ if (_loggedInTime.AddMinutes(_timeout-1).CompareTo(DateTime.Now) < 0) {
+ Logout();
+ Login();
}
} else {
- login();
+ Login();
}
}
- public bool isLoggedIn {
+ public bool IsLoggedIn {
get {
- return loggedIn;
+ return _loggedIn;
}
}
- public JiraFilter[] getFilters() {
+ public JiraFilter[] GetFilters() {
List filters = new List();
- checkCredentials();
- RemoteFilter[] remoteFilters = jira.getSavedFilters(credentials);
+ CheckCredentials();
+ RemoteFilter[] remoteFilters = _jira.getSavedFilters(_credentials);
foreach (RemoteFilter remoteFilter in remoteFilters) {
filters.Add(new JiraFilter(remoteFilter.name, remoteFilter.id));
}
return filters.ToArray();
}
- private JiraIssue createDummyErrorIssue(Exception e) {
+ private JiraIssue CreateDummyErrorIssue(Exception e) {
// Creating bogus jira to indicate a problem
return new JiraIssue("error", DateTime.Now, "error", "error", "error", e.Message, "error", "error", null);
}
- public JiraIssue getIssue(string key) {
+ public JiraIssue GetIssue(string key) {
JiraIssue jiraIssue = null;
- if (jiraCache.Contains(key)) {
- jiraIssue = jiraCache[key];
+ if (_jiraCache.Contains(key)) {
+ jiraIssue = _jiraCache[key];
}
if (jiraIssue == null) {
- checkCredentials();
+ CheckCredentials();
try {
- RemoteIssue issue = jira.getIssue(credentials, key);
- jiraIssue = new JiraIssue(issue.key, issue.created, getUserFullName(issue.reporter), getUserFullName(issue.assignee), issue.project, issue.summary, issue.description, issue.environment, issue.attachmentNames);
- jiraCache.Add(key, jiraIssue);
+ RemoteIssue issue = _jira.getIssue(_credentials, key);
+ jiraIssue = new JiraIssue(issue.key, issue.created, GetUserFullName(issue.reporter), GetUserFullName(issue.assignee), issue.project, issue.summary, issue.description, issue.environment, issue.attachmentNames);
+ _jiraCache.Add(key, jiraIssue);
} catch (Exception e) {
- LOG.Error("Problem retrieving Jira: " + key, e);
+ Log.Error("Problem retrieving Jira: " + key, e);
}
}
return jiraIssue;
}
- public JiraIssue[] getIssuesForFilter(string filterId) {
+ public JiraIssue[] GetIssuesForFilter(string filterId) {
List issuesToReturn = new List();
- checkCredentials();
+ CheckCredentials();
try {
- RemoteIssue[] issues = jira.getIssuesFromFilter(credentials, filterId);
+ RemoteIssue[] issues = _jira.getIssuesFromFilter(_credentials, filterId);
#region Username cache update
List users = new List();
foreach (RemoteIssue issue in issues) {
- if (issue.reporter != null && !hasUser(issue.reporter) && !users.Contains(issue.reporter)) {
+ if (issue.reporter != null && !HasUser(issue.reporter) && !users.Contains(issue.reporter)) {
users.Add(issue.reporter);
}
- if (issue.assignee != null && !hasUser(issue.assignee) && !users.Contains(issue.assignee)) {
+ if (issue.assignee != null && !HasUser(issue.assignee) && !users.Contains(issue.assignee)) {
users.Add(issue.assignee);
}
}
@@ -327,8 +328,8 @@ namespace Jira {
ManualResetEvent doneEvent = new ManualResetEvent(false);
for (int i = 0; i < users.Count; i++) {
ThreadPool.QueueUserWorkItem(delegate(object name) {
- LOG.InfoFormat("Retrieving {0}", name);
- getUserFullName((string)name);
+ Log.InfoFormat("Retrieving {0}", name);
+ GetUserFullName((string)name);
if (Interlocked.Decrement(ref taskCount) == 0) {
doneEvent.Set();
}
@@ -340,65 +341,67 @@ namespace Jira {
foreach (RemoteIssue issue in issues) {
try {
- JiraIssue jiraIssue = new JiraIssue(issue.key, issue.created, getUserFullName(issue.reporter), getUserFullName(issue.assignee), issue.project, issue.summary, issue.description, "", issue.attachmentNames);
+ JiraIssue jiraIssue = new JiraIssue(issue.key, issue.created, GetUserFullName(issue.reporter), GetUserFullName(issue.assignee), issue.project, issue.summary, issue.description, "", issue.attachmentNames);
issuesToReturn.Add(jiraIssue);
} catch (Exception e) {
- LOG.Error("Problem retrieving Jira: " + issue.key, e);
- JiraIssue jiraIssue = createDummyErrorIssue(e);
+ Log.Error("Problem retrieving Jira: " + issue.key, e);
+ JiraIssue jiraIssue = CreateDummyErrorIssue(e);
jiraIssue.Key = issue.key;
issuesToReturn.Add(jiraIssue);
}
}
} catch (Exception e) {
- LOG.Error("Problem retrieving Jiras for Filter: " + filterId, e);
- issuesToReturn.Add(createDummyErrorIssue(e));
+ Log.Error("Problem retrieving Jiras for Filter: " + filterId, e);
+ issuesToReturn.Add(CreateDummyErrorIssue(e));
}
return issuesToReturn.ToArray(); ;
}
- public string getURL(string issueKey) {
- return url.Replace(DEFAULT_POSTFIX,"") + "/browse/" + issueKey;
+ public string GetUrl(string issueKey) {
+ return _url.Replace(DefaultPostfix,"") + "/browse/" + issueKey;
}
- public void addAttachment(string issueKey, string filename, IBinaryContainer attachment) {
- checkCredentials();
+ public void AddAttachment(string issueKey, string filename, IBinaryContainer attachment) {
+ CheckCredentials();
try {
- jira.addBase64EncodedAttachmentsToIssue(credentials, issueKey, new string[] { filename }, new string[] { attachment.ToBase64String(Base64FormattingOptions.InsertLineBreaks) });
+ _jira.addBase64EncodedAttachmentsToIssue(_credentials, issueKey, new[] { filename }, new[] { attachment.ToBase64String(Base64FormattingOptions.InsertLineBreaks) });
} catch (Exception ex1) {
- LOG.WarnFormat("Failed to upload by using method addBase64EncodedAttachmentsToIssue, error was {0}", ex1.Message);
+ Log.WarnFormat("Failed to upload by using method addBase64EncodedAttachmentsToIssue, error was {0}", ex1.Message);
try {
- LOG.Warn("Trying addAttachmentsToIssue instead");
- jira.addAttachmentsToIssue(credentials, issueKey, new string[] { filename }, (sbyte[])(Array)attachment.ToByteArray());
+ Log.Warn("Trying addAttachmentsToIssue instead");
+ _jira.addAttachmentsToIssue(_credentials, issueKey, new[] { filename }, (sbyte[])(Array)attachment.ToByteArray());
} catch (Exception ex2) {
- LOG.WarnFormat("Failed to use alternative method, error was: {0}", ex2.Message);
+ Log.WarnFormat("Failed to use alternative method, error was: {0}", ex2.Message);
throw;
}
}
}
- public void addComment(string issueKey, string commentString) {
- RemoteComment comment = new RemoteComment();
- comment.body = commentString;
- checkCredentials();
- jira.addComment(credentials, issueKey, comment);
+ public void AddComment(string issueKey, string commentString) {
+ RemoteComment comment = new RemoteComment
+ {
+ body = commentString
+ };
+ CheckCredentials();
+ _jira.addComment(_credentials, issueKey, comment);
}
- private bool hasUser(string user) {
+ private bool HasUser(string user) {
if (user != null) {
- return userCache.Contains(user);
+ return _userCache.Contains(user);
}
return false;
}
- private string getUserFullName(string user) {
- string fullname = null;
+ private string GetUserFullName(string user) {
+ string fullname;
if (user != null) {
- if (userCache.Contains(user)) {
- fullname = userCache[user].fullname;
+ if (_userCache.Contains(user)) {
+ fullname = _userCache[user].fullname;
} else {
- checkCredentials();
- RemoteUser remoteUser = jira.getUser(credentials, user);
- userCache.Add(user, remoteUser);
+ CheckCredentials();
+ RemoteUser remoteUser = _jira.getUser(_credentials, user);
+ _userCache.Add(user, remoteUser);
fullname = remoteUser.fullname;
}
} else {
diff --git a/GreenshotJiraPlugin/JiraConfiguration.cs b/GreenshotJiraPlugin/JiraConfiguration.cs
index 8dbdfb471..82a4982f8 100644
--- a/GreenshotJiraPlugin/JiraConfiguration.cs
+++ b/GreenshotJiraPlugin/JiraConfiguration.cs
@@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-using System.Windows.Forms;
+
using Greenshot.IniFile;
using GreenshotPlugin.Core;
@@ -28,35 +28,22 @@ namespace GreenshotJiraPlugin {
///
[IniSection("Jira", Description="Greenshot Jira Plugin configuration")]
public class JiraConfiguration : IniSection {
- public const string DEFAULT_PREFIX = "http://";
- private const string DEFAULT_URL = DEFAULT_PREFIX + "jira" + Jira.JiraConnector.DEFAULT_POSTFIX;
+ public const string DefaultPrefix = "http://";
+ private const string DefaultUrl = DefaultPrefix + "jira" + JiraConnector.DefaultPostfix;
- [IniProperty("Url", Description="Url to Jira system, including wsdl.", DefaultValue=DEFAULT_URL)]
- public string Url;
+ [IniProperty("Url", Description="Url to Jira system, including wsdl.", DefaultValue=DefaultUrl)]
+ public string Url { get; set; }
[IniProperty("Timeout", Description="Session timeout in minutes", DefaultValue="30")]
- public int Timeout;
-
+ public int Timeout { get; set; }
+
[IniProperty("LastUsedJira", Description="Last used Jira")]
- public string LastUsedJira;
+ public string LastUsedJira { get; set; }
[IniProperty("UploadFormat", Description="What file type to use for uploading", DefaultValue="png")]
- public OutputFormat UploadFormat;
+ public OutputFormat UploadFormat { get; set; }
[IniProperty("UploadJpegQuality", Description="JPEG file save quality in %.", DefaultValue="80")]
- public int UploadJpegQuality;
+ public int UploadJpegQuality { get; set; }
[IniProperty("UploadReduceColors", Description="Reduce color amount of the uploaded image to 256", DefaultValue="False")]
- public bool UploadReduceColors;
-
- ///
- /// A form for username/password
- ///
- /// bool true if OK was pressed, false if cancel
- public bool ShowConfigDialog() {
- SettingsForm settingsForm = new SettingsForm(this);
- DialogResult result = settingsForm.ShowDialog();
- if (result == DialogResult.OK) {
- return true;
- }
- return false;
- }
+ public bool UploadReduceColors { get; set; }
}
}
diff --git a/GreenshotJiraPlugin/JiraDestination.cs b/GreenshotJiraPlugin/JiraDestination.cs
index bbce4e9bc..7d12bf79b 100644
--- a/GreenshotJiraPlugin/JiraDestination.cs
+++ b/GreenshotJiraPlugin/JiraDestination.cs
@@ -18,6 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
+
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -26,27 +27,27 @@ using System.IO;
using System.Windows.Forms;
using Greenshot.IniFile;
using Greenshot.Plugin;
+using GreenshotJiraPlugin.Forms;
using GreenshotPlugin.Controls;
using GreenshotPlugin.Core;
-using Jira;
namespace GreenshotJiraPlugin {
///
/// Description of JiraDestination.
///
public class JiraDestination : AbstractDestination {
- private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(JiraDestination));
- private static readonly JiraConfiguration config = IniConfig.GetIniSection();
- private readonly JiraPlugin jiraPlugin = null;
- private readonly JiraIssue jira = null;
+ private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(JiraDestination));
+ private static readonly JiraConfiguration Config = IniConfig.GetIniSection();
+ private readonly JiraPlugin _jiraPlugin;
+ private readonly JiraIssue _jira;
public JiraDestination(JiraPlugin jiraPlugin) {
- this.jiraPlugin = jiraPlugin;
+ _jiraPlugin = jiraPlugin;
}
public JiraDestination(JiraPlugin jiraPlugin, JiraIssue jira) {
- this.jiraPlugin = jiraPlugin;
- this.jira = jira;
+ _jiraPlugin = jiraPlugin;
+ _jira = jira;
}
public override string Designation {
@@ -60,18 +61,18 @@ namespace GreenshotJiraPlugin {
}
public override string Description {
- get {
- if (jira == null) {
+ get
+ {
+ if (_jira == null) {
return Language.GetString("jira", LangKey.upload_menu_item);
- } else {
- return FormatUpload(jira);
}
+ return FormatUpload(_jira);
}
}
public override bool isActive {
get {
- return base.isActive && !string.IsNullOrEmpty(config.Url);
+ return base.isActive && !string.IsNullOrEmpty(Config.Url);
}
}
@@ -82,36 +83,36 @@ namespace GreenshotJiraPlugin {
}
public override Image DisplayIcon {
get {
- ComponentResourceManager resources = new ComponentResourceManager(typeof(JiraPlugin));
+ var resources = new ComponentResourceManager(typeof(JiraPlugin));
return (Image)resources.GetObject("Jira");
}
}
public override IEnumerable DynamicDestinations() {
- if (JiraPlugin.Instance.CurrentJiraConnector == null || !JiraPlugin.Instance.CurrentJiraConnector.isLoggedIn) {
+ if (JiraPlugin.Instance.CurrentJiraConnector == null || !JiraPlugin.Instance.CurrentJiraConnector.IsLoggedIn) {
yield break;
}
List issues = JiraUtils.GetCurrentJiras();
if (issues != null) {
- foreach(JiraIssue jiraIssue in issues) {
- yield return new JiraDestination(jiraPlugin, jiraIssue);
+ foreach(var jiraIssue in issues) {
+ yield return new JiraDestination(_jiraPlugin, jiraIssue);
}
}
}
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surfaceToUpload, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(Designation, Description);
- string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails));
- SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(config.UploadFormat, config.UploadJpegQuality, config.UploadReduceColors);
- if (jira != null) {
+ string filename = Path.GetFileName(FilenameHelper.GetFilename(Config.UploadFormat, captureDetails));
+ SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(Config.UploadFormat, Config.UploadJpegQuality, Config.UploadReduceColors);
+ if (_jira != null) {
try {
// Run upload in the background
new PleaseWaitForm().ShowAndWait(Description, Language.GetString("jira", LangKey.communication_wait),
- delegate() {
- jiraPlugin.JiraConnector.addAttachment(jira.Key, filename, new SurfaceContainer(surfaceToUpload, outputSettings, filename));
+ delegate {
+ _jiraPlugin.JiraConnector.AddAttachment(_jira.Key, filename, new SurfaceContainer(surfaceToUpload, outputSettings, filename));
}
);
- LOG.Debug("Uploaded to Jira.");
+ Log.Debug("Uploaded to Jira.");
exportInformation.ExportMade = true;
// TODO: This can't work:
exportInformation.Uri = surfaceToUpload.UploadURL;
@@ -119,19 +120,19 @@ namespace GreenshotJiraPlugin {
MessageBox.Show(Language.GetString("jira", LangKey.upload_failure) + " " + e.Message);
}
} else {
- JiraForm jiraForm = new JiraForm(jiraPlugin.JiraConnector);
- if (jiraPlugin.JiraConnector.isLoggedIn) {
- jiraForm.setFilename(filename);
+ JiraForm jiraForm = new JiraForm(_jiraPlugin.JiraConnector);
+ if (_jiraPlugin.JiraConnector.IsLoggedIn) {
+ jiraForm.SetFilename(filename);
DialogResult result = jiraForm.ShowDialog();
if (result == DialogResult.OK) {
try {
// Run upload in the background
new PleaseWaitForm().ShowAndWait(Description, Language.GetString("jira", LangKey.communication_wait),
- delegate() {
- jiraForm.upload(new SurfaceContainer(surfaceToUpload, outputSettings, filename));
+ delegate {
+ jiraForm.Upload(new SurfaceContainer(surfaceToUpload, outputSettings, filename));
}
);
- LOG.Debug("Uploaded to Jira.");
+ Log.Debug("Uploaded to Jira.");
exportInformation.ExportMade = true;
// TODO: This can't work:
exportInformation.Uri = surfaceToUpload.UploadURL;
diff --git a/GreenshotJiraPlugin/JiraPlugin.cs b/GreenshotJiraPlugin/JiraPlugin.cs
index 217205e5e..84b81adcd 100644
--- a/GreenshotJiraPlugin/JiraPlugin.cs
+++ b/GreenshotJiraPlugin/JiraPlugin.cs
@@ -23,21 +23,19 @@ using System.ComponentModel;
using System.Windows.Forms;
using Greenshot.IniFile;
using Greenshot.Plugin;
-using Jira;
using System;
+using GreenshotJiraPlugin.Forms;
namespace GreenshotJiraPlugin {
///
/// This is the JiraPlugin base code
///
public class JiraPlugin : IGreenshotPlugin {
- private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(JiraPlugin));
- private PluginAttribute jiraPluginAttributes;
- private IGreenshotHost host;
- private JiraConnector jiraConnector = null;
- private JiraConfiguration config = null;
- private ComponentResourceManager resources;
- private static JiraPlugin instance = null;
+ private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(JiraPlugin));
+ private PluginAttribute _jiraPluginAttributes;
+ private JiraConnector _jiraConnector;
+ private JiraConfiguration _config;
+ private static JiraPlugin _instance;
public void Dispose() {
Dispose(true);
@@ -46,26 +44,26 @@ namespace GreenshotJiraPlugin {
protected virtual void Dispose(bool disposing) {
if (disposing) {
- if (jiraConnector != null) {
- jiraConnector.Dispose();
- jiraConnector = null;
+ if (_jiraConnector != null) {
+ _jiraConnector.Dispose();
+ _jiraConnector = null;
}
}
}
public static JiraPlugin Instance {
get {
- return instance;
+ return _instance;
}
}
public JiraPlugin() {
- instance = this;
+ _instance = this;
}
public PluginAttribute JiraPluginAttributes {
get {
- return jiraPluginAttributes;
+ return _jiraPluginAttributes;
}
}
@@ -80,40 +78,38 @@ namespace GreenshotJiraPlugin {
//Needed for a fail-fast
public JiraConnector CurrentJiraConnector {
get {
- return jiraConnector;
+ return _jiraConnector;
}
}
public JiraConnector JiraConnector {
get {
- if (jiraConnector == null) {
- jiraConnector = new JiraConnector(true);
+ if (_jiraConnector == null) {
+ _jiraConnector = new JiraConnector(true);
}
- return jiraConnector;
+ return _jiraConnector;
}
}
///
/// Implementation of the IGreenshotPlugin.Initialize
///
- /// Use the IGreenshotPluginHost interface to register events
- /// Use the ICaptureHost interface to register in the MainContextMenu
- /// My own attributes
+ /// Use the IGreenshotPluginHost interface to register events
+ /// My own attributes
/// true if plugin is initialized, false if not (doesn't show)
public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
- host = (IGreenshotHost)pluginHost;
- jiraPluginAttributes = myAttributes;
+ _jiraPluginAttributes = myAttributes;
// Register configuration (don't need the configuration itself)
- config = IniConfig.GetIniSection();
- resources = new ComponentResourceManager(typeof(JiraPlugin));
+ _config = IniConfig.GetIniSection();
+ new ComponentResourceManager(typeof(JiraPlugin));
return true;
}
public virtual void Shutdown() {
- LOG.Debug("Jira Plugin shutdown.");
- if (jiraConnector != null) {
- jiraConnector.logout();
+ Log.Debug("Jira Plugin shutdown.");
+ if (_jiraConnector != null) {
+ _jiraConnector.Logout();
}
}
@@ -121,25 +117,40 @@ namespace GreenshotJiraPlugin {
/// Implementation of the IPlugin.Configure
///
public virtual void Configure() {
- string url = config.Url;
- if (config.ShowConfigDialog()) {
+ string url = _config.Url;
+ if (ShowConfigDialog()) {
// check for re-login
- if (jiraConnector != null && jiraConnector.isLoggedIn && !string.IsNullOrEmpty(url)) {
- if (!url.Equals(config.Url)) {
- jiraConnector.logout();
- jiraConnector.login();
+ if (_jiraConnector != null && _jiraConnector.IsLoggedIn && !string.IsNullOrEmpty(url)) {
+ if (!url.Equals(_config.Url)) {
+ _jiraConnector.Logout();
+ _jiraConnector.Login();
}
}
}
}
+ ///
+ /// A form for username/password
+ ///
+ /// bool true if OK was pressed, false if cancel
+ private bool ShowConfigDialog()
+ {
+ var settingsForm = new SettingsForm();
+ var result = settingsForm.ShowDialog();
+ if (result == DialogResult.OK)
+ {
+ return true;
+ }
+ return false;
+ }
+
///
/// This will be called when Greenshot is shutting down
///
///
///
public void Closing(object sender, FormClosingEventArgs e) {
- LOG.Debug("Application closing, calling logout of jira!");
+ Log.Debug("Application closing, calling logout of jira!");
Shutdown();
}
}
diff --git a/GreenshotJiraPlugin/JiraUtils.cs b/GreenshotJiraPlugin/JiraUtils.cs
index 521b9ef58..3dcf945c4 100644
--- a/GreenshotJiraPlugin/JiraUtils.cs
+++ b/GreenshotJiraPlugin/JiraUtils.cs
@@ -22,15 +22,14 @@ using System.Collections.Generic;
using System.Text.RegularExpressions;
using Greenshot.IniFile;
using GreenshotPlugin.Core;
-using Jira;
namespace GreenshotJiraPlugin {
///
/// Description of JiraUtils.
///
- public class JiraUtils {
- private static readonly Regex JIRA_KEY_REGEX = new Regex(@"/browse/([A-Z0-9]+\-[0-9]+)");
- private static readonly JiraConfiguration config = IniConfig.GetIniSection();
+ public static class JiraUtils {
+ private static readonly Regex JiraKeyRegex = new Regex(@"/browse/([A-Z0-9]+\-[0-9]+)");
+ private static readonly JiraConfiguration Config = IniConfig.GetIniSection();
public static List GetCurrentJiras() {
// Make sure we suppress the login
@@ -39,24 +38,30 @@ namespace GreenshotJiraPlugin {
if (url == null) {
continue;
}
- MatchCollection jiraKeyMatch = JIRA_KEY_REGEX.Matches(url);
- if (jiraKeyMatch != null && jiraKeyMatch.Count > 0) {
+ MatchCollection jiraKeyMatch = JiraKeyRegex.Matches(url);
+ if (jiraKeyMatch.Count > 0) {
string jiraKey = jiraKeyMatch[0].Groups[1].Value;
jirakeys.Add(jiraKey);
}
}
- if (!string.IsNullOrEmpty(config.LastUsedJira) && !jirakeys.Contains(config.LastUsedJira)) {
- jirakeys.Add(config.LastUsedJira);
+ if (!string.IsNullOrEmpty(Config.LastUsedJira) && !jirakeys.Contains(Config.LastUsedJira)) {
+ jirakeys.Add(Config.LastUsedJira);
}
if (jirakeys.Count > 0) {
List jiraIssues = new List();
foreach(string jiraKey in jirakeys) {
- try {
- JiraIssue issue = JiraPlugin.Instance.JiraConnector.getIssue(jiraKey);
- if (issue != null) {
+ try
+ {
+ JiraIssue issue = JiraPlugin.Instance.JiraConnector.GetIssue(jiraKey);
+ if (issue != null)
+ {
jiraIssues.Add(issue);
}
- } catch {}
+ }
+ catch
+ {
+
+ }
}
if (jiraIssues.Count > 0) {
return jiraIssues;
diff --git a/GreenshotJiraPlugin/Properties/AssemblyInfo.cs b/GreenshotJiraPlugin/Properties/AssemblyInfo.cs
index 38a34799f..dc12030a2 100644
--- a/GreenshotJiraPlugin/Properties/AssemblyInfo.cs
+++ b/GreenshotJiraPlugin/Properties/AssemblyInfo.cs
@@ -35,7 +35,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The PluginAttribute describes the "entryType" and if the plugin is configurable
-[assembly: PluginAttribute("GreenshotJiraPlugin.JiraPlugin", true)]
+[assembly: Plugin("GreenshotJiraPlugin.JiraPlugin", true)]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
diff --git a/GreenshotJiraPlugin/Web References/JiraSoap/Reference.cs b/GreenshotJiraPlugin/Web References/JiraSoap/Reference.cs
index d28aed3eb..6633d436c 100644
--- a/GreenshotJiraPlugin/Web References/JiraSoap/Reference.cs
+++ b/GreenshotJiraPlugin/Web References/JiraSoap/Reference.cs
@@ -8,26 +8,25 @@
//
//------------------------------------------------------------------------------
-namespace Jira
+using System;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Web.Services;
+using System.Web.Services.Protocols;
+using System.Xml.Serialization;
+
+namespace GreenshotJiraPlugin.Web_References.JiraSoap
{
- using System.Diagnostics;
- using System.Web.Services;
- using System.ComponentModel;
- using System.Web.Services.Protocols;
- using System;
- using System.Xml.Serialization;
-
-
- ///
+ ///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Web.Services.WebServiceBindingAttribute(Name="jirasoapservice-v2SoapBinding", Namespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteRoleActor))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteFieldValue))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteCustomFieldValue))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemotePermissionMapping))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(AbstractRemoteEntity))]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [WebServiceBinding(Name="jirasoapservice-v2SoapBinding", Namespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapInclude(typeof(RemoteRoleActor))]
+ [SoapInclude(typeof(RemoteFieldValue))]
+ [SoapInclude(typeof(RemoteCustomFieldValue))]
+ [SoapInclude(typeof(RemotePermissionMapping))]
+ [SoapInclude(typeof(AbstractRemoteEntity))]
public partial class JiraSoapServiceService : System.Web.Services.Protocols.SoapHttpClientProtocol
{
@@ -38,8 +37,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getCommentReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getCommentReturn")]
public RemoteComment getComment(string in0, long in1)
{
object[] results = this.Invoke("getComment", new object[] {
@@ -64,8 +63,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getServerInfoReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getServerInfoReturn")]
public RemoteServerInfo getServerInfo(string in0)
{
object[] results = this.Invoke("getServerInfo", new object[] {
@@ -88,8 +87,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getGroupReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getGroupReturn")]
public RemoteGroup getGroup(string in0, string in1)
{
object[] results = this.Invoke("getGroup", new object[] {
@@ -114,8 +113,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("loginReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("loginReturn")]
public string login(string in0, string in1)
{
object[] results = this.Invoke("login", new object[] {
@@ -140,8 +139,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getUserReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getUserReturn")]
public RemoteUser getUser(string in0, string in1)
{
object[] results = this.Invoke("getUser", new object[] {
@@ -166,8 +165,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getIssueReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getIssueReturn")]
public RemoteIssue getIssue(string in0, string in1)
{
object[] results = this.Invoke("getIssue", new object[] {
@@ -192,8 +191,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getVersionsReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getVersionsReturn")]
public RemoteVersion[] getVersions(string in0, string in1)
{
object[] results = this.Invoke("getVersions", new object[] {
@@ -218,8 +217,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getComponentsReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getComponentsReturn")]
public RemoteComponent[] getComponents(string in0, string in1)
{
object[] results = this.Invoke("getComponents", new object[] {
@@ -244,8 +243,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("createGroupReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("createGroupReturn")]
public RemoteGroup createGroup(string in0, string in1, RemoteUser in2)
{
object[] results = this.Invoke("createGroup", new object[] {
@@ -272,8 +271,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("createUserReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("createUserReturn")]
public RemoteUser createUser(string in0, string in1, string in2, string in3, string in4)
{
object[] results = this.Invoke("createUser", new object[] {
@@ -304,8 +303,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("createIssueReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("createIssueReturn")]
public RemoteIssue createIssue(string in0, RemoteIssue in1)
{
object[] results = this.Invoke("createIssue", new object[] {
@@ -330,8 +329,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("updateIssueReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("updateIssueReturn")]
public RemoteIssue updateIssue(string in0, string in1, RemoteFieldValue[] in2)
{
object[] results = this.Invoke("updateIssue", new object[] {
@@ -358,7 +357,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void deleteIssue(string in0, string in1)
{
this.Invoke("deleteIssue", new object[] {
@@ -381,8 +380,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getAvailableActionsReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getAvailableActionsReturn")]
public RemoteNamedObject[] getAvailableActions(string in0, string in1)
{
object[] results = this.Invoke("getAvailableActions", new object[] {
@@ -407,8 +406,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getSubTaskIssueTypesReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getSubTaskIssueTypesReturn")]
public RemoteIssueType[] getSubTaskIssueTypes(string in0)
{
object[] results = this.Invoke("getSubTaskIssueTypes", new object[] {
@@ -431,8 +430,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getConfigurationReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getConfigurationReturn")]
public RemoteConfiguration getConfiguration(string in0)
{
object[] results = this.Invoke("getConfiguration", new object[] {
@@ -455,8 +454,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("createProjectReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("createProjectReturn")]
public RemoteProject createProject(string in0, string in1, string in2, string in3, string in4, string in5, RemotePermissionScheme in6, RemoteScheme in7, RemoteScheme in8)
{
object[] results = this.Invoke("createProject", new object[] {
@@ -495,8 +494,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("updateProjectReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("updateProjectReturn")]
public RemoteProject updateProject(string in0, RemoteProject in1)
{
object[] results = this.Invoke("updateProject", new object[] {
@@ -521,8 +520,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getProjectByKeyReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getProjectByKeyReturn")]
public RemoteProject getProjectByKey(string in0, string in1)
{
object[] results = this.Invoke("getProjectByKey", new object[] {
@@ -547,7 +546,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void removeAllRoleActorsByProject(string in0, RemoteProject in1)
{
this.Invoke("removeAllRoleActorsByProject", new object[] {
@@ -570,8 +569,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getPrioritiesReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getPrioritiesReturn")]
public RemotePriority[] getPriorities(string in0)
{
object[] results = this.Invoke("getPriorities", new object[] {
@@ -594,8 +593,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getResolutionsReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getResolutionsReturn")]
public RemoteResolution[] getResolutions(string in0)
{
object[] results = this.Invoke("getResolutions", new object[] {
@@ -618,8 +617,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getIssueTypesReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getIssueTypesReturn")]
public RemoteIssueType[] getIssueTypes(string in0)
{
object[] results = this.Invoke("getIssueTypes", new object[] {
@@ -642,8 +641,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getStatusesReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getStatusesReturn")]
public RemoteStatus[] getStatuses(string in0)
{
object[] results = this.Invoke("getStatuses", new object[] {
@@ -666,8 +665,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getIssueTypesForProjectReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getIssueTypesForProjectReturn")]
public RemoteIssueType[] getIssueTypesForProject(string in0, string in1)
{
object[] results = this.Invoke("getIssueTypesForProject", new object[] {
@@ -692,8 +691,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getProjectRolesReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getProjectRolesReturn")]
public RemoteProjectRole[] getProjectRoles(string in0)
{
object[] results = this.Invoke("getProjectRoles", new object[] {
@@ -716,8 +715,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getProjectRoleReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getProjectRoleReturn")]
public RemoteProjectRole getProjectRole(string in0, long in1)
{
object[] results = this.Invoke("getProjectRole", new object[] {
@@ -742,8 +741,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getProjectRoleActorsReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getProjectRoleActorsReturn")]
public RemoteProjectRoleActors getProjectRoleActors(string in0, RemoteProjectRole in1, RemoteProject in2)
{
object[] results = this.Invoke("getProjectRoleActors", new object[] {
@@ -770,8 +769,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getDefaultRoleActorsReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getDefaultRoleActorsReturn")]
public RemoteRoleActors getDefaultRoleActors(string in0, RemoteProjectRole in1)
{
object[] results = this.Invoke("getDefaultRoleActors", new object[] {
@@ -796,7 +795,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void removeAllRoleActorsByNameAndType(string in0, string in1, string in2)
{
this.Invoke("removeAllRoleActorsByNameAndType", new object[] {
@@ -821,7 +820,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void deleteProjectRole(string in0, RemoteProjectRole in1, bool in2)
{
this.Invoke("deleteProjectRole", new object[] {
@@ -846,7 +845,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void updateProjectRole(string in0, RemoteProjectRole in1)
{
this.Invoke("updateProjectRole", new object[] {
@@ -869,8 +868,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("createProjectRoleReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("createProjectRoleReturn")]
public RemoteProjectRole createProjectRole(string in0, RemoteProjectRole in1)
{
object[] results = this.Invoke("createProjectRole", new object[] {
@@ -895,8 +894,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("isProjectRoleNameUniqueReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("isProjectRoleNameUniqueReturn")]
public bool isProjectRoleNameUnique(string in0, string in1)
{
object[] results = this.Invoke("isProjectRoleNameUnique", new object[] {
@@ -921,7 +920,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void addActorsToProjectRole(string in0, string[] in1, RemoteProjectRole in2, RemoteProject in3, string in4)
{
this.Invoke("addActorsToProjectRole", new object[] {
@@ -950,7 +949,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void removeActorsFromProjectRole(string in0, string[] in1, RemoteProjectRole in2, RemoteProject in3, string in4)
{
this.Invoke("removeActorsFromProjectRole", new object[] {
@@ -979,7 +978,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void addDefaultActorsToProjectRole(string in0, string[] in1, RemoteProjectRole in2, string in3)
{
this.Invoke("addDefaultActorsToProjectRole", new object[] {
@@ -1006,7 +1005,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void removeDefaultActorsFromProjectRole(string in0, string[] in1, RemoteProjectRole in2, string in3)
{
this.Invoke("removeDefaultActorsFromProjectRole", new object[] {
@@ -1033,8 +1032,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getAssociatedNotificationSchemesReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getAssociatedNotificationSchemesReturn")]
public RemoteScheme[] getAssociatedNotificationSchemes(string in0, RemoteProjectRole in1)
{
object[] results = this.Invoke("getAssociatedNotificationSchemes", new object[] {
@@ -1059,8 +1058,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getAssociatedPermissionSchemesReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getAssociatedPermissionSchemesReturn")]
public RemoteScheme[] getAssociatedPermissionSchemes(string in0, RemoteProjectRole in1)
{
object[] results = this.Invoke("getAssociatedPermissionSchemes", new object[] {
@@ -1085,7 +1084,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void deleteProject(string in0, string in1)
{
this.Invoke("deleteProject", new object[] {
@@ -1108,8 +1107,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getProjectByIdReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getProjectByIdReturn")]
public RemoteProject getProjectById(string in0, long in1)
{
object[] results = this.Invoke("getProjectById", new object[] {
@@ -1134,8 +1133,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getCustomFieldsReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getCustomFieldsReturn")]
public RemoteField[] getCustomFields(string in0)
{
object[] results = this.Invoke("getCustomFields", new object[] {
@@ -1158,8 +1157,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getCommentsReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getCommentsReturn")]
public RemoteComment[] getComments(string in0, string in1)
{
object[] results = this.Invoke("getComments", new object[] {
@@ -1184,8 +1183,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getFavouriteFiltersReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getFavouriteFiltersReturn")]
public RemoteFilter[] getFavouriteFilters(string in0)
{
object[] results = this.Invoke("getFavouriteFilters", new object[] {
@@ -1208,7 +1207,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void releaseVersion(string in0, string in1, RemoteVersion in2)
{
this.Invoke("releaseVersion", new object[] {
@@ -1233,7 +1232,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void archiveVersion(string in0, string in1, string in2, bool in3)
{
this.Invoke("archiveVersion", new object[] {
@@ -1260,8 +1259,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getFieldsForEditReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getFieldsForEditReturn")]
public RemoteField[] getFieldsForEdit(string in0, string in1)
{
object[] results = this.Invoke("getFieldsForEdit", new object[] {
@@ -1286,8 +1285,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getSubTaskIssueTypesForProjectReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getSubTaskIssueTypesForProjectReturn")]
public RemoteIssueType[] getSubTaskIssueTypesForProject(string in0, string in1)
{
object[] results = this.Invoke("getSubTaskIssueTypesForProject", new object[] {
@@ -1312,7 +1311,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void addUserToGroup(string in0, RemoteGroup in1, RemoteUser in2)
{
this.Invoke("addUserToGroup", new object[] {
@@ -1337,7 +1336,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void removeUserFromGroup(string in0, RemoteGroup in1, RemoteUser in2)
{
this.Invoke("removeUserFromGroup", new object[] {
@@ -1362,8 +1361,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getSecurityLevelReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getSecurityLevelReturn")]
public RemoteSecurityLevel getSecurityLevel(string in0, string in1)
{
object[] results = this.Invoke("getSecurityLevel", new object[] {
@@ -1388,8 +1387,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("logoutReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("logoutReturn")]
public bool logout(string in0)
{
object[] results = this.Invoke("logout", new object[] {
@@ -1412,7 +1411,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void addComment(string in0, string in1, RemoteComment in2)
{
this.Invoke("addComment", new object[] {
@@ -1437,8 +1436,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getProjectWithSchemesByIdReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getProjectWithSchemesByIdReturn")]
public RemoteProject getProjectWithSchemesById(string in0, long in1)
{
object[] results = this.Invoke("getProjectWithSchemesById", new object[] {
@@ -1463,8 +1462,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getSecurityLevelsReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getSecurityLevelsReturn")]
public RemoteSecurityLevel[] getSecurityLevels(string in0, string in1)
{
object[] results = this.Invoke("getSecurityLevels", new object[] {
@@ -1489,8 +1488,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getProjectAvatarsReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getProjectAvatarsReturn")]
public RemoteAvatar[] getProjectAvatars(string in0, string in1, bool in2)
{
object[] results = this.Invoke("getProjectAvatars", new object[] {
@@ -1517,7 +1516,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void setProjectAvatar(string in0, string in1, long in2)
{
this.Invoke("setProjectAvatar", new object[] {
@@ -1542,8 +1541,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getProjectAvatarReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getProjectAvatarReturn")]
public RemoteAvatar getProjectAvatar(string in0, string in1)
{
object[] results = this.Invoke("getProjectAvatar", new object[] {
@@ -1568,7 +1567,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void deleteProjectAvatar(string in0, long in1)
{
this.Invoke("deleteProjectAvatar", new object[] {
@@ -1591,8 +1590,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getNotificationSchemesReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getNotificationSchemesReturn")]
public RemoteScheme[] getNotificationSchemes(string in0)
{
object[] results = this.Invoke("getNotificationSchemes", new object[] {
@@ -1615,8 +1614,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getPermissionSchemesReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getPermissionSchemesReturn")]
public RemotePermissionScheme[] getPermissionSchemes(string in0)
{
object[] results = this.Invoke("getPermissionSchemes", new object[] {
@@ -1639,8 +1638,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getAllPermissionsReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getAllPermissionsReturn")]
public RemotePermission[] getAllPermissions(string in0)
{
object[] results = this.Invoke("getAllPermissions", new object[] {
@@ -1663,8 +1662,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("createPermissionSchemeReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("createPermissionSchemeReturn")]
public RemotePermissionScheme createPermissionScheme(string in0, string in1, string in2)
{
object[] results = this.Invoke("createPermissionScheme", new object[] {
@@ -1691,8 +1690,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("addPermissionToReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("addPermissionToReturn")]
public RemotePermissionScheme addPermissionTo(string in0, RemotePermissionScheme in1, RemotePermission in2, RemoteEntity in3)
{
object[] results = this.Invoke("addPermissionTo", new object[] {
@@ -1721,8 +1720,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("deletePermissionFromReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("deletePermissionFromReturn")]
public RemotePermissionScheme deletePermissionFrom(string in0, RemotePermissionScheme in1, RemotePermission in2, RemoteEntity in3)
{
object[] results = this.Invoke("deletePermissionFrom", new object[] {
@@ -1751,7 +1750,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void deletePermissionScheme(string in0, string in1)
{
this.Invoke("deletePermissionScheme", new object[] {
@@ -1774,8 +1773,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("createIssueWithSecurityLevelReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("createIssueWithSecurityLevelReturn")]
public RemoteIssue createIssueWithSecurityLevel(string in0, RemoteIssue in1, long in2)
{
object[] results = this.Invoke("createIssueWithSecurityLevel", new object[] {
@@ -1802,8 +1801,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("addAttachmentsToIssueReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("addAttachmentsToIssueReturn")]
public bool addAttachmentsToIssue(string in0, string in1, string[] in2, sbyte[] in3)
{
object[] results = this.Invoke("addAttachmentsToIssue", new object[] {
@@ -1832,8 +1831,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getAttachmentsFromIssueReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getAttachmentsFromIssueReturn")]
public RemoteAttachment[] getAttachmentsFromIssue(string in0, string in1)
{
object[] results = this.Invoke("getAttachmentsFromIssue", new object[] {
@@ -1858,8 +1857,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("hasPermissionToEditCommentReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("hasPermissionToEditCommentReturn")]
public bool hasPermissionToEditComment(string in0, RemoteComment in1)
{
object[] results = this.Invoke("hasPermissionToEditComment", new object[] {
@@ -1884,8 +1883,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("editCommentReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("editCommentReturn")]
public RemoteComment editComment(string in0, RemoteComment in1)
{
object[] results = this.Invoke("editComment", new object[] {
@@ -1910,8 +1909,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getFieldsForActionReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getFieldsForActionReturn")]
public RemoteField[] getFieldsForAction(string in0, string in1, string in2)
{
object[] results = this.Invoke("getFieldsForAction", new object[] {
@@ -1938,8 +1937,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("progressWorkflowActionReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("progressWorkflowActionReturn")]
public RemoteIssue progressWorkflowAction(string in0, string in1, string in2, RemoteFieldValue[] in3)
{
object[] results = this.Invoke("progressWorkflowAction", new object[] {
@@ -1968,8 +1967,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getIssueByIdReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getIssueByIdReturn")]
public RemoteIssue getIssueById(string in0, string in1)
{
object[] results = this.Invoke("getIssueById", new object[] {
@@ -1994,8 +1993,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("addWorklogWithNewRemainingEstimateReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("addWorklogWithNewRemainingEstimateReturn")]
public RemoteWorklog addWorklogWithNewRemainingEstimate(string in0, string in1, RemoteWorklog in2, string in3)
{
object[] results = this.Invoke("addWorklogWithNewRemainingEstimate", new object[] {
@@ -2024,8 +2023,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("addWorklogAndAutoAdjustRemainingEstimateReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("addWorklogAndAutoAdjustRemainingEstimateReturn")]
public RemoteWorklog addWorklogAndAutoAdjustRemainingEstimate(string in0, string in1, RemoteWorklog in2)
{
object[] results = this.Invoke("addWorklogAndAutoAdjustRemainingEstimate", new object[] {
@@ -2052,8 +2051,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("addWorklogAndRetainRemainingEstimateReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("addWorklogAndRetainRemainingEstimateReturn")]
public RemoteWorklog addWorklogAndRetainRemainingEstimate(string in0, string in1, RemoteWorklog in2)
{
object[] results = this.Invoke("addWorklogAndRetainRemainingEstimate", new object[] {
@@ -2080,7 +2079,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void deleteWorklogWithNewRemainingEstimate(string in0, string in1, string in2)
{
this.Invoke("deleteWorklogWithNewRemainingEstimate", new object[] {
@@ -2105,7 +2104,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void deleteWorklogAndAutoAdjustRemainingEstimate(string in0, string in1)
{
this.Invoke("deleteWorklogAndAutoAdjustRemainingEstimate", new object[] {
@@ -2128,7 +2127,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void deleteWorklogAndRetainRemainingEstimate(string in0, string in1)
{
this.Invoke("deleteWorklogAndRetainRemainingEstimate", new object[] {
@@ -2151,7 +2150,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void updateWorklogWithNewRemainingEstimate(string in0, RemoteWorklog in1, string in2)
{
this.Invoke("updateWorklogWithNewRemainingEstimate", new object[] {
@@ -2176,7 +2175,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void updateWorklogAndAutoAdjustRemainingEstimate(string in0, RemoteWorklog in1)
{
this.Invoke("updateWorklogAndAutoAdjustRemainingEstimate", new object[] {
@@ -2199,7 +2198,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void updateWorklogAndRetainRemainingEstimate(string in0, RemoteWorklog in1)
{
this.Invoke("updateWorklogAndRetainRemainingEstimate", new object[] {
@@ -2222,8 +2221,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getWorklogsReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getWorklogsReturn")]
public RemoteWorklog[] getWorklogs(string in0, string in1)
{
object[] results = this.Invoke("getWorklogs", new object[] {
@@ -2248,8 +2247,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("hasPermissionToCreateWorklogReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("hasPermissionToCreateWorklogReturn")]
public bool hasPermissionToCreateWorklog(string in0, string in1)
{
object[] results = this.Invoke("hasPermissionToCreateWorklog", new object[] {
@@ -2274,8 +2273,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("hasPermissionToDeleteWorklogReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("hasPermissionToDeleteWorklogReturn")]
public bool hasPermissionToDeleteWorklog(string in0, string in1)
{
object[] results = this.Invoke("hasPermissionToDeleteWorklog", new object[] {
@@ -2300,8 +2299,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("hasPermissionToUpdateWorklogReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("hasPermissionToUpdateWorklogReturn")]
public bool hasPermissionToUpdateWorklog(string in0, string in1)
{
object[] results = this.Invoke("hasPermissionToUpdateWorklog", new object[] {
@@ -2326,8 +2325,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getResolutionDateByKeyReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getResolutionDateByKeyReturn")]
public System.DateTime getResolutionDateByKey(string in0, string in1)
{
object[] results = this.Invoke("getResolutionDateByKey", new object[] {
@@ -2352,8 +2351,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getResolutionDateByIdReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getResolutionDateByIdReturn")]
public System.DateTime getResolutionDateById(string in0, long in1)
{
object[] results = this.Invoke("getResolutionDateById", new object[] {
@@ -2378,8 +2377,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getIssueCountForFilterReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getIssueCountForFilterReturn")]
public long getIssueCountForFilter(string in0, string in1)
{
object[] results = this.Invoke("getIssueCountForFilter", new object[] {
@@ -2404,8 +2403,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getIssuesFromTextSearchReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getIssuesFromTextSearchReturn")]
public RemoteIssue[] getIssuesFromTextSearch(string in0, string in1)
{
object[] results = this.Invoke("getIssuesFromTextSearch", new object[] {
@@ -2430,8 +2429,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getIssuesFromTextSearchWithProjectReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getIssuesFromTextSearchWithProjectReturn")]
public RemoteIssue[] getIssuesFromTextSearchWithProject(string in0, string[] in1, string in2, int in3)
{
object[] results = this.Invoke("getIssuesFromTextSearchWithProject", new object[] {
@@ -2460,8 +2459,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getIssuesFromJqlSearchReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getIssuesFromJqlSearchReturn")]
public RemoteIssue[] getIssuesFromJqlSearch(string in0, string in1, int in2)
{
object[] results = this.Invoke("getIssuesFromJqlSearch", new object[] {
@@ -2488,7 +2487,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void deleteUser(string in0, string in1)
{
this.Invoke("deleteUser", new object[] {
@@ -2511,8 +2510,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("updateGroupReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("updateGroupReturn")]
public RemoteGroup updateGroup(string in0, RemoteGroup in1)
{
object[] results = this.Invoke("updateGroup", new object[] {
@@ -2537,7 +2536,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void deleteGroup(string in0, string in1, string in2)
{
this.Invoke("deleteGroup", new object[] {
@@ -2562,7 +2561,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void refreshCustomFields(string in0)
{
this.Invoke("refreshCustomFields", new object[] {
@@ -2583,8 +2582,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getSavedFiltersReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getSavedFiltersReturn")]
public RemoteFilter[] getSavedFilters(string in0)
{
object[] results = this.Invoke("getSavedFilters", new object[] {
@@ -2607,8 +2606,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("addBase64EncodedAttachmentsToIssueReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("addBase64EncodedAttachmentsToIssueReturn")]
public bool addBase64EncodedAttachmentsToIssue(string in0, string in1, string[] in2, string[] in3)
{
object[] results = this.Invoke("addBase64EncodedAttachmentsToIssue", new object[] {
@@ -2637,8 +2636,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("createProjectFromObjectReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("createProjectFromObjectReturn")]
public RemoteProject createProjectFromObject(string in0, RemoteProject in1)
{
object[] results = this.Invoke("createProjectFromObject", new object[] {
@@ -2663,8 +2662,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getSecuritySchemesReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getSecuritySchemesReturn")]
public RemoteScheme[] getSecuritySchemes(string in0)
{
object[] results = this.Invoke("getSecuritySchemes", new object[] {
@@ -2687,8 +2686,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("addVersionReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("addVersionReturn")]
public RemoteVersion addVersion(string in0, string in1, RemoteVersion in2)
{
object[] results = this.Invoke("addVersion", new object[] {
@@ -2715,8 +2714,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getIssuesFromFilterReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getIssuesFromFilterReturn")]
public RemoteIssue[] getIssuesFromFilter(string in0, string in1)
{
object[] results = this.Invoke("getIssuesFromFilter", new object[] {
@@ -2741,8 +2740,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getIssuesFromFilterWithLimitReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getIssuesFromFilterWithLimitReturn")]
public RemoteIssue[] getIssuesFromFilterWithLimit(string in0, string in1, int in2, int in3)
{
object[] results = this.Invoke("getIssuesFromFilterWithLimit", new object[] {
@@ -2771,8 +2770,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getIssuesFromTextSearchWithLimitReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getIssuesFromTextSearchWithLimitReturn")]
public RemoteIssue[] getIssuesFromTextSearchWithLimit(string in0, string in1, int in2, int in3)
{
object[] results = this.Invoke("getIssuesFromTextSearchWithLimit", new object[] {
@@ -2801,8 +2800,8 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
- [return: System.Xml.Serialization.SoapElementAttribute("getProjectsNoSchemesReturn")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [return: SoapElement("getProjectsNoSchemesReturn")]
public RemoteProject[] getProjectsNoSchemes(string in0)
{
object[] results = this.Invoke("getProjectsNoSchemes", new object[] {
@@ -2825,7 +2824,7 @@ namespace Jira
}
///
- [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
+ [SoapRpcMethod("", RequestNamespace="http://soap.rpc.jira.atlassian.com", ResponseNamespace="http://jira/rpc/soap/jirasoapservice-v2")]
public void setNewProjectAvatar(string in0, string in1, string in2, string in3)
{
this.Invoke("setNewProjectAvatar", new object[] {
@@ -2854,583 +2853,583 @@ namespace Jira
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteComment
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string author;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string body;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable created;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string groupLevel;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string id;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string roleLevel;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string updateAuthor;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable updated;
}
///
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteWorklogImpl))]
+ [SoapInclude(typeof(RemoteWorklogImpl))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteWorklog
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string author;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string comment;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable created;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string groupLevel;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string id;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string roleLevelId;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable startDate;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string timeSpent;
///
public long timeSpentInSeconds;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string updateAuthor;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable updated;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://service.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://service.soap.rpc.jira.atlassian.com")]
public partial class RemoteWorklogImpl : RemoteWorklog
{
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteAvatar
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string base64Data;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string contentType;
///
public long id;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string owner;
///
public bool system;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string type;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteRoleActor
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string descriptor;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string parameter;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteProjectRole projectRole;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string type;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteUser[] users;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteProjectRole
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string description;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable id;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string name;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteUser : RemoteEntity
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string email;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string fullname;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string name;
}
///
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteGroup))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteUser))]
+ [SoapInclude(typeof(RemoteGroup))]
+ [SoapInclude(typeof(RemoteUser))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteEntity
{
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteGroup : RemoteEntity
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string name;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteUser[] users;
}
///
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteProjectRoleActors))]
+ [SoapInclude(typeof(RemoteProjectRoleActors))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteRoleActors
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteProjectRole projectRole;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteRoleActor[] roleActors;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteUser[] users;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteProjectRoleActors : RemoteRoleActors
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteProject project;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteProject : AbstractNamedRemoteEntity
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string description;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteScheme issueSecurityScheme;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string key;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string lead;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteScheme notificationScheme;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemotePermissionScheme permissionScheme;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string projectUrl;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string url;
}
///
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemotePermissionScheme))]
+ [SoapInclude(typeof(RemotePermissionScheme))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteScheme
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string description;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable id;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string name;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string type;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemotePermissionScheme : RemoteScheme
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemotePermissionMapping[] permissionMappings;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemotePermissionMapping
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemotePermission permission;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteEntity[] remoteEntities;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemotePermission
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string name;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable permission;
}
///
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteSecurityLevel))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteFilter))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteField))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteProject))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(AbstractRemoteConstant))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteStatus))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteResolution))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemotePriority))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteIssueType))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteNamedObject))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteComponent))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteVersion))]
+ [SoapInclude(typeof(RemoteSecurityLevel))]
+ [SoapInclude(typeof(RemoteFilter))]
+ [SoapInclude(typeof(RemoteField))]
+ [SoapInclude(typeof(RemoteProject))]
+ [SoapInclude(typeof(AbstractRemoteConstant))]
+ [SoapInclude(typeof(RemoteStatus))]
+ [SoapInclude(typeof(RemoteResolution))]
+ [SoapInclude(typeof(RemotePriority))]
+ [SoapInclude(typeof(RemoteIssueType))]
+ [SoapInclude(typeof(RemoteNamedObject))]
+ [SoapInclude(typeof(RemoteComponent))]
+ [SoapInclude(typeof(RemoteVersion))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public abstract partial class AbstractNamedRemoteEntity : AbstractRemoteEntity
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string name;
}
///
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteAttachment))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteIssue))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(AbstractNamedRemoteEntity))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteSecurityLevel))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteFilter))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteField))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteProject))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(AbstractRemoteConstant))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteStatus))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteResolution))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemotePriority))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteIssueType))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteNamedObject))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteComponent))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteVersion))]
+ [SoapInclude(typeof(RemoteAttachment))]
+ [SoapInclude(typeof(RemoteIssue))]
+ [SoapInclude(typeof(AbstractNamedRemoteEntity))]
+ [SoapInclude(typeof(RemoteSecurityLevel))]
+ [SoapInclude(typeof(RemoteFilter))]
+ [SoapInclude(typeof(RemoteField))]
+ [SoapInclude(typeof(RemoteProject))]
+ [SoapInclude(typeof(AbstractRemoteConstant))]
+ [SoapInclude(typeof(RemoteStatus))]
+ [SoapInclude(typeof(RemoteResolution))]
+ [SoapInclude(typeof(RemotePriority))]
+ [SoapInclude(typeof(RemoteIssueType))]
+ [SoapInclude(typeof(RemoteNamedObject))]
+ [SoapInclude(typeof(RemoteComponent))]
+ [SoapInclude(typeof(RemoteVersion))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public abstract partial class AbstractRemoteEntity
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string id;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteAttachment : AbstractRemoteEntity
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string author;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable created;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string filename;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable filesize;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string mimetype;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteIssue : AbstractRemoteEntity
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteVersion[] affectsVersions;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string assignee;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string[] attachmentNames;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteComponent[] components;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable created;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteCustomFieldValue[] customFieldValues;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string description;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable duedate;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string environment;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteVersion[] fixVersions;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string key;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string priority;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string project;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string reporter;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string resolution;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string status;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string summary;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string type;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable updated;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable votes;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteVersion : AbstractNamedRemoteEntity
{
@@ -3438,161 +3437,161 @@ namespace Jira
public bool archived;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable releaseDate;
///
public bool released;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable sequence;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteComponent : AbstractNamedRemoteEntity
{
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteCustomFieldValue
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string customfieldId;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string key;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string[] values;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteSecurityLevel : AbstractNamedRemoteEntity
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string description;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteFilter : AbstractNamedRemoteEntity
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string author;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string description;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string project;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string xml;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteField : AbstractNamedRemoteEntity
{
}
///
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteStatus))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteResolution))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemotePriority))]
- [System.Xml.Serialization.SoapIncludeAttribute(typeof(RemoteIssueType))]
+ [SoapInclude(typeof(RemoteStatus))]
+ [SoapInclude(typeof(RemoteResolution))]
+ [SoapInclude(typeof(RemotePriority))]
+ [SoapInclude(typeof(RemoteIssueType))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public abstract partial class AbstractRemoteConstant : AbstractNamedRemoteEntity
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string description;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string icon;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteStatus : AbstractRemoteConstant
{
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteResolution : AbstractRemoteConstant
{
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemotePriority : AbstractRemoteConstant
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string color;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteIssueType : AbstractRemoteConstant
{
@@ -3602,20 +3601,20 @@ namespace Jira
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteNamedObject : AbstractNamedRemoteEntity
{
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteConfiguration
{
@@ -3652,71 +3651,71 @@ namespace Jira
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteFieldValue
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string id;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string[] values;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteTimeInfo
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string serverTime;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string timeZoneId;
}
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("SharpDevelop", "3.2.0.5777")]
- [System.SerializableAttribute()]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
+ [Serializable()]
+ [DebuggerStepThrough()]
+ [DesignerCategory("code")]
+ [SoapType(Namespace="http://beans.soap.rpc.jira.atlassian.com")]
public partial class RemoteServerInfo
{
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string baseUrl;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public System.Nullable buildDate;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string buildNumber;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string edition;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public RemoteTimeInfo serverTime;
///
- [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
+ [SoapElement(IsNullable=true)]
public string version;
}
}
diff --git a/GreenshotOCRCommand/COMWrapper.cs b/GreenshotOCRCommand/COMWrapper.cs
index c4d35cc1c..c1f6b8dc5 100644
--- a/GreenshotOCRCommand/COMWrapper.cs
+++ b/GreenshotOCRCommand/COMWrapper.cs
@@ -38,55 +38,42 @@ namespace Greenshot.Interop {
///
/// Holds reference to the actual COM object which is wrapped by this proxy
///
- private object _COMObject;
+ private readonly object _comObject;
///
/// Type of the COM object, set on constructor after getting the COM reference
///
- private readonly Type _COMType;
+ private readonly Type _comType;
///
/// The type of which method calls are intercepted and executed on the COM object.
///
- private readonly Type _InterceptType;
+ private readonly Type _interceptType;
#endregion
- [DllImport("ole32.dll")]
- static extern int ProgIDFromCLSID([In] ref Guid clsid, [MarshalAs(UnmanagedType.LPWStr)] out string lplpszProgID);
#region Construction
///
/// Gets a COM object and returns the transparent proxy which intercepts all calls to the object
///
- /// Interface which defines the method and properties to intercept
+ /// Interface which defines the method and properties to intercept
/// Transparent proxy to the real proxy for the object
- /// The must be an interface decorated with the attribute.
+ /// T must be an interface decorated with the attribute.
public static T GetInstance() {
Type type = typeof(T);
if (null == type) {
- throw new ArgumentNullException("type");
+ throw new ArgumentNullException(nameof(T));
}
if (!type.IsInterface) {
- throw new ArgumentException("The specified type must be an interface.", "type");
+ throw new ArgumentException("The specified type must be an interface.", nameof(T));
}
- ComProgIdAttribute progIDAttribute = ComProgIdAttribute.GetAttribute(type);
- if (null == progIDAttribute || null == progIDAttribute.Value || 0 == progIDAttribute.Value.Length) {
- throw new ArgumentException("The specified type must define a ComProgId attribute.", "type");
- }
- string progId = progIDAttribute.Value;
-
- // Convert from clsid to Prog ID, if needed
- if (progId.StartsWith("clsid:")) {
- Guid guid = new Guid(progId.Substring(6));
- int result = ProgIDFromCLSID(ref guid, out progId);
- if (result != 0) {
- //LOG.WarnFormat("Error {0} getting progId {1}", result, progIDAttribute.Value);
- } else {
- //LOG.InfoFormat("Mapped {0} to progId {1}", progIDAttribute.Value, progId);
- }
+ ComProgIdAttribute progIdAttribute = ComProgIdAttribute.GetAttribute(type);
+ if (string.IsNullOrEmpty(progIdAttribute?.Value)) {
+ throw new ArgumentException("The specified type must define a ComProgId attribute.", nameof(T));
}
+ string progId = progIdAttribute.Value;
object comObject = null;
try {
@@ -96,8 +83,6 @@ namespace Greenshot.Interop {
//LOG.DebugFormat("No current instance of {0} object available.", progId);
} else if (comE.ErrorCode == CO_E_CLASSSTRING) {
//LOG.WarnFormat("Unknown progId {0}", progId);
- } else {
- //LOG.Warn("Error getting active object for " + progId, comE);
}
} catch (Exception) {
//LOG.Warn("Error getting active object for " + progId, e);
@@ -114,37 +99,26 @@ namespace Greenshot.Interop {
/// Gets or creates a COM object and returns the transparent proxy which intercepts all calls to the object
/// The ComProgId can be a normal ComProgId or a GUID prefixed with "clsid:"
///
- /// Interface which defines the method and properties to intercept
+ /// Interface which defines the method and properties to intercept
/// Transparent proxy to the real proxy for the object
- /// The must be an interface decorated with the attribute.
+ /// The type must be an interface decorated with the attribute.
public static T GetOrCreateInstance() {
Type type = typeof(T);
if (null == type) {
- throw new ArgumentNullException("type");
+ throw new ArgumentNullException(nameof(T));
}
if (!type.IsInterface) {
- throw new ArgumentException("The specified type must be an interface.", "type");
+ throw new ArgumentException("The specified type must be an interface.", nameof(T));
}
- ComProgIdAttribute progIDAttribute = ComProgIdAttribute.GetAttribute(type);
- if (null == progIDAttribute || null == progIDAttribute.Value || 0 == progIDAttribute.Value.Length) {
- throw new ArgumentException("The specified type must define a ComProgId attribute.", "type");
+ ComProgIdAttribute progIdAttribute = ComProgIdAttribute.GetAttribute(type);
+ if (string.IsNullOrEmpty(progIdAttribute?.Value)) {
+ throw new ArgumentException("The specified type must define a ComProgId attribute.", nameof(T));
}
object comObject = null;
Type comType = null;
- string progId = progIDAttribute.Value;
-
- // Convert from clsid to Prog ID, if needed
- if (progId.StartsWith("clsid:")) {
- Guid guid = new Guid(progId.Substring(6));
- int result = ProgIDFromCLSID(ref guid, out progId);
- if (result != 0) {
- //LOG.WarnFormat("Error {0} getting progId {1}", result, progIDAttribute.Value);
- } else {
- //LOG.InfoFormat("Mapped {0} to progId {1}", progIDAttribute.Value, progId);
- }
- }
+ string progId = progIdAttribute.Value;
try {
comObject = Marshal.GetActiveObject(progId);
@@ -154,8 +128,6 @@ namespace Greenshot.Interop {
} else if (comE.ErrorCode == CO_E_CLASSSTRING) {
//LOG.WarnFormat("Unknown progId {0} (application not installed)", progId);
return default(T);
- } else {
- //LOG.Warn("Error getting active object for " + progId, comE);
}
} catch (Exception) {
//LOG.Warn("Error getting active object for " + progId, e);
@@ -193,10 +165,10 @@ namespace Greenshot.Interop {
/// Transparent proxy to the real proxy for the object
private static object Wrap(object comObject, Type type) {
if (null == comObject) {
- throw new ArgumentNullException("comObject");
+ throw new ArgumentNullException(nameof(comObject));
}
if (null == type) {
- throw new ArgumentNullException("type");
+ throw new ArgumentNullException(nameof(type));
}
COMWrapper wrapper = new COMWrapper(comObject, type);
@@ -214,9 +186,9 @@ namespace Greenshot.Interop {
///
private COMWrapper(object comObject, Type type)
: base(type) {
- _COMObject = comObject;
- _COMType = comObject.GetType();
- _InterceptType = type;
+ _comObject = comObject;
+ _comType = comObject.GetType();
+ _interceptType = type;
}
#endregion
@@ -247,17 +219,17 @@ namespace Greenshot.Interop {
/// interface.
///
private void Dispose(bool disposing) {
- if (disposing && null != _COMObject) {
- if (Marshal.IsComObject(_COMObject)) {
+ if (disposing && null != _comObject) {
+ if (Marshal.IsComObject(_comObject)) {
try {
- while (Marshal.ReleaseComObject(_COMObject) > 0);
+ while (Marshal.ReleaseComObject(_comObject) > 0)
+ {
+ }
} catch (Exception) {
//LOG.WarnFormat("Problem releasing {0}", _COMType);
//LOG.Warn("Error: ", ex);
}
}
-
- _COMObject = null;
}
}
@@ -272,7 +244,7 @@ namespace Greenshot.Interop {
/// The full name of the intercepted type.
///
public override string ToString() {
- return _InterceptType.FullName;
+ return _interceptType.FullName;
}
///
@@ -282,7 +254,7 @@ namespace Greenshot.Interop {
/// The hash code of the wrapped object.
///
public override int GetHashCode() {
- return _COMObject.GetHashCode();
+ return _comObject.GetHashCode();
}
///
@@ -298,7 +270,7 @@ namespace Greenshot.Interop {
if (null != value && RemotingServices.IsTransparentProxy(value)) {
COMWrapper wrapper = RemotingServices.GetRealProxy(value) as COMWrapper;
if (null != wrapper) {
- return _COMObject == wrapper._COMObject;
+ return _comObject == wrapper._comObject;
}
}
@@ -319,7 +291,7 @@ namespace Greenshot.Interop {
///
private static Type GetByValType(Type byRefType) {
if (null == byRefType) {
- throw new ArgumentNullException("byRefType");
+ throw new ArgumentNullException(nameof(byRefType));
}
if (byRefType.IsByRef) {
@@ -333,97 +305,6 @@ namespace Greenshot.Interop {
#endregion
- ///
- /// Use this static method to cast a wrapped proxy to a new wrapper proxy of the supplied type.
- /// In English, use this to cast you base "COM" interface to a specialized interface.
- /// E.G. Outlook Item -> MailItem
- ///
- /// the type you want to cast to
- /// The wrapper interface, e.g. something you got back from calling GetItem
- /// A new wrapper proxy for the specified type
- public static T Cast(object wrapperProxy) {
- if (wrapperProxy == null) {
- return default(T);
- }
-
- Type newType = typeof(T);
- COMWrapper oldWrapper = RemotingServices.GetRealProxy(wrapperProxy) as COMWrapper;
- if (oldWrapper == null) {
- throw new ArgumentException("wrapper proxy was no COMWrapper");
- }
- if (oldWrapper._InterceptType.IsAssignableFrom(newType)) {
- COMWrapper newWrapper = new COMWrapper(oldWrapper._COMObject, newType);
- return (T)newWrapper.GetTransparentProxy();
- }
- throw new InvalidCastException(string.Format("{0} is not assignable from {1}", oldWrapper._InterceptType, newType));
- }
-
- ///
- /// Returns the "com" type of the wrapperproxy, making it possible to perform reflection on it.
- ///
- /// wrapperProxy to get the type from
- /// Type
- public static Type GetUnderlyingTypeForWrapper(object wrapperProxy) {
- Type returnType = null;
- COMWrapper wrapper = RemotingServices.GetRealProxy(wrapperProxy) as COMWrapper;
- if (wrapper != null) {
- IDispatch dispatch = wrapper._COMObject as IDispatch;
- if (dispatch != null) {
- int result = dispatch.GetTypeInfo(0, 0, out returnType);
- if (result != 0) {
- //LOG.DebugFormat("GetTypeInfo : 0x{0} ({1})", result.ToString("X"), result);
- }
- }
- }
- return returnType;
- }
-
- ///
- /// Return the Type of a IDispatch
- ///
- /// IDispatch to get the type object for
- /// Type of the IDispatch
- public static Type GetUnderlyingType(IDispatch dispatch) {
- Type returnType = null;
- if (dispatch != null) {
- int result = dispatch.GetTypeInfo(0, 0, out returnType);
- if (result != 0) {
- //LOG.DebugFormat("GetTypeInfo : 0x{0} ({1})", result.ToString("X"), result);
- }
- }
- return returnType;
- }
-
- ///
- /// Dump the Type-Information for the Type to the log, this uses reflection
- ///
- /// Type to inspect
- public static void DumpTypeInfo(Type type) {
- //LOG.InfoFormat("Type information for Type with name: {0}", type.Name);
- try {
- foreach (MemberInfo memberInfo in type.GetMembers()) {
- //LOG.InfoFormat("Member: {0};", memberInfo.ToString());
- }
- } catch (Exception) {
- //LOG.Error(memberException);
- }
- try {
- foreach (PropertyInfo propertyInfo in type.GetProperties()) {
- //LOG.InfoFormat("Property: {0};", propertyInfo.ToString());
- }
- } catch (Exception) {
- //LOG.Error(propertyException);
- }
- try {
- foreach (FieldInfo fieldInfo in type.GetFields()) {
- //LOG.InfoFormat("Field: {0};", fieldInfo.ToString());
- }
- } catch (Exception) {
- //LOG.Error(fieldException);
- }
- //LOG.InfoFormat("Type information end.");
- }
-
///
/// Intercept method calls
///
@@ -473,22 +354,19 @@ namespace Greenshot.Interop {
} else if ("ToString" == methodName && 0 == argCount && typeof(string) == returnType) {
returnValue = ToString();
} else if ("GetType" == methodName && 0 == argCount && typeof(Type) == returnType) {
- returnValue = _InterceptType;
+ returnValue = _interceptType;
} else if ("GetHashCode" == methodName && 0 == argCount && typeof(int) == returnType) {
returnValue = GetHashCode();
} else if ("Equals" == methodName && 1 == argCount && typeof(bool) == returnType) {
returnValue = Equals(callMessage.Args[0]);
} else if (1 == argCount && typeof(void) == returnType && (methodName.StartsWith("add_") || methodName.StartsWith("remove_"))) {
- bool removeHandler = methodName.StartsWith("remove_");
- methodName = methodName.Substring(removeHandler ? 7 : 4);
-
- Delegate handler = callMessage.InArgs[0] as Delegate;
+ var handler = callMessage.InArgs[0] as Delegate;
if (null == handler) {
- return new ReturnMessage(new ArgumentNullException("handler"), callMessage);
+ return new ReturnMessage(new ArgumentNullException(nameof(handler)), callMessage);
}
} else {
- invokeObject = _COMObject;
- invokeType = _COMType;
+ invokeObject = _comObject;
+ invokeType = _comType;
if (methodName.StartsWith("get_")) {
// Property Get
@@ -532,7 +410,7 @@ namespace Greenshot.Interop {
wrapper = RemotingServices.GetRealProxy(args[i]) as COMWrapper;
if (null != wrapper) {
originalArgs[i] = wrapper;
- args[i] = wrapper._COMObject;
+ args[i] = wrapper._comObject;
}
} else if (0 != outArgsCount && argModifiers[0][i]) {
byValType = GetByValType(parameters[i].ParameterType);
@@ -543,7 +421,7 @@ namespace Greenshot.Interop {
if (null == args[i]) {
args[i] = new DispatchWrapper(null);
}
- } else if (typeof(Decimal) == byValType) {
+ } else if (typeof(decimal) == byValType) {
// If we're passing a decimal value by reference,
// we need to pass a CurrencyWrapper to avoid a
// type mismatch exception.
@@ -590,7 +468,7 @@ namespace Greenshot.Interop {
wrapper = null;
byValType = GetByValType(parameter.ParameterType);
- if (typeof(Decimal) == byValType) {
+ if (typeof(decimal) == byValType) {
if (arg is CurrencyWrapper) {
arg = ((CurrencyWrapper)arg).WrappedObject;
}
@@ -599,7 +477,7 @@ namespace Greenshot.Interop {
} else if (byValType.IsInterface) {
if (Marshal.IsComObject(arg)) {
wrapper = originalArgs[i];
- if (null != wrapper && wrapper._COMObject != arg) {
+ if (null != wrapper && wrapper._comObject != arg) {
wrapper.Dispose();
wrapper = null;
}
@@ -626,7 +504,7 @@ namespace Greenshot.Interop {
/// object to cast
///
public bool CanCastTo(Type toType, object o) {
- bool returnValue = _InterceptType.IsAssignableFrom(toType);
+ bool returnValue = _interceptType.IsAssignableFrom(toType);
return returnValue;
}
diff --git a/GreenshotOCRPlugin/OCRConfiguration.cs b/GreenshotOCRPlugin/OCRConfiguration.cs
index 2d67d0d33..64ee9ac37 100644
--- a/GreenshotOCRPlugin/OCRConfiguration.cs
+++ b/GreenshotOCRPlugin/OCRConfiguration.cs
@@ -27,10 +27,10 @@ namespace GreenshotOCR {
[IniSection("OCR", Description="Greenshot OCR Plugin configuration")]
public class OCRConfiguration : IniSection {
[IniProperty("Language", Description="Language for OCR", DefaultValue="miLANG_ENGLISH")]
- public string Language;
+ public string Language { get; set; }
[IniProperty("orientimage", Description="Orient image?", DefaultValue="true")]
- public bool Orientimage;
+ public bool Orientimage { get; set; }
[IniProperty("straightenImage", Description="Straighten image?", DefaultValue="true")]
- public bool StraightenImage;
+ public bool StraightenImage { get; set; }
}
}
diff --git a/GreenshotOCRPlugin/OCRPlugin.cs b/GreenshotOCRPlugin/OCRPlugin.cs
index 7719a03e8..93b7bffb4 100644
--- a/GreenshotOCRPlugin/OCRPlugin.cs
+++ b/GreenshotOCRPlugin/OCRPlugin.cs
@@ -94,9 +94,8 @@ namespace GreenshotOCR {
///
/// Implementation of the IGreenshotPlugin.Initialize
///
- /// Use the IGreenshotPluginHost interface to register events
- /// Use the ICaptureHost interface to register in the MainContextMenu
- /// My own attributes
+ /// Use the IGreenshotPluginHost interface to register events
+ /// My own attributes
/// true if plugin is initialized, false if not (doesn't show)
public virtual bool Initialize(IGreenshotHost greenshotHost, PluginAttribute myAttributes) {
LOG.Debug("Initialize called of " + myAttributes.Name);
diff --git a/GreenshotOfficePlugin/OfficeConfiguration.cs b/GreenshotOfficePlugin/OfficeConfiguration.cs
index 982411901..52f277ae4 100644
--- a/GreenshotOfficePlugin/OfficeConfiguration.cs
+++ b/GreenshotOfficePlugin/OfficeConfiguration.cs
@@ -28,24 +28,25 @@ namespace GreenshotOfficePlugin {
///
[IniSection("Office", Description="Greenshot Office configuration")]
public class OfficeConfiguration : IniSection {
- [IniProperty("OutlookEmailFormat", Description = "Default type for emails. (Text, HTML)", DefaultValue="HTML")]
- public EmailFormat OutlookEmailFormat;
+ [IniProperty("OutlookEmailFormat", Description = "Default type for emails. (Text, HTML)", DefaultValue = "HTML")]
+ public EmailFormat OutlookEmailFormat { get; set; }
+
[IniProperty("EmailSubjectPattern", Description = "Email subject pattern, works like the OutputFileFilenamePattern", DefaultValue = "${title}")]
- public string EmailSubjectPattern;
+ public string EmailSubjectPattern { get; set; }
[IniProperty("EmailTo", Description = "Default value for the to in emails that are created", DefaultValue = "")]
- public string EmailTo;
+ public string EmailTo { get; set; }
[IniProperty("EmailCC", Description = "Default value for the CC in emails that are created", DefaultValue = "")]
- public string EmailCC;
+ public string EmailCC { get; set; }
[IniProperty("EmailBCC", Description = "Default value for the BCC in emails that are created", DefaultValue = "")]
- public string EmailBCC;
+ public string EmailBCC { get; set; }
[IniProperty("OutlookAllowExportInMeetings", Description = "For Outlook: Allow export in meeting items", DefaultValue = "False")]
- public bool OutlookAllowExportInMeetings;
+ public bool OutlookAllowExportInMeetings { get; set; }
[IniProperty("WordLockAspectRatio", Description = "For Word: Lock the aspect ratio of the image", DefaultValue = "True")]
- public bool WordLockAspectRatio;
+ public bool WordLockAspectRatio { get; set; }
[IniProperty("PowerpointLockAspectRatio", Description = "For Powerpoint: Lock the aspect ratio of the image", DefaultValue = "True")]
- public bool PowerpointLockAspectRatio;
+ public bool PowerpointLockAspectRatio { get; set; }
[IniProperty("PowerpointSlideLayout", Description = "For Powerpoint: Slide layout, changing this to a wrong value will fallback on ppLayoutBlank!!", DefaultValue = "ppLayoutPictureWithCaption")]
- public PPSlideLayout PowerpointSlideLayout;
+ public PPSlideLayout PowerpointSlideLayout { get; set; }
}
}
\ No newline at end of file
diff --git a/GreenshotOfficePlugin/OfficeExport/ExcelExporter.cs b/GreenshotOfficePlugin/OfficeExport/ExcelExporter.cs
index 64c6a02e5..34656850d 100644
--- a/GreenshotOfficePlugin/OfficeExport/ExcelExporter.cs
+++ b/GreenshotOfficePlugin/OfficeExport/ExcelExporter.cs
@@ -34,7 +34,7 @@ namespace Greenshot.Interop.Office {
///
/// Get all currently opened workbooks
///
- /// List with names of the workbooks
+ /// List of string with names of the workbooks
public static List GetWorkbooks() {
List currentWorkbooks = new List();
using (IExcelApplication excelApplication = GetExcelApplication()) {
diff --git a/GreenshotOfficePlugin/OfficeExport/OutlookEmailExporter.cs b/GreenshotOfficePlugin/OfficeExport/OutlookEmailExporter.cs
index 712cdd44b..bd2ddd6cc 100644
--- a/GreenshotOfficePlugin/OfficeExport/OutlookEmailExporter.cs
+++ b/GreenshotOfficePlugin/OfficeExport/OutlookEmailExporter.cs
@@ -49,7 +49,7 @@ namespace Greenshot.Interop.Office {
///
/// A method to retrieve all inspectors which can act as an export target
///
- /// List with inspector captions (window title)
+ /// List of strings with inspector captions (window title)
public static IDictionary RetrievePossibleTargets() {
IDictionary inspectorCaptions = new SortedDictionary();
try {
@@ -76,7 +76,6 @@ namespace Greenshot.Interop.Office {
if (inspectors != null && inspectors.Count > 0) {
for (int i = 1; i <= inspectors.Count; i++) {
using (IInspector inspector = outlookApplication.Inspectors[i]) {
- string inspectorCaption = inspector.Caption;
using (IItem currentItem = inspector.CurrentItem) {
if (canExportToInspector(currentItem)) {
OlObjectClass currentItemClass = currentItem.Class;
@@ -328,13 +327,20 @@ namespace Greenshot.Interop.Office {
LOG.Debug("Finished!");
return true;
}
+
///
/// Export image to a new email
///
///
+ ///
///
- ///
- private static void ExportToNewEmail(IOutlookApplication outlookApplication, EmailFormat format, string tmpFile, string subject, string attachmentName, string to, string CC, string BCC, string url) {
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ private static void ExportToNewEmail(IOutlookApplication outlookApplication, EmailFormat format, string tmpFile, string subject, string attachmentName, string to, string cc, string bcc, string url) {
using (IItem newItem = outlookApplication.CreateItem(OlItemType.olMailItem)) {
if (newItem == null) {
return;
@@ -345,11 +351,11 @@ namespace Greenshot.Interop.Office {
if (!string.IsNullOrEmpty(to)) {
newMail.To = to;
}
- if (!string.IsNullOrEmpty(CC)) {
- newMail.CC = CC;
+ if (!string.IsNullOrEmpty(cc)) {
+ newMail.CC = cc;
}
- if (!string.IsNullOrEmpty(BCC)) {
- newMail.BCC = BCC;
+ if (!string.IsNullOrEmpty(bcc)) {
+ newMail.BCC = bcc;
}
newMail.BodyFormat = OlBodyFormat.olFormatHTML;
string bodyString = null;
@@ -362,7 +368,8 @@ namespace Greenshot.Interop.Office {
switch (format) {
case EmailFormat.Text:
// Create the attachment (and dispose the COM object after using)
- using (IAttachment attachment = newMail.Attachments.Add(tmpFile, OlAttachmentType.olByValue, 1, attachmentName)) {
+ using (newMail.Attachments.Add(tmpFile, OlAttachmentType.olByValue, 1, attachmentName))
+ {
newMail.BodyFormat = OlBodyFormat.olFormatPlain;
if (bodyString == null) {
bodyString = "";
@@ -433,14 +440,21 @@ namespace Greenshot.Interop.Office {
///
/// Helper method to create an outlook mail item with attachment
///
- /// The file to send, do not delete the file right away!
+ ///
+ /// The file to send, do not delete the file right away!
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
/// true if it worked, false if not
- public static bool ExportToOutlook(EmailFormat format, string tmpFile, string subject, string attachmentName, string to, string CC, string BCC, string url) {
+ public static bool ExportToOutlook(EmailFormat format, string tmpFile, string subject, string attachmentName, string to, string cc, string bcc, string url) {
bool exported = false;
try {
using (IOutlookApplication outlookApplication = GetOrCreateOutlookApplication()) {
if (outlookApplication != null) {
- ExportToNewEmail(outlookApplication, format, tmpFile, subject, attachmentName, to, CC, BCC, url);
+ ExportToNewEmail(outlookApplication, format, tmpFile, subject, attachmentName, to, cc, bcc, url);
exported = true;
}
}
diff --git a/GreenshotOfficePlugin/OfficeExport/WordExporter.cs b/GreenshotOfficePlugin/OfficeExport/WordExporter.cs
index faad20870..30906e681 100644
--- a/GreenshotOfficePlugin/OfficeExport/WordExporter.cs
+++ b/GreenshotOfficePlugin/OfficeExport/WordExporter.cs
@@ -69,7 +69,7 @@ namespace Greenshot.Interop.Office {
///
///
///
- /// link for the image
+ /// link for the image
/// tooltip of the image
///
internal static bool InsertIntoExistingDocument(IWordApplication wordApplication, IWordDocument wordDocument, string tmpFile, string address, string tooltip) {
diff --git a/GreenshotOfficePlugin/OfficePlugin.cs b/GreenshotOfficePlugin/OfficePlugin.cs
index 142b9dee0..9536f93b4 100644
--- a/GreenshotOfficePlugin/OfficePlugin.cs
+++ b/GreenshotOfficePlugin/OfficePlugin.cs
@@ -20,8 +20,6 @@
*/
using System;
using System.Collections.Generic;
-using System.Windows.Forms;
-
using Greenshot.Plugin;
namespace GreenshotOfficePlugin {
@@ -30,15 +28,14 @@ namespace GreenshotOfficePlugin {
///
public class OfficePlugin : IGreenshotPlugin {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(OfficePlugin));
- public static PluginAttribute Attributes;
public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}
- protected virtual void Dispose(bool disposing) {
- //if (disposing) {}
+ protected void Dispose(bool disposing) {
+ // Do nothing
}
public IEnumerable Destinations() {
@@ -100,7 +97,6 @@ namespace GreenshotOfficePlugin {
/// My own attributes
/// true if plugin is initialized, false if not (doesn't show)
public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
- Attributes = myAttributes;
return true;
}
@@ -113,15 +109,5 @@ namespace GreenshotOfficePlugin {
///
public virtual void Configure() {
}
-
- ///
- /// This will be called when Greenshot is shutting down
- ///
- ///
- ///
- public void Closing(object sender, FormClosingEventArgs e) {
- LOG.Debug("Application closing, de-registering Office Plugin!");
- Shutdown();
- }
}
}
diff --git a/GreenshotPhotobucketPlugin/PhotobucketConfiguration.cs b/GreenshotPhotobucketPlugin/PhotobucketConfiguration.cs
index 1b7d8c829..bfb800cd7 100644
--- a/GreenshotPhotobucketPlugin/PhotobucketConfiguration.cs
+++ b/GreenshotPhotobucketPlugin/PhotobucketConfiguration.cs
@@ -30,22 +30,22 @@ namespace GreenshotPhotobucketPlugin {
[IniSection("Photobucket", Description="Greenshot Photobucket Plugin configuration")]
public class PhotobucketConfiguration : IniSection {
[IniProperty("UploadFormat", Description="What file type to use for uploading", DefaultValue="png")]
- public OutputFormat UploadFormat;
+ public OutputFormat UploadFormat { get; set; }
[IniProperty("UploadJpegQuality", Description="JPEG file save quality in %.", DefaultValue="80")]
- public int UploadJpegQuality;
+ public int UploadJpegQuality { get; set; }
[IniProperty("UploadReduceColors", Description="Reduce color amount of the uploaded image to 256", DefaultValue="False")]
- public bool UploadReduceColors;
+ public bool UploadReduceColors { get; set; }
[IniProperty("UsePageLink", Description = "Use pagelink instead of direct link on the clipboard", DefaultValue = "False")]
- public bool UsePageLink;
+ public bool UsePageLink { get; set; }
[IniProperty("Token", Description = "The Photobucket token", Encrypted=true, ExcludeIfNull=true)]
- public string Token;
+ public string Token { get; set; }
[IniProperty("TokenSecret", Description = "The Photobucket token secret", Encrypted=true, ExcludeIfNull=true)]
- public string TokenSecret;
+ public string TokenSecret { get; set; }
[IniProperty("SubDomain", Description = "The Photobucket api subdomain", Encrypted = true, ExcludeIfNull = true)]
- public string SubDomain;
+ public string SubDomain { get; set; }
[IniProperty("Username", Description = "The Photobucket api username", ExcludeIfNull = true)]
- public string Username;
-
+ public string Username { get; set; }
+
public int Credits {
get;
set;
diff --git a/GreenshotPhotobucketPlugin/PhotobucketPlugin.cs b/GreenshotPhotobucketPlugin/PhotobucketPlugin.cs
index 8e5013b6d..b424a4d3e 100644
--- a/GreenshotPhotobucketPlugin/PhotobucketPlugin.cs
+++ b/GreenshotPhotobucketPlugin/PhotobucketPlugin.cs
@@ -34,12 +34,12 @@ namespace GreenshotPhotobucketPlugin {
/// This is the GreenshotPhotobucketPlugin base code
///
public class PhotobucketPlugin : IGreenshotPlugin {
- private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(PhotobucketPlugin));
- private static PhotobucketConfiguration config;
+ private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(PhotobucketPlugin));
+ private static PhotobucketConfiguration _config;
public static PluginAttribute Attributes;
- private IGreenshotHost host;
- private ComponentResourceManager resources;
- private ToolStripMenuItem itemPlugInConfig;
+ private IGreenshotHost _host;
+ private ComponentResourceManager _resources;
+ private ToolStripMenuItem _itemPlugInConfig;
public void Dispose() {
Dispose(true);
@@ -48,9 +48,9 @@ namespace GreenshotPhotobucketPlugin {
protected virtual void Dispose(bool disposing) {
if (disposing) {
- if (itemPlugInConfig != null) {
- itemPlugInConfig.Dispose();
- itemPlugInConfig = null;
+ if (_itemPlugInConfig != null) {
+ _itemPlugInConfig.Dispose();
+ _itemPlugInConfig = null;
}
}
}
@@ -69,97 +69,89 @@ namespace GreenshotPhotobucketPlugin {
///
/// Implementation of the IGreenshotPlugin.Initialize
///
- /// Use the IGreenshotPluginHost interface to register events
- /// Use the ICaptureHost interface to register in the MainContextMenu
- /// My own attributes
+ /// Use the IGreenshotPluginHost interface to register events
+ /// My own attributes
/// true if plugin is initialized, false if not (doesn't show)
public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
- host = (IGreenshotHost)pluginHost;
+ _host = pluginHost;
Attributes = myAttributes;
// Get configuration
- config = IniConfig.GetIniSection();
- resources = new ComponentResourceManager(typeof(PhotobucketPlugin));
-
- itemPlugInConfig = new ToolStripMenuItem(Language.GetString("photobucket", LangKey.configure));
- itemPlugInConfig.Tag = host;
- itemPlugInConfig.Click += delegate {
- config.ShowConfigDialog();
- };
- itemPlugInConfig.Image = (Image)resources.GetObject("Photobucket");
+ _config = IniConfig.GetIniSection();
+ _resources = new ComponentResourceManager(typeof(PhotobucketPlugin));
- PluginUtils.AddToContextMenu(host, itemPlugInConfig);
- Language.LanguageChanged += new LanguageChangedHandler(OnLanguageChanged);
+ _itemPlugInConfig = new ToolStripMenuItem(Language.GetString("photobucket", LangKey.configure))
+ {
+ Tag = _host,
+ Image = (Image)_resources.GetObject("Photobucket")
+ };
+ _itemPlugInConfig.Click += delegate {
+ _config.ShowConfigDialog();
+ };
+
+ PluginUtils.AddToContextMenu(_host, _itemPlugInConfig);
+ Language.LanguageChanged += OnLanguageChanged;
return true;
}
public void OnLanguageChanged(object sender, EventArgs e) {
- if (itemPlugInConfig != null) {
- itemPlugInConfig.Text = Language.GetString("photobucket", LangKey.configure);
+ if (_itemPlugInConfig != null) {
+ _itemPlugInConfig.Text = Language.GetString("photobucket", LangKey.configure);
}
}
public virtual void Shutdown() {
- LOG.Debug("Photobucket Plugin shutdown.");
- Language.LanguageChanged -= new LanguageChangedHandler(OnLanguageChanged);
+ Log.Debug("Photobucket Plugin shutdown.");
+ Language.LanguageChanged -= OnLanguageChanged;
}
///
/// Implementation of the IPlugin.Configure
///
public virtual void Configure() {
- config.ShowConfigDialog();
+ _config.ShowConfigDialog();
}
- ///
- /// This will be called when Greenshot is shutting down
- ///
- ///
- ///
- public void Closing(object sender, FormClosingEventArgs e) {
- LOG.Debug("Application closing, de-registering Photobucket Plugin!");
- Shutdown();
- }
-
///
/// Upload the capture to Photobucket
///
///
/// ISurface
- /// out string for the url
+ /// Path to the album
+ /// out string for the url
/// true if the upload succeeded
- public bool Upload(ICaptureDetails captureDetails, ISurface surfaceToUpload, string albumPath, out string uploadURL) {
- SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(config.UploadFormat, config.UploadJpegQuality, config.UploadReduceColors);
+ public bool Upload(ICaptureDetails captureDetails, ISurface surfaceToUpload, string albumPath, out string uploadUrl) {
+ SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(_config.UploadFormat, _config.UploadJpegQuality, _config.UploadReduceColors);
try {
- string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails));
+ string filename = Path.GetFileName(FilenameHelper.GetFilename(_config.UploadFormat, captureDetails));
PhotobucketInfo photobucketInfo = null;
// Run upload in the background
new PleaseWaitForm().ShowAndWait(Attributes.Name, Language.GetString("photobucket", LangKey.communication_wait),
- delegate() {
+ delegate {
photobucketInfo = PhotobucketUtils.UploadToPhotobucket(surfaceToUpload, outputSettings, albumPath, captureDetails.Title, filename);
}
);
// This causes an exeption if the upload failed :)
- LOG.DebugFormat("Uploaded to Photobucket page: " + photobucketInfo.Page);
- uploadURL = null;
+ Log.DebugFormat("Uploaded to Photobucket page: " + photobucketInfo.Page);
+ uploadUrl = null;
try {
- if (config.UsePageLink) {
- uploadURL = photobucketInfo.Page;
+ if (_config.UsePageLink) {
+ uploadUrl = photobucketInfo.Page;
Clipboard.SetText(photobucketInfo.Page);
} else {
- uploadURL = photobucketInfo.Original;
+ uploadUrl = photobucketInfo.Original;
Clipboard.SetText(photobucketInfo.Original);
}
} catch (Exception ex) {
- LOG.Error("Can't write to clipboard: ", ex);
+ Log.Error("Can't write to clipboard: ", ex);
}
return true;
} catch (Exception e) {
- LOG.Error(e);
+ Log.Error(e);
MessageBox.Show(Language.GetString("photobucket", LangKey.upload_failure) + " " + e.Message);
}
- uploadURL = null;
+ uploadUrl = null;
return false;
}
}
diff --git a/GreenshotPhotobucketPlugin/PhotobucketUtils.cs b/GreenshotPhotobucketPlugin/PhotobucketUtils.cs
index 58d64ed93..c57946119 100644
--- a/GreenshotPhotobucketPlugin/PhotobucketUtils.cs
+++ b/GreenshotPhotobucketPlugin/PhotobucketUtils.cs
@@ -142,7 +142,7 @@ namespace GreenshotPhotobucketPlugin {
///
/// Get list of photobucket albums
///
- /// List
+ /// List of string
public static List RetrievePhotobucketAlbums() {
if (albumsCache != null) {
return albumsCache;
diff --git a/GreenshotPicasaPlugin/PicasaConfiguration.cs b/GreenshotPicasaPlugin/PicasaConfiguration.cs
index c7b81e3c2..dc906d8c9 100644
--- a/GreenshotPicasaPlugin/PicasaConfiguration.cs
+++ b/GreenshotPicasaPlugin/PicasaConfiguration.cs
@@ -29,14 +29,13 @@ namespace GreenshotPicasaPlugin {
[IniSection("Picasa", Description = "Greenshot Picasa Plugin configuration")]
public class PicasaConfiguration : IniSection {
[IniProperty("UploadFormat", Description="What file type to use for uploading", DefaultValue="png")]
- public OutputFormat UploadFormat;
+ public OutputFormat UploadFormat { get; set; }
[IniProperty("UploadJpegQuality", Description="JPEG file save quality in %.", DefaultValue="80")]
- public int UploadJpegQuality;
+ public int UploadJpegQuality { get; set; }
[IniProperty("AfterUploadLinkToClipBoard", Description = "After upload send Picasa link to clipboard.", DefaultValue = "true")]
- public bool AfterUploadLinkToClipBoard;
-
+ public bool AfterUploadLinkToClipBoard { get; set; }
[IniProperty("AddFilename", Description = "Is the filename passed on to Picasa", DefaultValue = "False")]
public bool AddFilename {
get;
diff --git a/GreenshotPicasaPlugin/PicasaPlugin.cs b/GreenshotPicasaPlugin/PicasaPlugin.cs
index 334cead8c..84ba7547e 100644
--- a/GreenshotPicasaPlugin/PicasaPlugin.cs
+++ b/GreenshotPicasaPlugin/PicasaPlugin.cs
@@ -33,12 +33,12 @@ namespace GreenshotPicasaPlugin {
/// This is the Picasa base code
///
public class PicasaPlugin : IGreenshotPlugin {
- private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(PicasaPlugin));
- private static PicasaConfiguration config;
+ private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(PicasaPlugin));
+ private static PicasaConfiguration _config;
public static PluginAttribute Attributes;
- private IGreenshotHost host;
- private ComponentResourceManager resources;
- private ToolStripMenuItem itemPlugInRoot;
+ private IGreenshotHost _host;
+ private ComponentResourceManager _resources;
+ private ToolStripMenuItem _itemPlugInRoot;
public void Dispose() {
Dispose(true);
@@ -47,9 +47,9 @@ namespace GreenshotPicasaPlugin {
protected virtual void Dispose(bool disposing) {
if (disposing) {
- if (itemPlugInRoot != null) {
- itemPlugInRoot.Dispose();
- itemPlugInRoot = null;
+ if (_itemPlugInRoot != null) {
+ _itemPlugInRoot.Dispose();
+ _itemPlugInRoot = null;
}
}
}
@@ -69,36 +69,35 @@ namespace GreenshotPicasaPlugin {
///
/// Implementation of the IGreenshotPlugin.Initialize
///
- /// Use the IGreenshotPluginHost interface to register events
- /// Use the ICaptureHost interface to register in the MainContextMenu
- /// My own attributes
+ /// Use the IGreenshotPluginHost interface to register events
+ /// My own attributes
public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
- host = (IGreenshotHost)pluginHost;
+ _host = pluginHost;
Attributes = myAttributes;
// Get configuration
- config = IniConfig.GetIniSection();
- resources = new ComponentResourceManager(typeof(PicasaPlugin));
+ _config = IniConfig.GetIniSection();
+ _resources = new ComponentResourceManager(typeof(PicasaPlugin));
- itemPlugInRoot = new ToolStripMenuItem();
- itemPlugInRoot.Text = Language.GetString("picasa", LangKey.Configure);
- itemPlugInRoot.Tag = host;
- itemPlugInRoot.Image = (Image)resources.GetObject("Picasa");
- itemPlugInRoot.Click += new EventHandler(ConfigMenuClick);
- PluginUtils.AddToContextMenu(host, itemPlugInRoot);
- Language.LanguageChanged += new LanguageChangedHandler(OnLanguageChanged);
+ _itemPlugInRoot = new ToolStripMenuItem();
+ _itemPlugInRoot.Text = Language.GetString("picasa", LangKey.Configure);
+ _itemPlugInRoot.Tag = _host;
+ _itemPlugInRoot.Image = (Image)_resources.GetObject("Picasa");
+ _itemPlugInRoot.Click += ConfigMenuClick;
+ PluginUtils.AddToContextMenu(_host, _itemPlugInRoot);
+ Language.LanguageChanged += OnLanguageChanged;
return true;
}
public void OnLanguageChanged(object sender, EventArgs e) {
- if (itemPlugInRoot != null) {
- itemPlugInRoot.Text = Language.GetString("picasa", LangKey.Configure);
+ if (_itemPlugInRoot != null) {
+ _itemPlugInRoot.Text = Language.GetString("picasa", LangKey.Configure);
}
}
public virtual void Shutdown() {
- LOG.Debug("Picasa Plugin shutdown.");
- Language.LanguageChanged -= new LanguageChangedHandler(OnLanguageChanged);
+ Log.Debug("Picasa Plugin shutdown.");
+ Language.LanguageChanged -= OnLanguageChanged;
//host.OnImageEditorOpen -= new OnImageEditorOpenHandler(ImageEditorOpened);
}
@@ -106,17 +105,7 @@ namespace GreenshotPicasaPlugin {
/// Implementation of the IPlugin.Configure
///
public virtual void Configure() {
- config.ShowConfigDialog();
- }
-
- ///
- /// This will be called when Greenshot is shutting down
- ///
- ///
- ///
- public void Closing(object sender, FormClosingEventArgs e) {
- LOG.Debug("Application closing, de-registering Picasa Plugin!");
- Shutdown();
+ _config.ShowConfigDialog();
}
public void ConfigMenuClick(object sender, EventArgs eventArgs) {
@@ -124,24 +113,24 @@ namespace GreenshotPicasaPlugin {
}
public bool Upload(ICaptureDetails captureDetails, ISurface surfaceToUpload, out string uploadUrl) {
- SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(config.UploadFormat, config.UploadJpegQuality);
+ SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(_config.UploadFormat, _config.UploadJpegQuality);
try {
string url = null;
new PleaseWaitForm().ShowAndWait(Attributes.Name, Language.GetString("picasa", LangKey.communication_wait),
- delegate() {
- string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails));
- string contentType = "image/" + config.UploadFormat.ToString();
+ delegate
+ {
+ string filename = Path.GetFileName(FilenameHelper.GetFilename(_config.UploadFormat, captureDetails));
url = PicasaUtils.UploadToPicasa(surfaceToUpload, outputSettings, captureDetails.Title, filename);
}
);
uploadUrl = url;
- if (uploadUrl != null && config.AfterUploadLinkToClipBoard) {
+ if (uploadUrl != null && _config.AfterUploadLinkToClipBoard) {
ClipboardHelper.SetClipboardData(uploadUrl);
}
return true;
} catch (Exception e) {
- LOG.Error("Error uploading.", e);
+ Log.Error("Error uploading.", e);
MessageBox.Show(Language.GetString("picasa", LangKey.upload_failure) + " " + e.Message);
}
uploadUrl = null;
diff --git a/GreenshotPlugin/Controls/BackgroundForm.cs b/GreenshotPlugin/Controls/BackgroundForm.cs
index 499b83518..a34e443c9 100644
--- a/GreenshotPlugin/Controls/BackgroundForm.cs
+++ b/GreenshotPlugin/Controls/BackgroundForm.cs
@@ -28,7 +28,7 @@ namespace GreenshotPlugin.Controls {
///
/// Description of PleaseWaitForm.
///
- public partial class BackgroundForm : Form {
+ public sealed partial class BackgroundForm : Form {
private volatile bool _shouldClose;
private void BackgroundShowDialog() {
diff --git a/GreenshotPlugin/Controls/HotkeyControl.cs b/GreenshotPlugin/Controls/HotkeyControl.cs
index 7bd756fef..1fb7683d0 100644
--- a/GreenshotPlugin/Controls/HotkeyControl.cs
+++ b/GreenshotPlugin/Controls/HotkeyControl.cs
@@ -457,7 +457,6 @@ namespace GreenshotPlugin.Controls {
///
/// Register a hotkey
///
- /// The window which will get the event
/// The modifier, e.g.: Modifiers.CTRL, Modifiers.NONE or Modifiers.ALT
/// The virtual key code
/// A HotKeyHandler, this will be called to handle the hotkey press
diff --git a/GreenshotPlugin/Core/AbstractDestination.cs b/GreenshotPlugin/Core/AbstractDestination.cs
index 054a01110..256f7f042 100644
--- a/GreenshotPlugin/Core/AbstractDestination.cs
+++ b/GreenshotPlugin/Core/AbstractDestination.cs
@@ -299,14 +299,17 @@ namespace GreenshotPlugin.Core {
///
/// Return a menu item
///
+ ///
+ ///
///
/// ToolStripMenuItem
public virtual ToolStripMenuItem GetMenuItem(bool addDynamics, ContextMenuStrip menu, EventHandler destinationClickHandler) {
- ToolStripMenuItem basisMenuItem;
- basisMenuItem = new ToolStripMenuItem(Description);
- basisMenuItem.Image = DisplayIcon;
- basisMenuItem.Tag = this;
- basisMenuItem.Text = Description;
+ var basisMenuItem = new ToolStripMenuItem(Description)
+ {
+ Image = DisplayIcon,
+ Tag = this,
+ Text = Description
+ };
AddTagEvents(basisMenuItem, menu, Description);
basisMenuItem.Click -= destinationClickHandler;
basisMenuItem.Click += destinationClickHandler;
diff --git a/GreenshotPlugin/Core/BinaryStructHelper.cs b/GreenshotPlugin/Core/BinaryStructHelper.cs
index 0d43679b4..297bebf1b 100644
--- a/GreenshotPlugin/Core/BinaryStructHelper.cs
+++ b/GreenshotPlugin/Core/BinaryStructHelper.cs
@@ -50,7 +50,7 @@ namespace GreenshotPlugin.Core {
/// Get a struct from a byte array
///
/// typeof struct
- /// byte[]
+ /// Pointer to the structor to return
/// struct
public static T FromIntPtr(IntPtr intPtr) where T : struct {
object obj = Marshal.PtrToStructure(intPtr, typeof(T));
diff --git a/GreenshotPlugin/Core/ClipboardHelper.cs b/GreenshotPlugin/Core/ClipboardHelper.cs
index 69130babc..7765a57b6 100644
--- a/GreenshotPlugin/Core/ClipboardHelper.cs
+++ b/GreenshotPlugin/Core/ClipboardHelper.cs
@@ -304,7 +304,7 @@ EndSelection:<<<<<<<4
/// Returned images must be disposed by the calling code!
///
///
- /// IEnumerable
+ /// IEnumerable of Image
public static IEnumerable GetImages(IDataObject dataObject) {
// Get single image, this takes the "best" match
Image singleImage = GetImage(dataObject);
@@ -708,7 +708,7 @@ EndSelection:<<<<<<<4
///
/// Retrieve a list of all formats currently on the clipboard
///
- /// List with the current formats
+ /// List of strings with the current formats
public static List GetFormats() {
return GetFormats(GetDataObject());
}
@@ -716,7 +716,7 @@ EndSelection:<<<<<<<4
///
/// Retrieve a list of all formats currently in the IDataObject
///
- /// List with the current formats
+ /// List of string with the current formats
public static List GetFormats(IDataObject dataObj) {
string[] formats = null;
@@ -733,7 +733,6 @@ EndSelection:<<<<<<<4
///
/// Check if there is currently something in the dataObject which has the supplied format
///
- /// IDataObject
/// string with format
/// true if one the format is found
public static bool ContainsFormat(string format) {
@@ -743,6 +742,7 @@ EndSelection:<<<<<<<4
///
/// Check if there is currently something on the clipboard which has the supplied format
///
+ /// IDataObject
/// string with format
/// true if one the format is found
public static bool ContainsFormat(IDataObject dataObject, string format) {
diff --git a/GreenshotPlugin/Core/CoreConfiguration.cs b/GreenshotPlugin/Core/CoreConfiguration.cs
index 07a4eaf4a..70e0d4a16 100644
--- a/GreenshotPlugin/Core/CoreConfiguration.cs
+++ b/GreenshotPlugin/Core/CoreConfiguration.cs
@@ -62,206 +62,206 @@ namespace GreenshotPlugin.Core {
public event PropertyChangedEventHandler PropertyChanged;
[IniProperty("Language", Description = "The language in IETF format (e.g. en-US)")]
- public string Language;
+ public string Language { get; set; }
[IniProperty("RegionHotkey", Description="Hotkey for starting the region capture", DefaultValue="PrintScreen")]
- public string RegionHotkey;
+ public string RegionHotkey { get; set; }
[IniProperty("WindowHotkey", Description="Hotkey for starting the window capture", DefaultValue="Alt + PrintScreen")]
- public string WindowHotkey;
+ public string WindowHotkey { get; set; }
[IniProperty("FullscreenHotkey", Description="Hotkey for starting the fullscreen capture", DefaultValue="Ctrl + PrintScreen")]
- public string FullscreenHotkey;
+ public string FullscreenHotkey { get; set; }
[IniProperty("LastregionHotkey", Description="Hotkey for starting the last region capture", DefaultValue="Shift + PrintScreen")]
- public string LastregionHotkey;
+ public string LastregionHotkey { get; set; }
[IniProperty("IEHotkey", Description="Hotkey for starting the IE capture", DefaultValue="Shift + Ctrl + PrintScreen")]
- public string IEHotkey;
+ public string IEHotkey { get; set; }
[IniProperty("IsFirstLaunch", Description="Is this the first time launch?", DefaultValue="true")]
- public bool IsFirstLaunch;
+ public bool IsFirstLaunch { get; set; }
[IniProperty("Destinations", Separator=",", Description="Which destinations? Possible options (more might be added by plugins) are: Editor, FileDefault, FileWithDialog, Clipboard, Printer, EMail, Picker", DefaultValue="Picker")]
- public List OutputDestinations = new List();
+ public List OutputDestinations { get; set; } = new List();
[IniProperty("ClipboardFormats", Separator=",", Description="Specify which formats we copy on the clipboard? Options are: PNG, HTML, HTMLDATAURL and DIB", DefaultValue="PNG,DIB")]
- public List ClipboardFormats = new List();
+ public List ClipboardFormats { get; set; } = new List();
[IniProperty("CaptureMousepointer", Description="Should the mouse be captured?", DefaultValue="true")]
- public bool CaptureMousepointer;
+ public bool CaptureMousepointer { get; set; }
[IniProperty("CaptureWindowsInteractive", Description="Use interactive window selection to capture? (false=Capture active window)", DefaultValue="false")]
- public bool CaptureWindowsInteractive;
+ public bool CaptureWindowsInteractive { get; set; }
[IniProperty("CaptureDelay", Description="Capture delay in millseconds.", DefaultValue="100")]
- public int CaptureDelay;
+ public int CaptureDelay { get; set; }
[IniProperty("ScreenCaptureMode", Description = "The capture mode used to capture a screen. (Auto, FullScreen, Fixed)", DefaultValue = "Auto")]
- public ScreenCaptureMode ScreenCaptureMode;
+ public ScreenCaptureMode ScreenCaptureMode { get; set; }
[IniProperty("ScreenToCapture", Description = "The screen number to capture when using ScreenCaptureMode Fixed.", DefaultValue = "1")]
- public int ScreenToCapture;
+ public int ScreenToCapture { get; set; }
[IniProperty("WindowCaptureMode", Description = "The capture mode used to capture a Window (Screen, GDI, Aero, AeroTransparent, Auto).", DefaultValue = "Auto")]
- public WindowCaptureMode WindowCaptureMode;
+ public WindowCaptureMode WindowCaptureMode { get; set; }
[IniProperty("WindowCaptureAllChildLocations", Description="Enable/disable capture all children, very slow but will make it possible to use this information in the editor.", DefaultValue="False")]
- public bool WindowCaptureAllChildLocations;
+ public bool WindowCaptureAllChildLocations { get; set; }
[IniProperty("DWMBackgroundColor", Description="The background color for a DWM window capture.")]
- public Color DWMBackgroundColor;
+ public Color DWMBackgroundColor { get; set; }
[IniProperty("PlayCameraSound", LanguageKey="settings_playsound",Description="Play a camera sound after taking a capture.", DefaultValue="false")]
- public bool PlayCameraSound = false;
+ public bool PlayCameraSound { get; set; } = false;
[IniProperty("ShowTrayNotification", LanguageKey="settings_shownotify",Description="Show a notification from the systray when a capture is taken.", DefaultValue="true")]
- public bool ShowTrayNotification = true;
+ public bool ShowTrayNotification { get; set; } = true;
[IniProperty("OutputFilePath", Description="Output file path.")]
- public string OutputFilePath;
+ public string OutputFilePath { get; set; }
[IniProperty("OutputFileAllowOverwrite", Description = "If the target file already exists True will make Greenshot always overwrite and False will display a 'Save-As' dialog.", DefaultValue = "true")]
- public bool OutputFileAllowOverwrite;
+ public bool OutputFileAllowOverwrite { get; set; }
[IniProperty("OutputFileFilenamePattern", Description = "Filename pattern for screenshot.", DefaultValue = "${capturetime:d\"yyyy-MM-dd HH_mm_ss\"}-${title}")]
- public string OutputFileFilenamePattern;
+ public string OutputFileFilenamePattern { get; set; }
[IniProperty("OutputFileFormat", Description="Default file type for writing screenshots. (bmp, gif, jpg, png, tiff)", DefaultValue="png")]
- public OutputFormat OutputFileFormat = OutputFormat.png;
+ public OutputFormat OutputFileFormat { get; set; } = OutputFormat.png;
[IniProperty("OutputFileReduceColors", Description="If set to true, than the colors of the output file are reduced to 256 (8-bit) colors", DefaultValue="false")]
- public bool OutputFileReduceColors;
+ public bool OutputFileReduceColors { get; set; }
[IniProperty("OutputFileAutoReduceColors", Description = "If set to true the amount of colors is counted and if smaller than 256 the color reduction is automatically used.", DefaultValue = "false")]
- public bool OutputFileAutoReduceColors;
+ public bool OutputFileAutoReduceColors { get; set; }
[IniProperty("OutputFileReduceColorsTo", Description = "Amount of colors to reduce to, when reducing", DefaultValue = "256")]
- public int OutputFileReduceColorsTo;
+ public int OutputFileReduceColorsTo { get; set; }
[IniProperty("OutputFileCopyPathToClipboard", Description="When saving a screenshot, copy the path to the clipboard?", DefaultValue="true")]
- public bool OutputFileCopyPathToClipboard;
+ public bool OutputFileCopyPathToClipboard { get; set; }
[IniProperty("OutputFileAsFullpath", Description="SaveAs Full path?")]
- public string OutputFileAsFullpath;
-
+ public string OutputFileAsFullpath { get; set; }
+
[IniProperty("OutputFileJpegQuality", Description="JPEG file save quality in %.", DefaultValue="80")]
- public int OutputFileJpegQuality;
+ public int OutputFileJpegQuality { get; set; }
[IniProperty("OutputFilePromptQuality", Description="Ask for the quality before saving?", DefaultValue="false")]
- public bool OutputFilePromptQuality;
+ public bool OutputFilePromptQuality { get; set; }
[IniProperty("OutputFileIncrementingNumber", Description="The number for the ${NUM} in the filename pattern, is increased automatically after each save.", DefaultValue="1")]
- public uint OutputFileIncrementingNumber;
-
+ public uint OutputFileIncrementingNumber { get; set; }
+
[IniProperty("OutputPrintPromptOptions", LanguageKey="settings_alwaysshowprintoptionsdialog", Description="Ask for print options when printing?", DefaultValue="true")]
- public bool OutputPrintPromptOptions;
+ public bool OutputPrintPromptOptions { get; set; }
[IniProperty("OutputPrintAllowRotate", LanguageKey="printoptions_allowrotate", Description="Allow rotating the picture for fitting on paper?", DefaultValue="false")]
- public bool OutputPrintAllowRotate;
+ public bool OutputPrintAllowRotate { get; set; }
[IniProperty("OutputPrintAllowEnlarge", LanguageKey="printoptions_allowenlarge", Description="Allow growing the picture for fitting on paper?", DefaultValue="false")]
- public bool OutputPrintAllowEnlarge;
+ public bool OutputPrintAllowEnlarge { get; set; }
[IniProperty("OutputPrintAllowShrink", LanguageKey="printoptions_allowshrink", Description="Allow shrinking the picture for fitting on paper?", DefaultValue="true")]
- public bool OutputPrintAllowShrink;
+ public bool OutputPrintAllowShrink { get; set; }
[IniProperty("OutputPrintCenter", LanguageKey="printoptions_allowcenter", Description="Center image when printing?", DefaultValue="true")]
- public bool OutputPrintCenter;
+ public bool OutputPrintCenter { get; set; }
[IniProperty("OutputPrintInverted", LanguageKey="printoptions_inverted", Description="Print image inverted (use e.g. for console captures)", DefaultValue="false")]
- public bool OutputPrintInverted;
+ public bool OutputPrintInverted { get; set; }
[IniProperty("OutputPrintGrayscale", LanguageKey = "printoptions_printgrayscale", Description = "Force grayscale printing", DefaultValue = "false")]
- public bool OutputPrintGrayscale;
+ public bool OutputPrintGrayscale { get; set; }
[IniProperty("OutputPrintMonochrome", LanguageKey = "printoptions_printmonochrome", Description = "Force monorchrome printing", DefaultValue = "false")]
- public bool OutputPrintMonochrome;
+ public bool OutputPrintMonochrome { get; set; }
[IniProperty("OutputPrintMonochromeThreshold", Description = "Threshold for monochrome filter (0 - 255), lower value means less black", DefaultValue = "127")]
- public byte OutputPrintMonochromeThreshold;
+ public byte OutputPrintMonochromeThreshold { get; set; }
[IniProperty("OutputPrintFooter", LanguageKey = "printoptions_timestamp", Description = "Print footer on print?", DefaultValue = "true")]
- public bool OutputPrintFooter;
+ public bool OutputPrintFooter { get; set; }
[IniProperty("OutputPrintFooterPattern", Description = "Footer pattern", DefaultValue = "${capturetime:d\"D\"} ${capturetime:d\"T\"} - ${title}")]
- public string OutputPrintFooterPattern;
+ public string OutputPrintFooterPattern { get; set; }
[IniProperty("NotificationSound", Description = "The wav-file to play when a capture is taken, loaded only once at the Greenshot startup", DefaultValue="default")]
- public string NotificationSound;
+ public string NotificationSound { get; set; }
[IniProperty("UseProxy", Description="Use your global proxy?", DefaultValue="True")]
- public bool UseProxy;
+ public bool UseProxy { get; set; }
[IniProperty("IECapture", Description="Enable/disable IE capture", DefaultValue="True")]
- public bool IECapture;
+ public bool IECapture { get; set; }
[IniProperty("IEFieldCapture", Description="Enable/disable IE field capture, very slow but will make it possible to annotate the fields of a capture in the editor.", DefaultValue="False")]
- public bool IEFieldCapture;
+ public bool IEFieldCapture { get; set; }
[IniProperty("WindowClassesToCheckForIE", Description = "Comma separated list of Window-Classes which need to be checked for a IE instance!", DefaultValue = "AfxFrameOrView70,IMWindowClass")]
- public List WindowClassesToCheckForIE;
+ public List WindowClassesToCheckForIE { get; set; }
[IniProperty("AutoCropDifference", Description="Sets how to compare the colors for the autocrop detection, the higher the more is 'selected'. Possible values are from 0 to 255, where everything above ~150 doesn't make much sense!", DefaultValue="10")]
- public int AutoCropDifference;
+ public int AutoCropDifference { get; set; }
[IniProperty("IncludePlugins", Description="Comma separated list of Plugins which are allowed. If something in the list, than every plugin not in the list will not be loaded!")]
- public List IncludePlugins;
+ public List IncludePlugins { get; set; }
[IniProperty("ExcludePlugins", Description="Comma separated list of Plugins which are NOT allowed.")]
- public List ExcludePlugins;
+ public List ExcludePlugins { get; set; }
[IniProperty("ExcludeDestinations", Description = "Comma separated list of destinations which should be disabled.")]
- public List ExcludeDestinations;
+ public List ExcludeDestinations { get; set; }
[IniProperty("UpdateCheckInterval", Description="How many days between every update check? (0=no checks)", DefaultValue="1")]
- public int UpdateCheckInterval;
+ public int UpdateCheckInterval { get; set; }
[IniProperty("LastUpdateCheck", Description="Last update check")]
- public DateTime LastUpdateCheck;
+ public DateTime LastUpdateCheck { get; set; }
[IniProperty("DisableSettings", Description = "Enable/disable the access to the settings, can only be changed manually in this .ini", DefaultValue = "False")]
- public bool DisableSettings;
+ public bool DisableSettings { get; set; }
[IniProperty("DisableQuickSettings", Description = "Enable/disable the access to the quick settings, can only be changed manually in this .ini", DefaultValue = "False")]
- public bool DisableQuickSettings;
+ public bool DisableQuickSettings { get; set; }
[IniProperty("DisableTrayicon", Description = "Disable the trayicon, can only be changed manually in this .ini", DefaultValue = "False")]
- public bool HideTrayicon;
+ public bool HideTrayicon { get; set; }
[IniProperty("HideExpertSettings", Description = "Hide expert tab in the settings, can only be changed manually in this .ini", DefaultValue = "False")]
- public bool HideExpertSettings;
+ public bool HideExpertSettings { get; set; }
[IniProperty("ThumnailPreview", Description="Enable/disable thumbnail previews", DefaultValue="True")]
- public bool ThumnailPreview;
-
+ public bool ThumnailPreview { get; set; }
+
[IniProperty("NoGDICaptureForProduct", Description = "List of productnames for which GDI capturing is skipped (using fallback).", DefaultValue = "IntelliJ IDEA")]
- public List NoGDICaptureForProduct;
+ public List NoGDICaptureForProduct { get; set; }
[IniProperty("NoDWMCaptureForProduct", Description = "List of productnames for which DWM capturing is skipped (using fallback).", DefaultValue = "Citrix ICA Client")]
- public List NoDWMCaptureForProduct;
+ public List NoDWMCaptureForProduct { get; set; }
[IniProperty("OptimizeForRDP", Description="Make some optimizations for usage with remote desktop", DefaultValue="False")]
- public bool OptimizeForRDP;
+ public bool OptimizeForRDP { get; set; }
[IniProperty("DisableRDPOptimizing", Description = "Disable all optimizations for usage with remote desktop", DefaultValue = "False")]
- public bool DisableRDPOptimizing;
+ public bool DisableRDPOptimizing { get; set; }
[IniProperty("MinimizeWorkingSetSize", Description="Optimize memory footprint, but with a performance penalty!", DefaultValue="False")]
- public bool MinimizeWorkingSetSize;
+ public bool MinimizeWorkingSetSize { get; set; }
[IniProperty("WindowCaptureRemoveCorners", Description = "Remove the corners from a window capture", DefaultValue = "True")]
- public bool WindowCaptureRemoveCorners;
+ public bool WindowCaptureRemoveCorners { get; set; }
[IniProperty("CheckForUnstable", Description = "Also check for unstable version updates", DefaultValue = "False")]
- public bool CheckForUnstable;
+ public bool CheckForUnstable { get; set; }
[IniProperty("ActiveTitleFixes", Description="The fixes that are active.")]
- public List ActiveTitleFixes;
-
+ public List ActiveTitleFixes { get; set; }
+
[IniProperty("TitleFixMatcher", Description="The regular expressions to match the title with.")]
- public Dictionary TitleFixMatcher;
+ public Dictionary TitleFixMatcher { get; set; }
[IniProperty("TitleFixReplacer", Description="The replacements for the matchers.")]
- public Dictionary TitleFixReplacer;
+ public Dictionary TitleFixReplacer { get; set; }
[IniProperty("ExperimentalFeatures", Description="A list of experimental features, this allows us to test certain features before releasing them.", ExcludeIfNull=true)]
- public List ExperimentalFeatures;
+ public List ExperimentalFeatures { get; set; }
[IniProperty("EnableSpecialDIBClipboardReader", Description = "Enable a special DIB clipboard reader", DefaultValue="True")]
- public bool EnableSpecialDIBClipboardReader;
+ public bool EnableSpecialDIBClipboardReader { get; set; }
[IniProperty("WindowCornerCutShape", Description = "The cutshape which is used to remove the window corners, is mirrorred for all corners", DefaultValue = "5,3,2,1,1")]
- public List WindowCornerCutShape;
+ public List WindowCornerCutShape { get; set; }
[IniProperty("LeftClickAction", Description = "Specify what action is made if the tray icon is left clicked, if a double-click action is specified this action is initiated after a delay (configurable via the windows double-click speed)", DefaultValue = "SHOW_CONTEXT_MENU")]
- public ClickActions LeftClickAction;
+ public ClickActions LeftClickAction { get; set; }
[IniProperty("DoubleClickAction", Description = "Specify what action is made if the tray icon is double clicked", DefaultValue = "OPEN_LAST_IN_EXPLORER")]
- public ClickActions DoubleClickAction;
+ public ClickActions DoubleClickAction { get; set; }
[IniProperty("ZoomerEnabled", Description = "Sets if the zoomer is enabled", DefaultValue = "True")]
- public bool ZoomerEnabled;
+ public bool ZoomerEnabled { get; set; }
[IniProperty("ZoomerOpacity", Description = "Specify the transparency for the zoomer, from 0-1 (where 1 is no transparency and 0 is complete transparent. An usefull setting would be 0.7)", DefaultValue = "1")]
- public float ZoomerOpacity;
+ public float ZoomerOpacity { get; set; }
[IniProperty("MaxMenuItemLength", Description = "Maximum length of submenu items in the context menu, making this longer might cause context menu issues on dual screen systems.", DefaultValue = "25")]
- public int MaxMenuItemLength;
+ public int MaxMenuItemLength { get; set; }
[IniProperty("MailApiTo", Description = "The 'to' field for the email destination (settings for Outlook can be found under the Office section)", DefaultValue = "")]
- public string MailApiTo;
+ public string MailApiTo { get; set; }
[IniProperty("MailApiCC", Description = "The 'CC' field for the email destination (settings for Outlook can be found under the Office section)", DefaultValue = "")]
- public string MailApiCC;
+ public string MailApiCC { get; set; }
[IniProperty("MailApiBCC", Description = "The 'BCC' field for the email destination (settings for Outlook can be found under the Office section)", DefaultValue = "")]
- public string MailApiBCC;
+ public string MailApiBCC { get; set; }
[IniProperty("OptimizePNGCommand", Description = "Optional command to execute on a temporary PNG file, the command should overwrite the file and Greenshot will read it back. Note: this command is also executed when uploading PNG's!", DefaultValue = "")]
- public string OptimizePNGCommand;
+ public string OptimizePNGCommand { get; set; }
[IniProperty("OptimizePNGCommandArguments", Description = "Arguments for the optional command to execute on a PNG, {0} is replaced by the temp-filename from Greenshot. Note: Temp-file is deleted afterwards by Greenshot.", DefaultValue = "\"{0}\"")]
- public string OptimizePNGCommandArguments;
+ public string OptimizePNGCommandArguments { get; set; }
[IniProperty("LastSaveWithVersion", Description = "Version of Greenshot which created this .ini")]
- public string LastSaveWithVersion;
+ public string LastSaveWithVersion { get; set; }
[IniProperty("ProcessEXIFOrientation", Description = "When reading images from files or clipboard, use the EXIF information to correct the orientation", DefaultValue = "True")]
- public bool ProcessEXIFOrientation;
+ public bool ProcessEXIFOrientation { get; set; }
[IniProperty("LastCapturedRegion", Description = "The last used region, for reuse in the capture last region")]
- public Rectangle LastCapturedRegion;
+ public Rectangle LastCapturedRegion { get; set; }
private Size _iconSize;
[IniProperty("IconSize", Description = "Defines the size of the icons (e.g. for the buttons in the editor), default value 16,16 anything bigger will cause scaling", DefaultValue = "16,16")]
@@ -295,9 +295,9 @@ namespace GreenshotPlugin.Core {
}
[IniProperty("WebRequestTimeout", Description = "The connect timeout value for webrequets, these are seconds", DefaultValue = "100")]
- public int WebRequestTimeout;
+ public int WebRequestTimeout { get; set; }
[IniProperty("WebRequestReadWriteTimeout", Description = "The read/write timeout value for webrequets, these are seconds", DefaultValue = "100")]
- public int WebRequestReadWriteTimeout;
+ public int WebRequestReadWriteTimeout { get; set; }
///
/// Specifies what THIS build is
diff --git a/GreenshotPlugin/Core/CredentialsHelper.cs b/GreenshotPlugin/Core/CredentialsHelper.cs
index 6d8138963..ddff6d907 100644
--- a/GreenshotPlugin/Core/CredentialsHelper.cs
+++ b/GreenshotPlugin/Core/CredentialsHelper.cs
@@ -25,37 +25,37 @@ using System.Text;
using System.Threading;
using System.Windows.Forms;
-///
-/// The following code comes from: http://www.developerfusion.com/code/4693/using-the-credential-management-api/
-/// and is slightly modified so it works for us.
-/// As the "Stored usernames and passwords" which can be accessed by: Start-> Run and type "Control keymgr.dll"
-/// doesn't show all credentials use the tool here: http://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;
-/// }
-///
namespace GreenshotPlugin.Core {
+ ///
+ /// The following code comes from: http://www.developerfusion.com/code/4693/using-the-credential-management-api/
+ /// and is slightly modified so it works for us.
+ /// As the "Stored usernames and passwords" which can be accessed by: Start-> Run and type "Control keymgr.dll"
+ /// doesn't show all credentials use the tool here: http://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;
+ /// }
+ ///
/// Encapsulates dialog functionality from the Credential Management API.
public sealed class CredentialsDialog {
[DllImport("gdi32.dll", SetLastError=true)]
diff --git a/GreenshotPlugin/Core/FastBitmap.cs b/GreenshotPlugin/Core/FastBitmap.cs
index a3432875c..e86f28d72 100644
--- a/GreenshotPlugin/Core/FastBitmap.cs
+++ b/GreenshotPlugin/Core/FastBitmap.cs
@@ -52,7 +52,8 @@ namespace GreenshotPlugin.Core {
/// The returned byte[] color depends on the underlying pixel format
///
/// int x
- /// int yint y
+ /// byte array
void GetColorAt(int x, int y, byte[] color);
///
@@ -139,7 +140,7 @@ namespace GreenshotPlugin.Core {
///
/// Returns if this FastBitmap has an alpha channel
///
- bool hasAlphaChannel {
+ bool HasAlphaChannel {
get;
}
@@ -216,7 +217,8 @@ namespace GreenshotPlugin.Core {
/// The returned byte[] color depends on the underlying pixel format
///
/// int x
- /// int yint y
+ /// byte array
new void GetColorAt(int x, int y, byte[] color);
new int Left {
@@ -283,20 +285,20 @@ namespace GreenshotPlugin.Core {
///
/// The base class for the fast bitmap implementation
///
- public unsafe abstract class FastBitmap : IFastBitmap, IFastBitmapWithClip, IFastBitmapWithOffset {
- private static ILog LOG = LogManager.GetLogger(typeof(FastBitmap));
+ public abstract unsafe class FastBitmap : IFastBitmap, IFastBitmapWithClip, IFastBitmapWithOffset {
+ private static ILog _log = LogManager.GetLogger(typeof(FastBitmap));
- protected const int PIXELFORMAT_INDEX_A = 3;
- protected const int PIXELFORMAT_INDEX_R = 2;
- protected const int PIXELFORMAT_INDEX_G = 1;
- protected const int PIXELFORMAT_INDEX_B = 0;
+ protected const int PixelformatIndexA = 3;
+ protected const int PixelformatIndexR = 2;
+ protected const int PixelformatIndexG = 1;
+ protected const int PixelformatIndexB = 0;
- public const int COLOR_INDEX_R = 0;
- public const int COLOR_INDEX_G = 1;
- public const int COLOR_INDEX_B = 2;
- public const int COLOR_INDEX_A = 3;
+ public const int ColorIndexR = 0;
+ public const int ColorIndexG = 1;
+ public const int ColorIndexB = 2;
+ public const int ColorIndexA = 3;
- protected Rectangle area = Rectangle.Empty;
+ protected Rectangle Area = Rectangle.Empty;
///
/// If this is set to true, the bitmap will be disposed when disposing the IFastBitmap
///
@@ -318,19 +320,19 @@ namespace GreenshotPlugin.Core {
///
/// The bitmap for which the FastBitmap is creating access
///
- protected Bitmap bitmap;
+ protected Bitmap Bitmap;
- protected BitmapData bmData;
- protected int stride; /* bytes per pixel row */
- protected bool bitsLocked;
- protected byte* pointer;
+ protected BitmapData BmData;
+ protected int Stride; /* bytes per pixel row */
+ protected bool BitsLocked;
+ protected byte* Pointer;
public static IFastBitmap Create(Bitmap source) {
return Create(source, Rectangle.Empty);
}
public void SetResolution(float horizontal, float vertical) {
- bitmap.SetResolution(horizontal, vertical);
+ Bitmap.SetResolution(horizontal, vertical);
}
///
@@ -345,12 +347,12 @@ namespace GreenshotPlugin.Core {
case PixelFormat.Format8bppIndexed:
return new FastChunkyBitmap(source, area);
case PixelFormat.Format24bppRgb:
- return new Fast24RGBBitmap(source, area);
+ return new Fast24RgbBitmap(source, area);
case PixelFormat.Format32bppRgb:
- return new Fast32RGBBitmap(source, area);
+ return new Fast32RgbBitmap(source, area);
case PixelFormat.Format32bppArgb:
case PixelFormat.Format32bppPArgb:
- return new Fast32ARGBBitmap(source, area);
+ return new Fast32ArgbBitmap(source, area);
default:
throw new NotSupportedException(string.Format("Not supported Pixelformat {0}", source.PixelFormat));
}
@@ -417,21 +419,22 @@ namespace GreenshotPlugin.Core {
///
/// Constructor which stores the image and locks it when called
///
- ///
+ /// Bitmap
+ /// Rectangle
protected FastBitmap(Bitmap bitmap, Rectangle area) {
- this.bitmap = bitmap;
+ Bitmap = bitmap;
Rectangle bitmapArea = new Rectangle(Point.Empty, bitmap.Size);
if (area != Rectangle.Empty) {
area.Intersect(bitmapArea);
- this.area = area;
+ Area = area;
} else {
- this.area = bitmapArea;
+ Area = bitmapArea;
}
// As the lock takes care that only the specified area is made available we need to calculate the offset
Left = area.Left;
Top = area.Top;
// Default cliping is done to the area without invert
- Clip = this.area;
+ Clip = Area;
InvertClip = false;
// Always lock, so we don't need to do this ourselves
Lock();
@@ -442,10 +445,10 @@ namespace GreenshotPlugin.Core {
///
public Size Size {
get {
- if (area == Rectangle.Empty) {
- return bitmap.Size;
+ if (Area == Rectangle.Empty) {
+ return Bitmap.Size;
}
- return area.Size;
+ return Area.Size;
}
}
@@ -454,10 +457,10 @@ namespace GreenshotPlugin.Core {
///
public int Width {
get {
- if (area == Rectangle.Empty) {
- return bitmap.Width;
+ if (Area == Rectangle.Empty) {
+ return Bitmap.Width;
}
- return area.Width;
+ return Area.Width;
}
}
@@ -466,14 +469,14 @@ namespace GreenshotPlugin.Core {
///
public int Height {
get {
- if (area == Rectangle.Empty) {
- return bitmap.Height;
+ if (Area == Rectangle.Empty) {
+ return Bitmap.Height;
}
- return area.Height;
+ return Area.Height;
}
}
- private int left;
+ private int _left;
///
/// Return the left of the fastbitmap, this is also used as an offset
///
@@ -482,7 +485,7 @@ namespace GreenshotPlugin.Core {
return 0;
}
set {
- left = value;
+ _left = value;
}
}
@@ -491,14 +494,14 @@ namespace GreenshotPlugin.Core {
///
int IFastBitmapWithOffset.Left {
get {
- return left;
+ return _left;
}
set {
- left = value;
+ _left = value;
}
}
- private int top;
+ private int _top;
///
/// Return the top of the fastbitmap, this is also used as an offset
///
@@ -507,7 +510,7 @@ namespace GreenshotPlugin.Core {
return 0;
}
set {
- top = value;
+ _top = value;
}
}
@@ -516,10 +519,10 @@ namespace GreenshotPlugin.Core {
///
int IFastBitmapWithOffset.Top {
get {
- return top;
+ return _top;
}
set {
- top = value;
+ _top = value;
}
}
@@ -545,14 +548,14 @@ namespace GreenshotPlugin.Core {
/// Returns the underlying bitmap, unlocks it and prevents that it will be disposed
///
public Bitmap UnlockAndReturnBitmap() {
- if (bitsLocked) {
+ if (BitsLocked) {
Unlock();
}
NeedsDispose = false;
- return bitmap;
+ return Bitmap;
}
- public virtual bool hasAlphaChannel {
+ public virtual bool HasAlphaChannel {
get {
return false;
}
@@ -584,26 +587,26 @@ namespace GreenshotPlugin.Core {
protected virtual void Dispose(bool disposing) {
Unlock();
if (disposing) {
- if (bitmap != null && NeedsDispose) {
- bitmap.Dispose();
+ if (Bitmap != null && NeedsDispose) {
+ Bitmap.Dispose();
}
}
- bitmap = null;
- bmData = null;
- pointer = null;
+ Bitmap = null;
+ BmData = null;
+ Pointer = null;
}
///
/// Lock the bitmap so we have direct access to the memory
///
public void Lock() {
- if (Width > 0 && Height > 0 && !bitsLocked) {
- bmData = bitmap.LockBits(area, ImageLockMode.ReadWrite, bitmap.PixelFormat);
- bitsLocked = true;
+ if (Width > 0 && Height > 0 && !BitsLocked) {
+ BmData = Bitmap.LockBits(Area, ImageLockMode.ReadWrite, Bitmap.PixelFormat);
+ BitsLocked = true;
- IntPtr Scan0 = bmData.Scan0;
- pointer = (byte*)(void*)Scan0;
- stride = bmData.Stride;
+ IntPtr scan0 = BmData.Scan0;
+ Pointer = (byte*)(void*)scan0;
+ Stride = BmData.Stride;
}
}
@@ -611,9 +614,9 @@ namespace GreenshotPlugin.Core {
/// Unlock the System Memory
///
public void Unlock() {
- if (bitsLocked) {
- bitmap.UnlockBits(bmData);
- bitsLocked = false;
+ if (BitsLocked) {
+ Bitmap.UnlockBits(BmData);
+ BitsLocked = false;
}
}
@@ -623,7 +626,7 @@ namespace GreenshotPlugin.Core {
///
///
public void DrawTo(Graphics graphics, Point destination) {
- DrawTo(graphics, new Rectangle(destination, area.Size));
+ DrawTo(graphics, new Rectangle(destination, Area.Size));
}
///
@@ -635,12 +638,12 @@ namespace GreenshotPlugin.Core {
///
public void DrawTo(Graphics graphics, Rectangle destinationRect) {
// Make sure this.bitmap is unlocked, if it was locked
- bool isLocked = bitsLocked;
+ bool isLocked = BitsLocked;
if (isLocked) {
Unlock();
}
- graphics.DrawImage(bitmap, destinationRect, area, GraphicsUnit.Pixel);
+ graphics.DrawImage(Bitmap, destinationRect, Area, GraphicsUnit.Pixel);
}
///
@@ -650,7 +653,7 @@ namespace GreenshotPlugin.Core {
///
/// true if x & y are inside the FastBitmap
public bool Contains(int x, int y) {
- return area.Contains(x - Left, y - Top);
+ return Area.Contains(x - Left, y - Top);
}
public abstract Color GetColorAt(int x, int y);
@@ -693,29 +696,29 @@ namespace GreenshotPlugin.Core {
///
/// true if x & y are inside the FastBitmap
bool IFastBitmapWithOffset.Contains(int x, int y) {
- return area.Contains(x - Left, y - Top);
+ return Area.Contains(x - Left, y - Top);
}
Color IFastBitmapWithOffset.GetColorAt(int x, int y) {
- x -= left;
- y -= top;
+ x -= _left;
+ y -= _top;
return GetColorAt(x, y);
}
void IFastBitmapWithOffset.GetColorAt(int x, int y, byte[] color) {
- x -= left;
- y -= top;
+ x -= _left;
+ y -= _top;
GetColorAt(x, y, color);
}
void IFastBitmapWithOffset.SetColorAt(int x, int y, byte[] color) {
- x -= left;
- y -= top;
+ x -= _left;
+ y -= _top;
SetColorAt(x, y, color);
}
void IFastBitmapWithOffset.SetColorAt(int x, int y, Color color) {
- x -= left;
- y -= top;
+ x -= _left;
+ y -= _top;
SetColorAt(x, y, color);
}
#endregion
@@ -726,11 +729,11 @@ namespace GreenshotPlugin.Core {
///
public unsafe class FastChunkyBitmap : FastBitmap {
// Used for indexed images
- private readonly Color[] colorEntries;
- private readonly Dictionary colorCache = new Dictionary();
+ private readonly Color[] _colorEntries;
+ private readonly Dictionary _colorCache = new Dictionary();
public FastChunkyBitmap(Bitmap source, Rectangle area) : base(source, area) {
- colorEntries = bitmap.Palette.Entries;
+ _colorEntries = Bitmap.Palette.Entries;
}
///
@@ -740,9 +743,9 @@ namespace GreenshotPlugin.Core {
///
/// Color
public override Color GetColorAt(int x, int y) {
- int offset = x + (y * stride);
- byte colorIndex = pointer[offset];
- return colorEntries[colorIndex];
+ int offset = x + (y * Stride);
+ byte colorIndex = Pointer[offset];
+ return _colorEntries[colorIndex];
}
///
@@ -772,8 +775,8 @@ namespace GreenshotPlugin.Core {
///
/// byte with index
public byte GetColorIndexAt(int x, int y) {
- int offset = x + (y * stride);
- return pointer[offset];
+ int offset = x + (y * Stride);
+ return Pointer[offset];
}
///
@@ -781,10 +784,10 @@ namespace GreenshotPlugin.Core {
///
///
///
- ///
+ ///
public void SetColorIndexAt(int x, int y, byte colorIndex) {
- int offset = x + (y * stride);
- pointer[offset] = colorIndex;
+ int offset = x + (y * Stride);
+ Pointer[offset] = colorIndex;
}
///
@@ -795,13 +798,13 @@ namespace GreenshotPlugin.Core {
///
/// Color to set
public override void SetColorAt(int x, int y, Color color) {
- int offset = x + (y * stride);
+ int offset = x + (y * Stride);
byte colorIndex;
- if (!colorCache.TryGetValue(color, out colorIndex)) {
+ if (!_colorCache.TryGetValue(color, out colorIndex)) {
bool foundColor = false;
- for (colorIndex = 0; colorIndex < colorEntries.Length; colorIndex++) {
- if (color == colorEntries[colorIndex]) {
- colorCache.Add(color, colorIndex);
+ for (colorIndex = 0; colorIndex < _colorEntries.Length; colorIndex++) {
+ if (color == _colorEntries[colorIndex]) {
+ _colorCache.Add(color, colorIndex);
foundColor = true;
break;
}
@@ -810,16 +813,16 @@ namespace GreenshotPlugin.Core {
throw new ArgumentException("No such color!");
}
}
- pointer[offset] = colorIndex;
+ Pointer[offset] = colorIndex;
}
}
///
/// This is the implementation of the IFastBitmap for 24 bit images (no Alpha)
///
- public unsafe class Fast24RGBBitmap : FastBitmap {
+ public unsafe class Fast24RgbBitmap : FastBitmap {
- public Fast24RGBBitmap(Bitmap source, Rectangle area) : base(source, area) {
+ public Fast24RgbBitmap(Bitmap source, Rectangle area) : base(source, area) {
}
///
@@ -830,8 +833,8 @@ namespace GreenshotPlugin.Core {
/// Y Coordinate
/// Color
public override Color GetColorAt(int x, int y) {
- int offset = (x * 3) + (y * stride);
- return Color.FromArgb(255, pointer[PIXELFORMAT_INDEX_R + offset], pointer[PIXELFORMAT_INDEX_G + offset], pointer[PIXELFORMAT_INDEX_B + offset]);
+ int offset = (x * 3) + (y * Stride);
+ return Color.FromArgb(255, Pointer[PixelformatIndexR + offset], Pointer[PixelformatIndexG + offset], Pointer[PixelformatIndexB + offset]);
}
///
@@ -842,10 +845,10 @@ namespace GreenshotPlugin.Core {
///
///
public override void SetColorAt(int x, int y, Color color) {
- int offset = (x * 3) + (y * stride);
- pointer[PIXELFORMAT_INDEX_R + offset] = color.R;
- pointer[PIXELFORMAT_INDEX_G + offset] = color.G;
- pointer[PIXELFORMAT_INDEX_B + offset] = color.B;
+ int offset = (x * 3) + (y * Stride);
+ Pointer[PixelformatIndexR + offset] = color.R;
+ Pointer[PixelformatIndexG + offset] = color.G;
+ Pointer[PixelformatIndexB + offset] = color.B;
}
///
@@ -855,10 +858,10 @@ namespace GreenshotPlugin.Core {
///
/// byte[4] as reference (r,g,b)
public override void GetColorAt(int x, int y, byte[] color) {
- int offset = (x * 3) + (y * stride);
- color[PIXELFORMAT_INDEX_R] = pointer[PIXELFORMAT_INDEX_R + offset];
- color[PIXELFORMAT_INDEX_G] = pointer[PIXELFORMAT_INDEX_G + offset];
- color[PIXELFORMAT_INDEX_B] = pointer[PIXELFORMAT_INDEX_B + offset];
+ int offset = (x * 3) + (y * Stride);
+ color[PixelformatIndexR] = Pointer[PixelformatIndexR + offset];
+ color[PixelformatIndexG] = Pointer[PixelformatIndexG + offset];
+ color[PixelformatIndexB] = Pointer[PixelformatIndexB + offset];
}
///
@@ -868,10 +871,10 @@ namespace GreenshotPlugin.Core {
///
/// byte[4] as reference (r,g,b)
public override void SetColorAt(int x, int y, byte[] color) {
- int offset = (x * 3) + (y * stride);
- pointer[PIXELFORMAT_INDEX_R + offset] = color[PIXELFORMAT_INDEX_R];
- pointer[PIXELFORMAT_INDEX_G + offset] = color[PIXELFORMAT_INDEX_G];
- pointer[PIXELFORMAT_INDEX_B + offset] = color[PIXELFORMAT_INDEX_B];
+ int offset = (x * 3) + (y * Stride);
+ Pointer[PixelformatIndexR + offset] = color[PixelformatIndexR];
+ Pointer[PixelformatIndexG + offset] = color[PixelformatIndexG];
+ Pointer[PixelformatIndexB + offset] = color[PixelformatIndexB];
}
}
@@ -879,8 +882,8 @@ namespace GreenshotPlugin.Core {
///
/// This is the implementation of the IFastBitmap for 32 bit images (no Alpha)
///
- public unsafe class Fast32RGBBitmap : FastBitmap {
- public Fast32RGBBitmap(Bitmap source, Rectangle area) : base(source, area) {
+ public unsafe class Fast32RgbBitmap : FastBitmap {
+ public Fast32RgbBitmap(Bitmap source, Rectangle area) : base(source, area) {
}
@@ -892,8 +895,8 @@ namespace GreenshotPlugin.Core {
/// Y Coordinate
/// Color
public override Color GetColorAt(int x, int y) {
- int offset = (x * 4) + (y * stride);
- return Color.FromArgb(255, pointer[PIXELFORMAT_INDEX_R + offset], pointer[PIXELFORMAT_INDEX_G + offset], pointer[PIXELFORMAT_INDEX_B + offset]);
+ int offset = (x * 4) + (y * Stride);
+ return Color.FromArgb(255, Pointer[PixelformatIndexR + offset], Pointer[PixelformatIndexG + offset], Pointer[PixelformatIndexB + offset]);
}
///
@@ -904,10 +907,10 @@ namespace GreenshotPlugin.Core {
///
///
public override void SetColorAt(int x, int y, Color color) {
- int offset = (x * 4) + (y * stride);
- pointer[PIXELFORMAT_INDEX_R + offset] = color.R;
- pointer[PIXELFORMAT_INDEX_G + offset] = color.G;
- pointer[PIXELFORMAT_INDEX_B + offset] = color.B;
+ int offset = (x * 4) + (y * Stride);
+ Pointer[PixelformatIndexR + offset] = color.R;
+ Pointer[PixelformatIndexG + offset] = color.G;
+ Pointer[PixelformatIndexB + offset] = color.B;
}
///
@@ -917,10 +920,10 @@ namespace GreenshotPlugin.Core {
///
/// byte[4] as reference (a,r,g,b)
public override void GetColorAt(int x, int y, byte[] color) {
- int offset = (x * 4) + (y * stride);
- color[COLOR_INDEX_R] = pointer[PIXELFORMAT_INDEX_R + offset];
- color[COLOR_INDEX_G] = pointer[PIXELFORMAT_INDEX_G + offset];
- color[COLOR_INDEX_B] = pointer[PIXELFORMAT_INDEX_B + offset];
+ int offset = (x * 4) + (y * Stride);
+ color[ColorIndexR] = Pointer[PixelformatIndexR + offset];
+ color[ColorIndexG] = Pointer[PixelformatIndexG + offset];
+ color[ColorIndexB] = Pointer[PixelformatIndexB + offset];
}
///
@@ -930,18 +933,18 @@ namespace GreenshotPlugin.Core {
///
/// byte[4] as reference (r,g,b)
public override void SetColorAt(int x, int y, byte[] color) {
- int offset = (x * 4) + (y * stride);
- pointer[PIXELFORMAT_INDEX_R + offset] = color[COLOR_INDEX_R]; // R
- pointer[PIXELFORMAT_INDEX_G + offset] = color[COLOR_INDEX_G];
- pointer[PIXELFORMAT_INDEX_B + offset] = color[COLOR_INDEX_B];
+ int offset = (x * 4) + (y * Stride);
+ Pointer[PixelformatIndexR + offset] = color[ColorIndexR]; // R
+ Pointer[PixelformatIndexG + offset] = color[ColorIndexG];
+ Pointer[PixelformatIndexB + offset] = color[ColorIndexB];
}
}
///
/// This is the implementation of the IFastBitmap for 32 bit images with Alpha
///
- public unsafe class Fast32ARGBBitmap : FastBitmap, IFastBitmapWithBlend {
- public override bool hasAlphaChannel {
+ public unsafe class Fast32ArgbBitmap : FastBitmap, IFastBitmapWithBlend {
+ public override bool HasAlphaChannel {
get {
return true;
}
@@ -951,7 +954,7 @@ namespace GreenshotPlugin.Core {
get;
set;
}
- public Fast32ARGBBitmap(Bitmap source, Rectangle area) : base(source, area) {
+ public Fast32ArgbBitmap(Bitmap source, Rectangle area) : base(source, area) {
BackgroundBlendColor = Color.White;
}
@@ -962,8 +965,8 @@ namespace GreenshotPlugin.Core {
/// Y Coordinate
/// Color
public override Color GetColorAt(int x, int y) {
- int offset = (x * 4) + (y * stride);
- return Color.FromArgb(pointer[PIXELFORMAT_INDEX_A + offset], pointer[PIXELFORMAT_INDEX_R + offset], pointer[PIXELFORMAT_INDEX_G + offset], pointer[PIXELFORMAT_INDEX_B + offset]);
+ int offset = (x * 4) + (y * Stride);
+ return Color.FromArgb(Pointer[PixelformatIndexA + offset], Pointer[PixelformatIndexR + offset], Pointer[PixelformatIndexG + offset], Pointer[PixelformatIndexB + offset]);
}
///
@@ -974,11 +977,11 @@ namespace GreenshotPlugin.Core {
///
///
public override void SetColorAt(int x, int y, Color color) {
- int offset = (x * 4) + (y * stride);
- pointer[PIXELFORMAT_INDEX_A + offset] = color.A;
- pointer[PIXELFORMAT_INDEX_R + offset] = color.R;
- pointer[PIXELFORMAT_INDEX_G + offset] = color.G;
- pointer[PIXELFORMAT_INDEX_B + offset] = color.B;
+ int offset = (x * 4) + (y * Stride);
+ Pointer[PixelformatIndexA + offset] = color.A;
+ Pointer[PixelformatIndexR + offset] = color.R;
+ Pointer[PixelformatIndexG + offset] = color.G;
+ Pointer[PixelformatIndexB + offset] = color.B;
}
///
@@ -988,11 +991,11 @@ namespace GreenshotPlugin.Core {
///
/// byte[4] as reference (r,g,b,a)
public override void GetColorAt(int x, int y, byte[] color) {
- int offset = (x * 4) + (y * stride);
- color[COLOR_INDEX_R] = pointer[PIXELFORMAT_INDEX_R + offset];
- color[COLOR_INDEX_G] = pointer[PIXELFORMAT_INDEX_G + offset];
- color[COLOR_INDEX_B] = pointer[PIXELFORMAT_INDEX_B + offset];
- color[COLOR_INDEX_A] = pointer[PIXELFORMAT_INDEX_A + offset];
+ int offset = (x * 4) + (y * Stride);
+ color[ColorIndexR] = Pointer[PixelformatIndexR + offset];
+ color[ColorIndexG] = Pointer[PixelformatIndexG + offset];
+ color[ColorIndexB] = Pointer[PixelformatIndexB + offset];
+ color[ColorIndexA] = Pointer[PixelformatIndexA + offset];
}
///
@@ -1002,11 +1005,11 @@ namespace GreenshotPlugin.Core {
///
/// byte[4] as reference (r,g,b,a)
public override void SetColorAt(int x, int y, byte[] color) {
- int offset = (x * 4) + (y * stride);
- pointer[PIXELFORMAT_INDEX_R + offset] = color[COLOR_INDEX_R]; // R
- pointer[PIXELFORMAT_INDEX_G + offset] = color[COLOR_INDEX_G];
- pointer[PIXELFORMAT_INDEX_B + offset] = color[COLOR_INDEX_B];
- pointer[PIXELFORMAT_INDEX_A + offset] = color[COLOR_INDEX_A];
+ int offset = (x * 4) + (y * Stride);
+ Pointer[PixelformatIndexR + offset] = color[ColorIndexR]; // R
+ Pointer[PixelformatIndexG + offset] = color[ColorIndexG];
+ Pointer[PixelformatIndexB + offset] = color[ColorIndexB];
+ Pointer[PixelformatIndexA + offset] = color[ColorIndexA];
}
///
@@ -1017,11 +1020,11 @@ namespace GreenshotPlugin.Core {
/// Y Coordinate
/// Color
public Color GetBlendedColorAt(int x, int y) {
- int offset = (x * 4) + (y * stride);
- int a = pointer[PIXELFORMAT_INDEX_A + offset];
- int red = pointer[PIXELFORMAT_INDEX_R + offset];
- int green = pointer[PIXELFORMAT_INDEX_G + offset];
- int blue = pointer[PIXELFORMAT_INDEX_B + offset];
+ int offset = (x * 4) + (y * Stride);
+ int a = Pointer[PixelformatIndexA + offset];
+ int red = Pointer[PixelformatIndexR + offset];
+ int green = Pointer[PixelformatIndexG + offset];
+ int blue = Pointer[PixelformatIndexB + offset];
if (a < 255) {
// As the request is to get without alpha, we blend.
diff --git a/GreenshotPlugin/Core/FilenameHelper.cs b/GreenshotPlugin/Core/FilenameHelper.cs
index f3c5af085..d927178f9 100644
--- a/GreenshotPlugin/Core/FilenameHelper.cs
+++ b/GreenshotPlugin/Core/FilenameHelper.cs
@@ -48,7 +48,7 @@ namespace GreenshotPlugin.Core {
///
/// Remove invalid characters from the fully qualified filename
///
- /// string with the full path to a file
+ /// string with the full path to a file
/// string with the full path to a file, without invalid characters
public static string MakeFQFilenameSafe(string fullPath) {
string path = MakePathSafe(Path.GetDirectoryName(fullPath));
@@ -60,7 +60,7 @@ namespace GreenshotPlugin.Core {
///
/// Remove invalid characters from the filename
///
- /// string with the full path to a file
+ /// string with the full path to a file
/// string with the full path to a file, without invalid characters
public static string MakeFilenameSafe(string filename) {
// Make the filename save!
@@ -121,6 +121,7 @@ namespace GreenshotPlugin.Core {
///
/// This method will be called by the regexp.replace as a MatchEvaluator delegate!
/// Will delegate this to the MatchVarEvaluatorInternal and catch any exceptions
+ ///
/// What are we matching?
/// The detail, can be null
/// Variables from the process
@@ -141,6 +142,10 @@ namespace GreenshotPlugin.Core {
///
/// What are we matching?
/// The detail, can be null
+ ///
+ ///
+ ///
+ ///
///
private static string MatchVarEvaluatorInternal(Match match, ICaptureDetails captureDetails, IDictionary processVars, IDictionary userVars, IDictionary machineVars, bool filenameSafeMode) {
// some defaults
diff --git a/GreenshotPlugin/Core/ImageHelper.cs b/GreenshotPlugin/Core/ImageHelper.cs
index 1219fe1a5..ae402090c 100644
--- a/GreenshotPlugin/Core/ImageHelper.cs
+++ b/GreenshotPlugin/Core/ImageHelper.cs
@@ -356,7 +356,6 @@ namespace GreenshotPlugin.Core {
///
/// See: http://msdn.microsoft.com/en-us/library/windows/desktop/ms648069%28v=vs.85%29.aspx
///
- /// The icon to
/// The file (EXE or DLL) to get the icon from
/// Index of the icon
/// true if the large icon is wanted
@@ -409,8 +408,7 @@ namespace GreenshotPlugin.Core {
///
/// Bitmap
public static Image ApplyEffect(Image sourceImage, IEffect effect, Matrix matrix) {
- List effects = new List();
- effects.Add(effect);
+ List effects = new List {effect};
return ApplyEffects(sourceImage, effects, matrix);
}
@@ -418,7 +416,7 @@ namespace GreenshotPlugin.Core {
/// Apply the effects in the supplied order to the bitmap
///
/// Bitmap
- /// List
+ /// List of IEffect
///
/// Bitmap
public static Image ApplyEffects(Image sourceImage, List effects, Matrix matrix) {
@@ -577,7 +575,7 @@ namespace GreenshotPlugin.Core {
// By the central limit theorem, if applied 3 times on the same image, a box blur approximates the Gaussian kernel to within about 3%, yielding the same result as a quadratic convolution kernel.
// This might be true, but the GDI+ BlurEffect doesn't look the same, a 2x blur is more simular and we only make 2x Box-Blur.
// (Might also be a mistake in our blur, but for now it looks great)
- if (fastBitmap.hasAlphaChannel) {
+ if (fastBitmap.HasAlphaChannel) {
BoxBlurHorizontalAlpha(fastBitmap, range);
BoxBlurVerticalAlpha(fastBitmap, range);
BoxBlurHorizontalAlpha(fastBitmap, range);
@@ -596,7 +594,7 @@ namespace GreenshotPlugin.Core {
/// Target BitmapBuffer
/// Range must be odd!
private static void BoxBlurHorizontal(IFastBitmap targetFastBitmap, int range) {
- if (targetFastBitmap.hasAlphaChannel) {
+ if (targetFastBitmap.HasAlphaChannel) {
throw new NotSupportedException("BoxBlurHorizontal should NOT be called for bitmaps with alpha channel");
}
int halfRange = range / 2;
@@ -611,18 +609,18 @@ namespace GreenshotPlugin.Core {
int oldPixel = x - halfRange - 1;
if (oldPixel >= targetFastBitmap.Left) {
targetFastBitmap.GetColorAt(oldPixel, y, tmpColor);
- r -= tmpColor[FastBitmap.COLOR_INDEX_R];
- g -= tmpColor[FastBitmap.COLOR_INDEX_G];
- b -= tmpColor[FastBitmap.COLOR_INDEX_B];
+ r -= tmpColor[FastBitmap.ColorIndexR];
+ g -= tmpColor[FastBitmap.ColorIndexG];
+ b -= tmpColor[FastBitmap.ColorIndexB];
hits--;
}
int newPixel = x + halfRange;
if (newPixel < targetFastBitmap.Right) {
targetFastBitmap.GetColorAt(newPixel, y, tmpColor);
- r += tmpColor[FastBitmap.COLOR_INDEX_R];
- g += tmpColor[FastBitmap.COLOR_INDEX_G];
- b += tmpColor[FastBitmap.COLOR_INDEX_B];
+ r += tmpColor[FastBitmap.ColorIndexR];
+ g += tmpColor[FastBitmap.ColorIndexG];
+ b += tmpColor[FastBitmap.ColorIndexB];
hits++;
}
@@ -641,7 +639,7 @@ namespace GreenshotPlugin.Core {
/// Target BitmapBuffer
/// Range must be odd!
private static void BoxBlurHorizontalAlpha(IFastBitmap targetFastBitmap, int range) {
- if (!targetFastBitmap.hasAlphaChannel) {
+ if (!targetFastBitmap.HasAlphaChannel) {
throw new NotSupportedException("BoxBlurHorizontalAlpha should be called for bitmaps with alpha channel");
}
int halfRange = range / 2;
@@ -657,20 +655,20 @@ namespace GreenshotPlugin.Core {
int oldPixel = x - halfRange - 1;
if (oldPixel >= targetFastBitmap.Left) {
targetFastBitmap.GetColorAt(oldPixel, y, tmpColor);
- a -= tmpColor[FastBitmap.COLOR_INDEX_A];
- r -= tmpColor[FastBitmap.COLOR_INDEX_R];
- g -= tmpColor[FastBitmap.COLOR_INDEX_G];
- b -= tmpColor[FastBitmap.COLOR_INDEX_B];
+ a -= tmpColor[FastBitmap.ColorIndexA];
+ r -= tmpColor[FastBitmap.ColorIndexR];
+ g -= tmpColor[FastBitmap.ColorIndexG];
+ b -= tmpColor[FastBitmap.ColorIndexB];
hits--;
}
int newPixel = x + halfRange;
if (newPixel < targetFastBitmap.Right) {
targetFastBitmap.GetColorAt(newPixel, y, tmpColor);
- a += tmpColor[FastBitmap.COLOR_INDEX_A];
- r += tmpColor[FastBitmap.COLOR_INDEX_R];
- g += tmpColor[FastBitmap.COLOR_INDEX_G];
- b += tmpColor[FastBitmap.COLOR_INDEX_B];
+ a += tmpColor[FastBitmap.ColorIndexA];
+ r += tmpColor[FastBitmap.ColorIndexR];
+ g += tmpColor[FastBitmap.ColorIndexG];
+ b += tmpColor[FastBitmap.ColorIndexB];
hits++;
}
@@ -690,7 +688,7 @@ namespace GreenshotPlugin.Core {
/// BitmapBuffer which previously was created with BoxBlurHorizontal
/// Range must be odd!
private static void BoxBlurVertical(IFastBitmap targetFastBitmap, int range) {
- if (targetFastBitmap.hasAlphaChannel) {
+ if (targetFastBitmap.HasAlphaChannel) {
throw new NotSupportedException("BoxBlurVertical should NOT be called for bitmaps with alpha channel");
}
int halfRange = range / 2;
@@ -705,18 +703,18 @@ namespace GreenshotPlugin.Core {
int oldPixel = y - halfRange - 1;
if (oldPixel >= targetFastBitmap.Top) {
targetFastBitmap.GetColorAt(x, oldPixel, tmpColor);
- r -= tmpColor[FastBitmap.COLOR_INDEX_R];
- g -= tmpColor[FastBitmap.COLOR_INDEX_G];
- b -= tmpColor[FastBitmap.COLOR_INDEX_B];
+ r -= tmpColor[FastBitmap.ColorIndexR];
+ g -= tmpColor[FastBitmap.ColorIndexG];
+ b -= tmpColor[FastBitmap.ColorIndexB];
hits--;
}
int newPixel = y + halfRange;
if (newPixel < targetFastBitmap.Bottom) {
targetFastBitmap.GetColorAt(x, newPixel, tmpColor);
- r += tmpColor[FastBitmap.COLOR_INDEX_R];
- g += tmpColor[FastBitmap.COLOR_INDEX_G];
- b += tmpColor[FastBitmap.COLOR_INDEX_B];
+ r += tmpColor[FastBitmap.ColorIndexR];
+ g += tmpColor[FastBitmap.ColorIndexG];
+ b += tmpColor[FastBitmap.ColorIndexB];
hits++;
}
@@ -737,7 +735,7 @@ namespace GreenshotPlugin.Core {
/// BitmapBuffer which previously was created with BoxBlurHorizontal
/// Range must be odd!
private static void BoxBlurVerticalAlpha(IFastBitmap targetFastBitmap, int range) {
- if (!targetFastBitmap.hasAlphaChannel) {
+ if (!targetFastBitmap.HasAlphaChannel) {
throw new NotSupportedException("BoxBlurVerticalAlpha should be called for bitmaps with alpha channel");
}
@@ -754,10 +752,10 @@ namespace GreenshotPlugin.Core {
int oldPixel = y - halfRange - 1;
if (oldPixel >= targetFastBitmap.Top) {
targetFastBitmap.GetColorAt(x, oldPixel, tmpColor);
- a -= tmpColor[FastBitmap.COLOR_INDEX_A];
- r -= tmpColor[FastBitmap.COLOR_INDEX_R];
- g -= tmpColor[FastBitmap.COLOR_INDEX_G];
- b -= tmpColor[FastBitmap.COLOR_INDEX_B];
+ a -= tmpColor[FastBitmap.ColorIndexA];
+ r -= tmpColor[FastBitmap.ColorIndexR];
+ g -= tmpColor[FastBitmap.ColorIndexG];
+ b -= tmpColor[FastBitmap.ColorIndexB];
hits--;
}
@@ -765,10 +763,10 @@ namespace GreenshotPlugin.Core {
if (newPixel < targetFastBitmap.Bottom) {
//int colorg = pixels[index + newPixelOffset];
targetFastBitmap.GetColorAt(x, newPixel, tmpColor);
- a += tmpColor[FastBitmap.COLOR_INDEX_A];
- r += tmpColor[FastBitmap.COLOR_INDEX_R];
- g += tmpColor[FastBitmap.COLOR_INDEX_G];
- b += tmpColor[FastBitmap.COLOR_INDEX_B];
+ a += tmpColor[FastBitmap.ColorIndexA];
+ r += tmpColor[FastBitmap.ColorIndexR];
+ g += tmpColor[FastBitmap.ColorIndexG];
+ b += tmpColor[FastBitmap.ColorIndexB];
hits++;
}
diff --git a/GreenshotPlugin/Core/Language.cs b/GreenshotPlugin/Core/Language.cs
index 501782029..18d718620 100644
--- a/GreenshotPlugin/Core/Language.cs
+++ b/GreenshotPlugin/Core/Language.cs
@@ -474,7 +474,7 @@ namespace GreenshotPlugin.Core {
if (key == null) {
return false;
}
- return hasKey(prefix + "." + key.ToString());
+ return hasKey(prefix + "." + key);
}
///
@@ -534,7 +534,7 @@ namespace GreenshotPlugin.Core {
public static string Translate(object key) {
string typename = key.GetType().Name;
- string enumKey = typename + "." + key.ToString();
+ string enumKey = typename + "." + key;
if (hasKey(enumKey)) {
return GetString(enumKey);
}
@@ -563,7 +563,7 @@ namespace GreenshotPlugin.Core {
if (key == null) {
return null;
}
- return GetString(prefix + "." + key.ToString());
+ return GetString(prefix + "." + key);
}
///
@@ -596,6 +596,7 @@ namespace GreenshotPlugin.Core {
/// Get the resource for key, format with with string.format an supply the parameters
///
///
+ ///
/// formatted resource or a "string ###key### not found"
public static string GetFormattedString(Enum key, object param) {
return GetFormattedString(key.ToString(), param);
@@ -604,7 +605,9 @@ namespace GreenshotPlugin.Core {
///
/// Get the resource for prefix.key, format with with string.format an supply the parameters
///
+ ///
///
+ ///
/// formatted resource or a "string ###prefix.key### not found"
public static string GetFormattedString(string prefix, Enum key, object param) {
return GetFormattedString(prefix, key.ToString(), param);
@@ -613,7 +616,9 @@ namespace GreenshotPlugin.Core {
///
/// Get the resource for prefix.key, format with with string.format an supply the parameters
///
+ ///
///
+ ///
/// formatted resource or a "string ###prefix.key### not found"
public static string GetFormattedString(string prefix, string key, object param) {
return GetFormattedString(prefix + "." + key, param);
@@ -623,6 +628,7 @@ namespace GreenshotPlugin.Core {
/// Get the resource for key, format with with string.format an supply the parameters
///
///
+ ///
/// formatted resource or a "string ###key### not found"
public static string GetFormattedString(string key, object param) {
string returnValue;
diff --git a/GreenshotPlugin/Core/OAuthHelper.cs b/GreenshotPlugin/Core/OAuthHelper.cs
index 4112aae86..ad8241009 100644
--- a/GreenshotPlugin/Core/OAuthHelper.cs
+++ b/GreenshotPlugin/Core/OAuthHelper.cs
@@ -709,20 +709,20 @@ namespace GreenshotPlugin.Core {
/// And additionally a signature is added.
///
/// Method (POST,PUT,GET)
- /// Url to call
- /// IDictionary
- private void Sign(HTTPMethod method, string requestURL, IDictionary parameters) {
+ /// Url to call
+ /// IDictionary of string and string
+ private void Sign(HTTPMethod method, string requestUrl, IDictionary parameters) {
if (parameters == null) {
- throw new ArgumentNullException("parameters");
+ throw new ArgumentNullException(nameof(parameters));
}
// Build the signature base
StringBuilder signatureBase = new StringBuilder();
// Add Method to signature base
- signatureBase.Append(method.ToString()).Append("&");
+ signatureBase.Append(method).Append("&");
// Add normalized URL
- Uri url = new Uri(requestURL);
+ Uri url = new Uri(requestUrl);
string normalizedUrl = string.Format(CultureInfo.InvariantCulture, "{0}://{1}", url.Scheme, url.Host);
if (!((url.Scheme == "http" && url.Port == 80) || (url.Scheme == "https" && url.Port == 443))) {
normalizedUrl += ":" + url.Port;
@@ -747,7 +747,7 @@ namespace GreenshotPlugin.Core {
break;
}
parameters.Add(OAUTH_CONSUMER_KEY_KEY, _consumerKey);
- if (CallbackUrl != null && RequestTokenUrl != null && requestURL.StartsWith(RequestTokenUrl)) {
+ if (CallbackUrl != null && RequestTokenUrl != null && requestUrl.StartsWith(RequestTokenUrl)) {
parameters.Add(OAUTH_CALLBACK_KEY, CallbackUrl);
}
if (!string.IsNullOrEmpty(Verifier)) {
@@ -810,7 +810,7 @@ namespace GreenshotPlugin.Core {
/// Response from server
private string MakeRequest(HTTPMethod method, string requestURL, IDictionary headers, IDictionary parameters, IBinaryContainer postData) {
if (parameters == null) {
- throw new ArgumentNullException("parameters");
+ throw new ArgumentNullException(nameof(parameters));
}
IDictionary requestParameters;
// Add oAuth values as HTTP headers, if this is allowed
@@ -1085,7 +1085,6 @@ Greenshot received information from CloudServiceName. You can close this browser
///
/// Generate an OAuth 2 Token by using the supplied code
///
- /// Code to get the RefreshToken
/// OAuth2Settings to update with the information that was retrieved
public static void GenerateRefreshToken(OAuth2Settings settings) {
IDictionary data = new Dictionary();
diff --git a/GreenshotPlugin/Core/PluginUtils.cs b/GreenshotPlugin/Core/PluginUtils.cs
index 513c93c83..b946b37aa 100644
--- a/GreenshotPlugin/Core/PluginUtils.cs
+++ b/GreenshotPlugin/Core/PluginUtils.cs
@@ -156,6 +156,7 @@ namespace GreenshotPlugin.Core {
///
/// Helper method to add a MenuItem to the File MenuItem of an ImageEditor
///
+ ///
/// Image to display in the menu
/// Text to display in the menu
/// The TAG value
@@ -215,8 +216,8 @@ namespace GreenshotPlugin.Core {
///
/// Helper method to add a plugin MenuItem to the Greenshot context menu
///
- ///
- ///
+ /// IGreenshotHost
+ /// ToolStripMenuItem
public static void AddToContextMenu(IGreenshotHost host, ToolStripMenuItem item) {
// Here we can hang ourselves to the main context menu!
ContextMenuStrip contextMenu = host.MainMenu;
diff --git a/GreenshotPlugin/Core/QuantizerHelper.cs b/GreenshotPlugin/Core/QuantizerHelper.cs
index d29f4412b..09fd91560 100644
--- a/GreenshotPlugin/Core/QuantizerHelper.cs
+++ b/GreenshotPlugin/Core/QuantizerHelper.cs
@@ -31,69 +31,69 @@ namespace GreenshotPlugin.Core {
/// Gets or sets the red minimum.
///
/// The red minimum.
- public Int32 RedMinimum { get; set; }
+ public int RedMinimum { get; set; }
///
/// Gets or sets the red maximum.
///
/// The red maximum.
- public Int32 RedMaximum { get; set; }
+ public int RedMaximum { get; set; }
///
/// Gets or sets the green minimum.
///
/// The green minimum.
- public Int32 GreenMinimum { get; set; }
+ public int GreenMinimum { get; set; }
///
/// Gets or sets the green maximum.
///
/// The green maximum.
- public Int32 GreenMaximum { get; set; }
+ public int GreenMaximum { get; set; }
///
/// Gets or sets the blue minimum.
///
/// The blue minimum.
- public Int32 BlueMinimum { get; set; }
+ public int BlueMinimum { get; set; }
///
/// Gets or sets the blue maximum.
///
/// The blue maximum.
- public Int32 BlueMaximum { get; set; }
+ public int BlueMaximum { get; set; }
///
/// Gets or sets the cube volume.
///
/// The volume.
- public Int32 Volume { get; set; }
+ public int Volume { get; set; }
}
public class WuQuantizer : IDisposable {
private static readonly ILog LOG = LogManager.GetLogger(typeof(WuQuantizer));
- private const Int32 MAXCOLOR = 512;
- private const Int32 RED = 2;
- private const Int32 GREEN = 1;
- private const Int32 BLUE = 0;
- private const Int32 SIDESIZE = 33;
- private const Int32 MAXSIDEINDEX = 32;
- private const Int32 MAXVOLUME = SIDESIZE * SIDESIZE * SIDESIZE;
+ private const int MAXCOLOR = 512;
+ private const int RED = 2;
+ private const int GREEN = 1;
+ private const int BLUE = 0;
+ private const int SIDESIZE = 33;
+ private const int MAXSIDEINDEX = 32;
+ private const int MAXVOLUME = SIDESIZE * SIDESIZE * SIDESIZE;
// To count the colors
private readonly int colorCount;
- private Int32[] reds;
- private Int32[] greens;
- private Int32[] blues;
- private Int32[] sums;
+ private int[] reds;
+ private int[] greens;
+ private int[] blues;
+ private int[] sums;
- private readonly Int64[, ,] weights;
- private readonly Int64[, ,] momentsRed;
- private readonly Int64[, ,] momentsGreen;
- private readonly Int64[, ,] momentsBlue;
- private readonly Single[, ,] moments;
+ private readonly long[,,] weights;
+ private readonly long[,,] momentsRed;
+ private readonly long[,,] momentsGreen;
+ private readonly long[,,] momentsBlue;
+ private readonly float[,,] moments;
private byte[] tag;
@@ -128,7 +128,7 @@ namespace GreenshotPlugin.Core {
cubes = new WuColorCube[MAXCOLOR];
// initializes all the cubes
- for (Int32 cubeIndex = 0; cubeIndex < MAXCOLOR; cubeIndex++) {
+ for (int cubeIndex = 0; cubeIndex < MAXCOLOR; cubeIndex++) {
cubes[cubeIndex] = new WuColorCube();
}
@@ -142,15 +142,15 @@ namespace GreenshotPlugin.Core {
cubes[0].GreenMaximum = MAXSIDEINDEX;
cubes[0].BlueMaximum = MAXSIDEINDEX;
- weights = new Int64[SIDESIZE, SIDESIZE, SIDESIZE];
- momentsRed = new Int64[SIDESIZE, SIDESIZE, SIDESIZE];
- momentsGreen = new Int64[SIDESIZE, SIDESIZE, SIDESIZE];
- momentsBlue = new Int64[SIDESIZE, SIDESIZE, SIDESIZE];
- moments = new Single[SIDESIZE, SIDESIZE, SIDESIZE];
+ weights = new long[SIDESIZE, SIDESIZE, SIDESIZE];
+ momentsRed = new long[SIDESIZE, SIDESIZE, SIDESIZE];
+ momentsGreen = new long[SIDESIZE, SIDESIZE, SIDESIZE];
+ momentsBlue = new long[SIDESIZE, SIDESIZE, SIDESIZE];
+ moments = new float[SIDESIZE, SIDESIZE, SIDESIZE];
- Int32[] table = new Int32[256];
+ int[] table = new int[256];
- for (Int32 tableIndex = 0; tableIndex < 256; ++tableIndex) {
+ for (int tableIndex = 0; tableIndex < 256; ++tableIndex) {
table[tableIndex] = tableIndex * tableIndex;
}
@@ -177,9 +177,9 @@ namespace GreenshotPlugin.Core {
bitArray.Set(index, true);
}
- Int32 indexRed = (color.R >> 3) + 1;
- Int32 indexGreen = (color.G >> 3) + 1;
- Int32 indexBlue = (color.B >> 3) + 1;
+ int indexRed = (color.R >> 3) + 1;
+ int indexGreen = (color.G >> 3) + 1;
+ int indexBlue = (color.B >> 3) + 1;
weights[indexRed, indexGreen, indexBlue]++;
momentsRed[indexRed, indexGreen, indexBlue] += color.R;
@@ -188,7 +188,7 @@ namespace GreenshotPlugin.Core {
moments[indexRed, indexGreen, indexBlue] += table[color.R] + table[color.G] + table[color.B];
// Store the initial "match"
- Int32 paletteIndex = (indexRed << 10) + (indexRed << 6) + indexRed + (indexGreen << 5) + indexGreen + indexBlue;
+ int paletteIndex = (indexRed << 10) + (indexRed << 6) + indexRed + (indexGreen << 5) + indexGreen + indexBlue;
destinationFastBitmap.SetColorIndexAt(x, y, (byte)(paletteIndex & 0xff));
}
}
@@ -200,7 +200,7 @@ namespace GreenshotPlugin.Core {
///
/// See for more details.
///
- public Int32 GetColorCount() {
+ public int GetColorCount() {
return colorCount;
}
@@ -242,7 +242,7 @@ namespace GreenshotPlugin.Core {
// generates palette
ColorPalette imagePalette = resultBitmap.Palette;
Color[] entries = imagePalette.Entries;
- for (Int32 paletteIndex = 0; paletteIndex < 256; paletteIndex++) {
+ for (int paletteIndex = 0; paletteIndex < 256; paletteIndex++) {
if (paletteIndex < colorCount) {
entries[paletteIndex] = colors[paletteIndex];
} else {
@@ -262,7 +262,7 @@ namespace GreenshotPlugin.Core {
///
public Bitmap GetQuantizedImage(int allowedColorCount) {
if (allowedColorCount > 256) {
- throw new ArgumentOutOfRangeException("Quantizing muss be done to get less than 256 colors");
+ throw new ArgumentOutOfRangeException(nameof(allowedColorCount), "Quantizing muss be done to get less than 256 colors");
}
if (colorCount < allowedColorCount) {
// Simple logic to reduce to 8 bit
@@ -272,11 +272,11 @@ namespace GreenshotPlugin.Core {
// preprocess the colors
CalculateMoments();
LOG.Info("Calculated the moments...");
- Int32 next = 0;
- Single[] volumeVariance = new Single[MAXCOLOR];
+ int next = 0;
+ float[] volumeVariance = new float[MAXCOLOR];
// processes the cubes
- for (Int32 cubeIndex = 1; cubeIndex < allowedColorCount; ++cubeIndex) {
+ for (int cubeIndex = 1; cubeIndex < allowedColorCount; ++cubeIndex) {
// if cut is possible; make it
if (Cut(cubes[next], cubes[cubeIndex])) {
volumeVariance[next] = cubes[next].Volume > 1 ? CalculateVariance(cubes[next]) : 0.0f;
@@ -288,9 +288,9 @@ namespace GreenshotPlugin.Core {
}
next = 0;
- Single temp = volumeVariance[0];
+ float temp = volumeVariance[0];
- for (Int32 index = 1; index <= cubeIndex; ++index) {
+ for (int index = 1; index <= cubeIndex; ++index) {
if (volumeVariance[index] > temp) {
temp = volumeVariance[index];
next = index;
@@ -303,9 +303,9 @@ namespace GreenshotPlugin.Core {
}
}
- Int32[] lookupRed = new Int32[MAXCOLOR];
- Int32[] lookupGreen = new Int32[MAXCOLOR];
- Int32[] lookupBlue = new Int32[MAXCOLOR];
+ int[] lookupRed = new int[MAXCOLOR];
+ int[] lookupGreen = new int[MAXCOLOR];
+ int[] lookupBlue = new int[MAXCOLOR];
tag = new byte[MAXVOLUME];
@@ -326,10 +326,10 @@ namespace GreenshotPlugin.Core {
}
}
- reds = new Int32[allowedColorCount + 1];
- greens = new Int32[allowedColorCount + 1];
- blues = new Int32[allowedColorCount + 1];
- sums = new Int32[allowedColorCount + 1];
+ reds = new int[allowedColorCount + 1];
+ greens = new int[allowedColorCount + 1];
+ blues = new int[allowedColorCount + 1];
+ sums = new int[allowedColorCount + 1];
LOG.Info("Starting bitmap reconstruction...");
@@ -356,16 +356,16 @@ namespace GreenshotPlugin.Core {
bestMatch = dest.GetColorIndexAt(x, y);
bestMatch = tag[bestMatch];
- Int32 bestDistance = 100000000;
+ int bestDistance = 100000000;
for (int lookupIndex = 0; lookupIndex < allowedColorCount; lookupIndex++) {
- Int32 foundRed = lookupRed[lookupIndex];
- Int32 foundGreen = lookupGreen[lookupIndex];
- Int32 foundBlue = lookupBlue[lookupIndex];
- Int32 deltaRed = color.R - foundRed;
- Int32 deltaGreen = color.G - foundGreen;
- Int32 deltaBlue = color.B - foundBlue;
+ int foundRed = lookupRed[lookupIndex];
+ int foundGreen = lookupGreen[lookupIndex];
+ int foundBlue = lookupBlue[lookupIndex];
+ int deltaRed = color.R - foundRed;
+ int deltaGreen = color.G - foundGreen;
+ int deltaBlue = color.B - foundBlue;
- Int32 distance = deltaRed * deltaRed + deltaGreen * deltaGreen + deltaBlue * deltaBlue;
+ int distance = deltaRed * deltaRed + deltaGreen * deltaGreen + deltaBlue * deltaBlue;
if (distance < bestDistance) {
bestDistance = distance;
@@ -393,7 +393,7 @@ namespace GreenshotPlugin.Core {
// generates palette
ColorPalette imagePalette = resultBitmap.Palette;
Color[] entries = imagePalette.Entries;
- for (Int32 paletteIndex = 0; paletteIndex < allowedColorCount; paletteIndex++) {
+ for (int paletteIndex = 0; paletteIndex < allowedColorCount; paletteIndex++) {
if (sums[paletteIndex] > 0) {
reds[paletteIndex] /= sums[paletteIndex];
greens[paletteIndex] /= sums[paletteIndex];
@@ -414,14 +414,14 @@ namespace GreenshotPlugin.Core {
/// Converts the histogram to a series of moments.
///
private void CalculateMoments() {
- Int64[] area = new Int64[SIDESIZE];
- Int64[] areaRed = new Int64[SIDESIZE];
- Int64[] areaGreen = new Int64[SIDESIZE];
- Int64[] areaBlue = new Int64[SIDESIZE];
- Single[] area2 = new Single[SIDESIZE];
+ long[] area = new long[SIDESIZE];
+ long[] areaRed = new long[SIDESIZE];
+ long[] areaGreen = new long[SIDESIZE];
+ long[] areaBlue = new long[SIDESIZE];
+ float[] area2 = new float[SIDESIZE];
- for (Int32 redIndex = 1; redIndex <= MAXSIDEINDEX; ++redIndex) {
- for (Int32 index = 0; index <= MAXSIDEINDEX; ++index) {
+ for (int redIndex = 1; redIndex <= MAXSIDEINDEX; ++redIndex) {
+ for (int index = 0; index <= MAXSIDEINDEX; ++index) {
area[index] = 0;
areaRed[index] = 0;
areaGreen[index] = 0;
@@ -429,14 +429,14 @@ namespace GreenshotPlugin.Core {
area2[index] = 0;
}
- for (Int32 greenIndex = 1; greenIndex <= MAXSIDEINDEX; ++greenIndex) {
- Int64 line = 0;
- Int64 lineRed = 0;
- Int64 lineGreen = 0;
- Int64 lineBlue = 0;
- Single line2 = 0.0f;
+ for (int greenIndex = 1; greenIndex <= MAXSIDEINDEX; ++greenIndex) {
+ long line = 0;
+ long lineRed = 0;
+ long lineGreen = 0;
+ long lineBlue = 0;
+ float line2 = 0.0f;
- for (Int32 blueIndex = 1; blueIndex <= MAXSIDEINDEX; ++blueIndex) {
+ for (int blueIndex = 1; blueIndex <= MAXSIDEINDEX; ++blueIndex) {
line += weights[redIndex, greenIndex, blueIndex];
lineRed += momentsRed[redIndex, greenIndex, blueIndex];
lineGreen += momentsGreen[redIndex, greenIndex, blueIndex];
@@ -462,7 +462,7 @@ namespace GreenshotPlugin.Core {
///
/// Computes the volume of the cube in a specific moment.
///
- private static Int64 Volume(WuColorCube cube, Int64[, ,] moment) {
+ private static long Volume(WuColorCube cube, long[,,] moment) {
return moment[cube.RedMaximum, cube.GreenMaximum, cube.BlueMaximum] -
moment[cube.RedMaximum, cube.GreenMaximum, cube.BlueMinimum] -
moment[cube.RedMaximum, cube.GreenMinimum, cube.BlueMaximum] +
@@ -476,7 +476,7 @@ namespace GreenshotPlugin.Core {
///
/// Computes the volume of the cube in a specific moment. For the floating-point values.
///
- private static Single VolumeFloat(WuColorCube cube, Single[, ,] moment) {
+ private static float VolumeFloat(WuColorCube cube, float[,,] moment) {
return moment[cube.RedMaximum, cube.GreenMaximum, cube.BlueMaximum] -
moment[cube.RedMaximum, cube.GreenMaximum, cube.BlueMinimum] -
moment[cube.RedMaximum, cube.GreenMinimum, cube.BlueMaximum] +
@@ -490,7 +490,7 @@ namespace GreenshotPlugin.Core {
///
/// Splits the cube in given position, and color direction.
///
- private static Int64 Top(WuColorCube cube, Int32 direction, Int32 position, Int64[, ,] moment) {
+ private static long Top(WuColorCube cube, int direction, int position, long[,,] moment) {
switch (direction) {
case RED:
return (moment[position, cube.GreenMaximum, cube.BlueMaximum] -
@@ -518,7 +518,7 @@ namespace GreenshotPlugin.Core {
///
/// Splits the cube in a given color direction at its minimum.
///
- private static Int64 Bottom(WuColorCube cube, Int32 direction, Int64[, ,] moment) {
+ private static long Bottom(WuColorCube cube, int direction, long[,,] moment) {
switch (direction) {
case RED:
return (-moment[cube.RedMinimum, cube.GreenMaximum, cube.BlueMaximum] +
@@ -545,14 +545,14 @@ namespace GreenshotPlugin.Core {
///
/// Calculates statistical variance for a given cube.
///
- private Single CalculateVariance(WuColorCube cube) {
- Single volumeRed = Volume(cube, momentsRed);
- Single volumeGreen = Volume(cube, momentsGreen);
- Single volumeBlue = Volume(cube, momentsBlue);
- Single volumeMoment = VolumeFloat(cube, moments);
- Single volumeWeight = Volume(cube, weights);
+ private float CalculateVariance(WuColorCube cube) {
+ float volumeRed = Volume(cube, momentsRed);
+ float volumeGreen = Volume(cube, momentsGreen);
+ float volumeBlue = Volume(cube, momentsBlue);
+ float volumeMoment = VolumeFloat(cube, moments);
+ float volumeWeight = Volume(cube, weights);
- Single distance = volumeRed * volumeRed + volumeGreen * volumeGreen + volumeBlue * volumeBlue;
+ float distance = volumeRed * volumeRed + volumeGreen * volumeGreen + volumeBlue * volumeBlue;
return volumeMoment - (distance / volumeWeight);
}
@@ -560,26 +560,26 @@ namespace GreenshotPlugin.Core {
///
/// Finds the optimal (maximal) position for the cut.
///
- private Single Maximize(WuColorCube cube, Int32 direction, Int32 first, Int32 last, Int32[] cut, Int64 wholeRed, Int64 wholeGreen, Int64 wholeBlue, Int64 wholeWeight) {
- Int64 bottomRed = Bottom(cube, direction, momentsRed);
- Int64 bottomGreen = Bottom(cube, direction, momentsGreen);
- Int64 bottomBlue = Bottom(cube, direction, momentsBlue);
- Int64 bottomWeight = Bottom(cube, direction, weights);
+ private float Maximize(WuColorCube cube, int direction, int first, int last, int[] cut, long wholeRed, long wholeGreen, long wholeBlue, long wholeWeight) {
+ long bottomRed = Bottom(cube, direction, momentsRed);
+ long bottomGreen = Bottom(cube, direction, momentsGreen);
+ long bottomBlue = Bottom(cube, direction, momentsBlue);
+ long bottomWeight = Bottom(cube, direction, weights);
- Single result = 0.0f;
+ float result = 0.0f;
cut[0] = -1;
- for (Int32 position = first; position < last; ++position) {
+ for (int position = first; position < last; ++position) {
// determines the cube cut at a certain position
- Int64 halfRed = bottomRed + Top(cube, direction, position, momentsRed);
- Int64 halfGreen = bottomGreen + Top(cube, direction, position, momentsGreen);
- Int64 halfBlue = bottomBlue + Top(cube, direction, position, momentsBlue);
- Int64 halfWeight = bottomWeight + Top(cube, direction, position, weights);
+ long halfRed = bottomRed + Top(cube, direction, position, momentsRed);
+ long halfGreen = bottomGreen + Top(cube, direction, position, momentsGreen);
+ long halfBlue = bottomBlue + Top(cube, direction, position, momentsBlue);
+ long halfWeight = bottomWeight + Top(cube, direction, position, weights);
// the cube cannot be cut at bottom (this would lead to empty cube)
if (halfWeight != 0) {
- Single halfDistance = (Single)halfRed * halfRed + (Single)halfGreen * halfGreen + (Single)halfBlue * halfBlue;
- Single temp = halfDistance / halfWeight;
+ float halfDistance = (float)halfRed * halfRed + (float)halfGreen * halfGreen + (float)halfBlue * halfBlue;
+ float temp = halfDistance / halfWeight;
halfRed = wholeRed - halfRed;
halfGreen = wholeGreen - halfGreen;
@@ -587,7 +587,7 @@ namespace GreenshotPlugin.Core {
halfWeight = wholeWeight - halfWeight;
if (halfWeight != 0) {
- halfDistance = (Single)halfRed * halfRed + (Single)halfGreen * halfGreen + (Single)halfBlue * halfBlue;
+ halfDistance = (float)halfRed * halfRed + (float)halfGreen * halfGreen + (float)halfBlue * halfBlue;
temp += halfDistance / halfWeight;
if (temp > result) {
@@ -604,21 +604,21 @@ namespace GreenshotPlugin.Core {
///
/// Cuts a cube with another one.
///
- private Boolean Cut(WuColorCube first, WuColorCube second) {
- Int32 direction;
+ private bool Cut(WuColorCube first, WuColorCube second) {
+ int direction;
- Int32[] cutRed = { 0 };
- Int32[] cutGreen = { 0 };
- Int32[] cutBlue = { 0 };
+ int[] cutRed = { 0 };
+ int[] cutGreen = { 0 };
+ int[] cutBlue = { 0 };
- Int64 wholeRed = Volume(first, momentsRed);
- Int64 wholeGreen = Volume(first, momentsGreen);
- Int64 wholeBlue = Volume(first, momentsBlue);
- Int64 wholeWeight = Volume(first, weights);
+ long wholeRed = Volume(first, momentsRed);
+ long wholeGreen = Volume(first, momentsGreen);
+ long wholeBlue = Volume(first, momentsBlue);
+ long wholeWeight = Volume(first, weights);
- Single maxRed = Maximize(first, RED, first.RedMinimum + 1, first.RedMaximum, cutRed, wholeRed, wholeGreen, wholeBlue, wholeWeight);
- Single maxGreen = Maximize(first, GREEN, first.GreenMinimum + 1, first.GreenMaximum, cutGreen, wholeRed, wholeGreen, wholeBlue, wholeWeight);
- Single maxBlue = Maximize(first, BLUE, first.BlueMinimum + 1, first.BlueMaximum, cutBlue, wholeRed, wholeGreen, wholeBlue, wholeWeight);
+ float maxRed = Maximize(first, RED, first.RedMinimum + 1, first.RedMaximum, cutRed, wholeRed, wholeGreen, wholeBlue, wholeWeight);
+ float maxGreen = Maximize(first, GREEN, first.GreenMinimum + 1, first.GreenMaximum, cutGreen, wholeRed, wholeGreen, wholeBlue, wholeWeight);
+ float maxBlue = Maximize(first, BLUE, first.BlueMinimum + 1, first.BlueMaximum, cutBlue, wholeRed, wholeGreen, wholeBlue, wholeWeight);
if ((maxRed >= maxGreen) && (maxRed >= maxBlue)) {
direction = RED;
@@ -669,10 +669,10 @@ namespace GreenshotPlugin.Core {
///
/// Marks all the tags with a given label.
///
- private void Mark(WuColorCube cube, Int32 label, byte[] tag) {
- for (Int32 redIndex = cube.RedMinimum + 1; redIndex <= cube.RedMaximum; ++redIndex) {
- for (Int32 greenIndex = cube.GreenMinimum + 1; greenIndex <= cube.GreenMaximum; ++greenIndex) {
- for (Int32 blueIndex = cube.BlueMinimum + 1; blueIndex <= cube.BlueMaximum; ++blueIndex) {
+ private void Mark(WuColorCube cube, int label, byte[] tag) {
+ for (int redIndex = cube.RedMinimum + 1; redIndex <= cube.RedMaximum; ++redIndex) {
+ for (int greenIndex = cube.GreenMinimum + 1; greenIndex <= cube.GreenMaximum; ++greenIndex) {
+ for (int blueIndex = cube.BlueMinimum + 1; blueIndex <= cube.BlueMaximum; ++blueIndex) {
tag[(redIndex << 10) + (redIndex << 6) + redIndex + (greenIndex << 5) + greenIndex + blueIndex] = (byte)label;
}
}
diff --git a/GreenshotPlugin/Core/WindowsHelper.cs b/GreenshotPlugin/Core/WindowsHelper.cs
index f6bd71e68..5a63b299c 100644
--- a/GreenshotPlugin/Core/WindowsHelper.cs
+++ b/GreenshotPlugin/Core/WindowsHelper.cs
@@ -26,7 +26,6 @@ using GreenshotPlugin.UnmanagedHelpers;
using log4net;
using System;
using System.Collections.Generic;
-using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
@@ -154,9 +153,8 @@ namespace GreenshotPlugin.Core {
/// Main code is taken from vbAccelerator, location:
/// http://www.vbaccelerator.com/home/NET/Code/Libraries/Windows/Enumerating_Windows/article.asp
/// but a LOT of changes/enhancements were made to adapt it for Greenshot.
- ///
- /// Provides details about a Window returned by the
- /// enumeration
+ ///
+ /// Provides details about a Window returned by the enumeration
///
public class WindowDetails : IEquatable{
private const string METRO_WINDOWS_CLASS = "Windows.UI.Core.CoreWindow"; // Windows 10 uses ApplicationFrameWindow
@@ -167,15 +165,21 @@ namespace GreenshotPlugin.Core {
private static readonly CoreConfiguration Conf = IniConfig.GetIniSection();
private static readonly List IgnoreHandles = new List();
private static readonly List ExcludeProcessesFromFreeze = new List();
- private static readonly IAppVisibility appVisibility;
+ private static readonly IAppVisibility AppVisibility;
static WindowDetails() {
- try {
+ try
+ {
// Only try to instantiate when Windows 8 or later.
- if (Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor >= 2) {
- appVisibility = COMWrapper.CreateInstance();
+ if (Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor >= 2)
+ {
+ AppVisibility = COMWrapper.CreateInstance();
}
- } catch {}
+ }
+ catch (Exception ex)
+ {
+ LOG.WarnFormat("Couldn't create instance of IAppVisibility: {0}", ex.Message);
+ }
}
public static void AddProcessToExcludeFromFreeze(string processname) {
@@ -529,7 +533,7 @@ namespace GreenshotPlugin.Core {
/// This method will find the child window according to a path of classnames.
/// Usually used for finding a certain "content" window like for the IE Browser
///
- /// List with classname "path"
+ /// List of string with classname "path"
/// true allows the search to skip a classname of the path
/// WindowDetails if found
public WindowDetails FindPath(List classnames, bool allowSkip) {
@@ -695,8 +699,8 @@ namespace GreenshotPlugin.Core {
RECT rect = new RECT(screen.Bounds);
IntPtr monitor = User32.MonitorFromRect(ref rect, User32.MONITOR_DEFAULTTONULL);
if (monitor != IntPtr.Zero) {
- if (appVisibility != null) {
- MONITOR_APP_VISIBILITY monitorAppVisibility = appVisibility.GetAppVisibilityOnMonitor(monitor);
+ if (AppVisibility != null) {
+ MONITOR_APP_VISIBILITY monitorAppVisibility = AppVisibility.GetAppVisibilityOnMonitor(monitor);
//LOG.DebugFormat("App {0} visible: {1} on {2}", Text, monitorAppVisibility, screen.Bounds);
if (monitorAppVisibility == MONITOR_APP_VISIBILITY.MAV_APP_VISIBLE) {
return true;
@@ -1395,7 +1399,7 @@ namespace GreenshotPlugin.Core {
Rectangle windowRect = WindowRectangle;
// Start the capture
Exception exceptionOccured = null;
- Image returnImage = null;
+ Image returnImage;
using (Region region = GetRegion()) {
PixelFormat pixelFormat = PixelFormat.Format24bppRgb;
// Only use 32 bpp ARGB when the window has a region
@@ -1446,7 +1450,7 @@ namespace GreenshotPlugin.Core {
///
/// The Window Handle
public WindowDetails(IntPtr hWnd) {
- this._hWnd = hWnd;
+ _hWnd = hWnd;
}
///
@@ -1455,7 +1459,7 @@ namespace GreenshotPlugin.Core {
/// WindowDetails of the current window
public static WindowDetails GetActiveWindow() {
IntPtr hWnd = User32.GetForegroundWindow();
- if (hWnd != null && hWnd != IntPtr.Zero) {
+ if (hWnd != IntPtr.Zero) {
if (IgnoreHandles.Contains(hWnd)) {
return GetDesktopWindow();
}
@@ -1499,7 +1503,7 @@ namespace GreenshotPlugin.Core {
///
/// Get all the top level windows
///
- /// List with all the top level windows
+ /// List of WindowDetails with all the top level windows
public static List GetAllWindows() {
return GetAllWindows(null);
}
@@ -1582,7 +1586,7 @@ namespace GreenshotPlugin.Core {
public static List GetMetroApps() {
List metroApps = new List();
// if the appVisibility != null we have Windows 8.
- if (appVisibility == null) {
+ if (AppVisibility == null) {
return metroApps;
}
//string[] wcs = {"ImmersiveGutter", "Snapped Desktop", "ImmersiveBackgroundWindow","ImmersiveLauncher","Windows.UI.Core.CoreWindow","ApplicationManager_ImmersiveShellWindow","SearchPane","MetroGhostWindow","EdgeUiInputWndClass", "NativeHWNDHost", "Shell_CharmWindow"};
@@ -1712,7 +1716,7 @@ namespace GreenshotPlugin.Core {
///
public static WindowDetails GetAppLauncher() {
// Only if Windows 8 (or higher)
- if (appVisibility == null) {
+ if (AppVisibility == null) {
return null;
}
IntPtr appLauncher = User32.FindWindow(METRO_APPLAUNCHER_CLASS, null);
@@ -1728,8 +1732,8 @@ namespace GreenshotPlugin.Core {
///
public static bool IsAppLauncherVisible {
get {
- if (appVisibility != null) {
- return appVisibility.IsLauncherVisible;
+ if (AppVisibility != null) {
+ return AppVisibility.IsLauncherVisible;
}
return false;
}
diff --git a/GreenshotPlugin/IniFile/IniConfig.cs b/GreenshotPlugin/IniFile/IniConfig.cs
index 027808087..2841faf61 100644
--- a/GreenshotPlugin/IniFile/IniConfig.cs
+++ b/GreenshotPlugin/IniFile/IniConfig.cs
@@ -89,11 +89,11 @@ namespace Greenshot.IniFile {
///
/// Initialize the ini config
///
- ///
+ ///
///
- public static void Init(string appName, string confName) {
+ public static void Init(string appName, string configName) {
applicationName = appName;
- configName = confName;
+ IniConfig.configName = configName;
Reload();
}
@@ -320,7 +320,7 @@ namespace Greenshot.IniFile {
///
///
public static IniSection GetIniSection(string sectionName) {
- IniSection returnValue = null;
+ IniSection returnValue;
sectionMap.TryGetValue(sectionName, out returnValue);
return returnValue;
}
@@ -369,11 +369,10 @@ namespace Greenshot.IniFile {
///
///
///
- public static Dictionary PropertiesForSection(IniSection section) {
- Type iniSectionType = section.GetType();
+ public static IDictionary PropertiesForSection(IniSection section) {
string sectionName = section.IniSectionAttribute.Name;
// Get the properties for the section
- Dictionary properties = null;
+ IDictionary properties;
if (sections.ContainsKey(sectionName)) {
properties = sections[sectionName];
} else {
diff --git a/GreenshotPlugin/IniFile/IniSection.cs b/GreenshotPlugin/IniFile/IniSection.cs
index 97982d172..0c5c1bbf6 100644
--- a/GreenshotPlugin/IniFile/IniSection.cs
+++ b/GreenshotPlugin/IniFile/IniSection.cs
@@ -120,7 +120,7 @@ namespace Greenshot.IniFile {
/// Fill the section with the supplied properties
///
///
- public void Fill(Dictionary properties) {
+ public void Fill(IDictionary properties) {
Type iniSectionType = GetType();
// Iterate over the members and create IniValueContainers
diff --git a/GreenshotPlugin/IniFile/IniValue.cs b/GreenshotPlugin/IniFile/IniValue.cs
index 0c0f44c3e..5be58f928 100644
--- a/GreenshotPlugin/IniFile/IniValue.cs
+++ b/GreenshotPlugin/IniFile/IniValue.cs
@@ -229,9 +229,8 @@ namespace Greenshot.IniFile {
/// Set the value to the value in the ini file, or default
///
///
- public void SetValueFromProperties(Dictionary properties) {
+ public void SetValueFromProperties(IDictionary properties) {
string propertyName = attributes.Name;
- string defaultValue = attributes.DefaultValue;
string propertyValue = null;
if (properties.ContainsKey(propertyName) && properties[propertyName] != null) {
propertyValue = containingIniSection.PreCheckValue(propertyName, properties[propertyName]);
@@ -273,7 +272,7 @@ namespace Greenshot.IniFile {
object dictionary = Activator.CreateInstance(valueType);
MethodInfo addMethodInfo = valueType.GetMethod("Add");
bool addedElements = false;
- Dictionary properties = IniConfig.PropertiesForSection(containingIniSection);
+ IDictionary properties = IniConfig.PropertiesForSection(containingIniSection);
foreach (string key in properties.Keys) {
if (key != null && key.StartsWith(propertyName + ".")) {
// What "key" do we need to store it under?
@@ -354,6 +353,7 @@ namespace Greenshot.IniFile {
///
/// Type to convert tp
/// string to convert from
+ ///
/// Value
private static object ConvertStringToValueType(Type valueType, string valueString, string separator) {
if (valueString == null) {
@@ -460,7 +460,8 @@ namespace Greenshot.IniFile {
}
}
return stringBuilder.ToString();
- } else if (valueType == typeof(object)) {
+ }
+ if (valueType == typeof(object)) {
// object to String, this is the hardest
// Format will be "FQTypename[,Assemblyname]:Value"
@@ -478,12 +479,11 @@ namespace Greenshot.IniFile {
if (assemblyName.StartsWith("Green")) {
assemblyName = assemblyName.Substring(0, assemblyName.IndexOf(','));
}
- return String.Format("{0},{1}:{2}", valueTypeName, assemblyName, ourValue);
- } else {
- TypeConverter converter = TypeDescriptor.GetConverter(valueType);
- if (converter != null) {
- return converter.ConvertToInvariantString(valueObject);
- }
+ return string.Format("{0},{1}:{2}", valueTypeName, assemblyName, ourValue);
+ }
+ TypeConverter converter = TypeDescriptor.GetConverter(valueType);
+ if (converter != null) {
+ return converter.ConvertToInvariantString(valueObject);
}
// All other types
return valueObject.ToString();
diff --git a/GreenshotPlugin/Interfaces/Generic.cs b/GreenshotPlugin/Interfaces/Generic.cs
index ca0ea04b7..5d7b83b5d 100644
--- a/GreenshotPlugin/Interfaces/Generic.cs
+++ b/GreenshotPlugin/Interfaces/Generic.cs
@@ -21,7 +21,6 @@
using Greenshot.Core;
using Greenshot.Memento;
using Greenshot.Plugin.Drawing;
-using GreenshotPlugin.Interfaces.Drawing;
using System;
using System.Drawing;
using System.IO;
@@ -207,6 +206,7 @@ namespace Greenshot.Plugin
///
/// IDrawableContainer
/// false to skip invalidation
+ /// false to skip event generation
void SelectElement(IDrawableContainer container, bool invalidate = true, bool generateEvents = true);
///
/// Is the supplied container "on" the surface?
diff --git a/GreenshotPlugin/Interfaces/IDestination.cs b/GreenshotPlugin/Interfaces/IDestination.cs
index 764c337b6..8abae8940 100644
--- a/GreenshotPlugin/Interfaces/IDestination.cs
+++ b/GreenshotPlugin/Interfaces/IDestination.cs
@@ -139,7 +139,7 @@ namespace Greenshot.Plugin {
/// Return a menu item
///
/// Resolve the dynamic destinations too?
- /// The menu for which the item is created
+ /// The menu for which the item is created
/// Handler which is called when clicked
/// ToolStripMenuItem
ToolStripMenuItem GetMenuItem(bool addDynamics, ContextMenuStrip menu, EventHandler destinationClickHandler);
diff --git a/GreenshotPlugin/Interfaces/Plugin/PluginInterfaces.cs b/GreenshotPlugin/Interfaces/Plugin/PluginInterfaces.cs
index 6d6301d6f..5e632ca71 100644
--- a/GreenshotPlugin/Interfaces/Plugin/PluginInterfaces.cs
+++ b/GreenshotPlugin/Interfaces/Plugin/PluginInterfaces.cs
@@ -30,7 +30,7 @@ using Greenshot.Core;
namespace Greenshot.Plugin {
[Serializable]
[AttributeUsage(AttributeTargets.Assembly, Inherited = false, AllowMultiple = false)]
- sealed public class PluginAttribute : Attribute, IComparable {
+ public sealed class PluginAttribute : Attribute, IComparable {
public string Name {
get;
set;
@@ -173,10 +173,13 @@ namespace Greenshot.Plugin {
NotifyIcon NotifyIcon {
get;
}
+
///
/// Create a Thumbnail
///
/// Image of which we need a Thumbnail
+ ///
+ ///
/// Image with Thumbnail
Image GetThumbnail(Image image, int width, int height);
@@ -191,14 +194,14 @@ namespace Greenshot.Plugin {
///
/// Get a destination by it's designation
///
- ///
+ ///
/// IDestination
IDestination GetDestination(string designation);
///
/// Get a list of all available destinations
///
- /// List
+ /// List of IDestination
List GetAllDestinations();
///
diff --git a/GreenshotPlugin/Interop/COMWrapper.cs b/GreenshotPlugin/Interop/COMWrapper.cs
index 3cde05cf5..2c723440c 100644
--- a/GreenshotPlugin/Interop/COMWrapper.cs
+++ b/GreenshotPlugin/Interop/COMWrapper.cs
@@ -45,12 +45,12 @@ namespace Greenshot.Interop {
///
/// Holds reference to the actual COM object which is wrapped by this proxy
///
- private object _COMObject;
+ private readonly object _comObject;
///
/// Type of the COM object, set on constructor after getting the COM reference
///
- private readonly Type _COMType;
+ private readonly Type _comType;
///
/// The type of which method calls are intercepted and executed on the COM object.
@@ -64,33 +64,33 @@ namespace Greenshot.Interop {
#endregion
[DllImport("ole32.dll")]
- static extern int ProgIDFromCLSID([In] ref Guid clsid, [MarshalAs(UnmanagedType.LPWStr)] out string lplpszProgID);
+ static extern int ProgIDFromCLSID([In] ref Guid clsid, [MarshalAs(UnmanagedType.LPWStr)] out string lplpszProgId);
// Converts failure HRESULTs to exceptions:
[DllImport("oleaut32", PreserveSig=false)]
- static extern void GetActiveObject(ref Guid rclsid, IntPtr pvReserved, [MarshalAs(UnmanagedType.IUnknown)] out Object ppunk);
+ static extern void GetActiveObject(ref Guid rclsid, IntPtr pvReserved, [MarshalAs(UnmanagedType.IUnknown)] out object ppunk);
#region Construction
///
/// Gets a COM object and returns the transparent proxy which intercepts all calls to the object
///
- /// Interface which defines the method and properties to intercept
+ /// Interface which defines the method and properties to intercept
/// Transparent proxy to the real proxy for the object
- /// The must be an interface decorated with the attribute.
+ /// T must be an interface decorated with the attribute.
public static T GetInstance() {
Type type = typeof(T);
if (null == type) {
- throw new ArgumentNullException("type");
+ throw new ArgumentNullException(nameof(T));
}
if (!type.IsInterface) {
- throw new ArgumentException("The specified type must be an interface.", "type");
+ throw new ArgumentException("The specified type must be an interface.", nameof(T));
}
- ComProgIdAttribute progIDAttribute = ComProgIdAttribute.GetAttribute(type);
- if (null == progIDAttribute || null == progIDAttribute.Value || 0 == progIDAttribute.Value.Length) {
- throw new ArgumentException("The specified type must define a ComProgId attribute.", "type");
+ var progIdAttribute = ComProgIdAttribute.GetAttribute(type);
+ if (string.IsNullOrEmpty(progIdAttribute?.Value)) {
+ throw new ArgumentException("The specified type must define a ComProgId attribute.", nameof(T));
}
- string progId = progIDAttribute.Value;
+ string progId = progIdAttribute.Value;
object comObject = null;
@@ -100,18 +100,18 @@ namespace Greenshot.Interop {
int result = ProgIDFromCLSID(ref guid, out progId);
if (result != 0) {
// Restore progId, as it's overwritten
- progId = progIDAttribute.Value;
+ progId = progIdAttribute.Value;
try {
GetActiveObject(ref guid, IntPtr.Zero, out comObject);
} catch (Exception) {
- LOG.WarnFormat("Error {0} getting instance for class id {1}", result, progIDAttribute.Value);
+ LOG.WarnFormat("Error {0} getting instance for class id {1}", result, progIdAttribute.Value);
}
if (comObject == null) {
- LOG.WarnFormat("Error {0} getting progId {1}", result, progIDAttribute.Value);
+ LOG.WarnFormat("Error {0} getting progId {1}", result, progIdAttribute.Value);
}
} else {
- LOG.InfoFormat("Mapped {0} to progId {1}", progIDAttribute.Value, progId);
+ LOG.InfoFormat("Mapped {0} to progId {1}", progIdAttribute.Value, progId);
}
}
@@ -124,16 +124,16 @@ namespace Greenshot.Interop {
} else if (comE.ErrorCode == CO_E_CLASSSTRING) {
LOG.WarnFormat("Unknown progId {0}", progId);
} else {
- LOG.Warn("Error getting active object for " + progIDAttribute.Value, comE);
+ LOG.Warn("Error getting active object for " + progIdAttribute.Value, comE);
}
} catch (Exception e) {
- LOG.Warn("Error getting active object for " + progIDAttribute.Value, e);
+ LOG.Warn("Error getting active object for " + progIdAttribute.Value, e);
}
}
if (comObject != null) {
if (comObject is IDispatch) {
- COMWrapper wrapper = new COMWrapper(comObject, type, progIDAttribute.Value);
+ COMWrapper wrapper = new COMWrapper(comObject, type, progIdAttribute.Value);
return (T)wrapper.GetTransparentProxy();
} else {
return (T)comObject;
@@ -149,17 +149,17 @@ namespace Greenshot.Interop {
public static T CreateInstance() {
Type type = typeof(T);
if (null == type) {
- throw new ArgumentNullException("type");
+ throw new ArgumentNullException(nameof(T));
}
if (!type.IsInterface) {
- throw new ArgumentException("The specified type must be an interface.", "type");
+ throw new ArgumentException("The specified type must be an interface.", nameof(T));
}
- ComProgIdAttribute progIDAttribute = ComProgIdAttribute.GetAttribute(type);
- if (null == progIDAttribute || null == progIDAttribute.Value || 0 == progIDAttribute.Value.Length) {
- throw new ArgumentException("The specified type must define a ComProgId attribute.", "type");
+ ComProgIdAttribute progIdAttribute = ComProgIdAttribute.GetAttribute(type);
+ if (string.IsNullOrEmpty(progIdAttribute?.Value)) {
+ throw new ArgumentException("The specified type must define a ComProgId attribute.", nameof(T));
}
- string progId = progIDAttribute.Value;
+ string progId = progIdAttribute.Value;
Type comType = null;
if (progId.StartsWith("clsid:")) {
Guid guid = new Guid(progId.Substring(6));
@@ -197,26 +197,26 @@ namespace Greenshot.Interop {
/// Gets or creates a COM object and returns the transparent proxy which intercepts all calls to the object
/// The ComProgId can be a normal ComProgId or a GUID prefixed with "clsid:"
///
- /// Interface which defines the method and properties to intercept
+ /// Interface which defines the method and properties to intercept
/// Transparent proxy to the real proxy for the object
- /// The must be an interface decorated with the attribute.
+ /// T must be an interface decorated with the attribute.
public static T GetOrCreateInstance() {
Type type = typeof(T);
if (null == type) {
- throw new ArgumentNullException("type");
+ throw new ArgumentNullException(nameof(T));
}
if (!type.IsInterface) {
- throw new ArgumentException("The specified type must be an interface.", "type");
+ throw new ArgumentException("The specified type must be an interface.", nameof(T));
}
- ComProgIdAttribute progIDAttribute = ComProgIdAttribute.GetAttribute(type);
- if (null == progIDAttribute || null == progIDAttribute.Value || 0 == progIDAttribute.Value.Length) {
- throw new ArgumentException("The specified type must define a ComProgId attribute.", "type");
+ var progIdAttribute = ComProgIdAttribute.GetAttribute(type);
+ if (string.IsNullOrEmpty(progIdAttribute?.Value)) {
+ throw new ArgumentException("The specified type must define a ComProgId attribute.", nameof(T));
}
object comObject = null;
Type comType = null;
- string progId = progIDAttribute.Value;
+ string progId = progIdAttribute.Value;
Guid guid = Guid.Empty;
// Convert from clsid to Prog ID, if needed
@@ -225,17 +225,17 @@ namespace Greenshot.Interop {
int result = ProgIDFromCLSID(ref guid, out progId);
if (result != 0) {
// Restore progId, as it's overwritten
- progId = progIDAttribute.Value;
+ progId = progIdAttribute.Value;
try {
GetActiveObject(ref guid, IntPtr.Zero, out comObject);
} catch (Exception) {
- LOG.WarnFormat("Error {0} getting instance for class id {1}", result, progIDAttribute.Value);
+ LOG.WarnFormat("Error {0} getting instance for class id {1}", result, progIdAttribute.Value);
}
if (comObject == null) {
- LOG.WarnFormat("Error {0} getting progId {1}", result, progIDAttribute.Value);
+ LOG.WarnFormat("Error {0} getting progId {1}", result, progIdAttribute.Value);
}
} else {
- LOG.InfoFormat("Mapped {0} to progId {1}", progIDAttribute.Value, progId);
+ LOG.InfoFormat("Mapped {0} to progId {1}", progIdAttribute.Value, progId);
}
}
@@ -283,7 +283,7 @@ namespace Greenshot.Interop {
}
if (comObject != null) {
if (comObject is IDispatch) {
- COMWrapper wrapper = new COMWrapper(comObject, type, progIDAttribute.Value);
+ COMWrapper wrapper = new COMWrapper(comObject, type, progIdAttribute.Value);
return (T)wrapper.GetTransparentProxy();
} else {
return (T)comObject;
@@ -295,16 +295,16 @@ namespace Greenshot.Interop {
///
/// Wrap a com object as COMWrapper
///
+ /// Interface which defines the method and properties to intercept
/// An object to intercept
- /// Interface which defines the method and properties to intercept
/// Transparent proxy to the real proxy for the object
public static T Wrap(object comObject) {
Type type = typeof (T);
if (null == comObject) {
- throw new ArgumentNullException("comObject");
+ throw new ArgumentNullException(nameof(comObject));
}
if (null == type) {
- throw new ArgumentNullException("type");
+ throw new ArgumentNullException(nameof(T));
}
COMWrapper wrapper = new COMWrapper(comObject, type, type.FullName);
@@ -316,13 +316,14 @@ namespace Greenshot.Interop {
///
/// An object to intercept
/// Interface which defines the method and properties to intercept
+ ///
/// Transparent proxy to the real proxy for the object
private static object Wrap(object comObject, Type type, string targetName) {
if (null == comObject) {
- throw new ArgumentNullException("comObject");
+ throw new ArgumentNullException(nameof(comObject));
}
if (null == type) {
- throw new ArgumentNullException("type");
+ throw new ArgumentNullException(nameof(type));
}
COMWrapper wrapper = new COMWrapper(comObject, type, targetName);
@@ -338,9 +339,10 @@ namespace Greenshot.Interop {
///
/// The interface type to impersonate.
///
+ ///
private COMWrapper(object comObject, Type type, string targetName) : base(type) {
- _COMObject = comObject;
- _COMType = comObject.GetType();
+ _comObject = comObject;
+ _comType = comObject.GetType();
_interceptType = type;
_targetName = targetName;
}
@@ -374,24 +376,22 @@ namespace Greenshot.Interop {
/// interface.
///
private void Dispose(bool disposing) {
- if (null != _COMObject) {
+ if (null != _comObject) {
LOG.DebugFormat("Disposing {0}", _interceptType);
- if (Marshal.IsComObject(_COMObject)) {
+ if (Marshal.IsComObject(_comObject)) {
try {
int count;
do {
- count = Marshal.ReleaseComObject(_COMObject);
+ count = Marshal.ReleaseComObject(_comObject);
LOG.DebugFormat("RCW count for {0} now is {1}", _interceptType, count);
} while (count > 0);
} catch (Exception ex) {
- LOG.WarnFormat("Problem releasing COM object {0}", _COMType);
+ LOG.WarnFormat("Problem releasing COM object {0}", _comType);
LOG.Warn("Error: ", ex);
}
} else {
- LOG.WarnFormat("{0} is not a COM object", _COMType);
+ LOG.WarnFormat("{0} is not a COM object", _comType);
}
-
- _COMObject = null;
}
}
@@ -416,7 +416,7 @@ namespace Greenshot.Interop {
/// The hash code of the wrapped object.
///
public override int GetHashCode() {
- return _COMObject.GetHashCode();
+ return _comObject.GetHashCode();
}
///
@@ -432,7 +432,7 @@ namespace Greenshot.Interop {
if (null != value && RemotingServices.IsTransparentProxy(value)) {
COMWrapper wrapper = RemotingServices.GetRealProxy(value) as COMWrapper;
if (null != wrapper) {
- return _COMObject == wrapper._COMObject;
+ return _comObject == wrapper._comObject;
}
}
@@ -453,7 +453,7 @@ namespace Greenshot.Interop {
///
private static Type GetByValType(Type byRefType) {
if (null == byRefType) {
- throw new ArgumentNullException("byRefType");
+ throw new ArgumentNullException(nameof(byRefType));
}
if (byRefType.IsByRef) {
@@ -467,97 +467,6 @@ namespace Greenshot.Interop {
#endregion
- ///
- /// Use this static method to cast a wrapped proxy to a new wrapper proxy of the supplied type.
- /// In English, use this to cast you base "COM" interface to a specialized interface.
- /// E.G. Outlook Item -> MailItem
- ///
- /// the type you want to cast to
- /// The wrapper interface, e.g. something you got back from calling GetItem
- /// A new wrapper proxy for the specified type
- public static T Cast(object wrapperProxy) {
- if (wrapperProxy == null) {
- return default(T);
- }
-
- Type newType = typeof(T);
- COMWrapper oldWrapper = RemotingServices.GetRealProxy(wrapperProxy) as COMWrapper;
- if (oldWrapper == null) {
- throw new ArgumentException("wrapper proxy was no COMWrapper");
- }
- if (oldWrapper._interceptType.IsAssignableFrom(newType)) {
- COMWrapper newWrapper = new COMWrapper(oldWrapper._COMObject, newType, oldWrapper._targetName);
- return (T)newWrapper.GetTransparentProxy();
- }
- throw new InvalidCastException(string.Format("{0} is not assignable from {1}", oldWrapper._interceptType, newType));
- }
-
- ///
- /// Returns the "com" type of the wrapperproxy, making it possible to perform reflection on it.
- ///
- /// wrapperProxy to get the type from
- /// Type
- public static Type GetUnderlyingTypeForWrapper(object wrapperProxy) {
- Type returnType = null;
- COMWrapper wrapper = RemotingServices.GetRealProxy(wrapperProxy) as COMWrapper;
- if (wrapper != null) {
- IDispatch dispatch = wrapper._COMObject as IDispatch;
- if (dispatch != null) {
- int result = dispatch.GetTypeInfo(0, 0, out returnType);
- if (result != 0) {
- LOG.DebugFormat("GetTypeInfo : 0x{0} ({1})", result.ToString("X"), result);
- }
- }
- }
- return returnType;
- }
-
- ///
- /// Return the Type of a IDispatch
- ///
- /// IDispatch to get the type object for
- /// Type of the IDispatch
- public static Type GetUnderlyingType(IDispatch dispatch) {
- Type returnType = null;
- if (dispatch != null) {
- int result = dispatch.GetTypeInfo(0, 0, out returnType);
- if (result != 0) {
- LOG.DebugFormat("GetTypeInfo : 0x{0} ({1})", result.ToString("X"), result);
- }
- }
- return returnType;
- }
-
- ///
- /// Dump the Type-Information for the Type to the log, this uses reflection
- ///
- /// Type to inspect
- public static void DumpTypeInfo(Type type) {
- LOG.InfoFormat("Type information for Type with name: {0}", type.Name);
- try {
- foreach (MemberInfo memberInfo in type.GetMembers()) {
- LOG.InfoFormat("Member: {0};", memberInfo);
- }
- } catch (Exception memberException) {
- LOG.Error(memberException);
- }
- try {
- foreach (PropertyInfo propertyInfo in type.GetProperties()) {
- LOG.InfoFormat("Property: {0};", propertyInfo);
- }
- } catch (Exception propertyException) {
- LOG.Error(propertyException);
- }
- try {
- foreach (FieldInfo fieldInfo in type.GetFields()) {
- LOG.InfoFormat("Field: {0};", fieldInfo);
- }
- } catch (Exception fieldException) {
- LOG.Error(fieldException);
- }
- LOG.InfoFormat("Type information end.");
- }
-
///
/// Intercept method calls
///
@@ -605,14 +514,14 @@ namespace Greenshot.Interop {
} else if (1 == argCount && typeof(void) == returnType && (methodName.StartsWith("add_") || methodName.StartsWith("remove_"))) {
bool removeHandler = methodName.StartsWith("remove_");
methodName = methodName.Substring(removeHandler ? 7 : 4);
-
+ // TODO: Something is missing here
Delegate handler = callMessage.InArgs[0] as Delegate;
if (null == handler) {
- return new ReturnMessage(new ArgumentNullException("handler"), callMessage);
+ return new ReturnMessage(new ArgumentNullException(nameof(handler)), callMessage);
}
} else {
- var invokeObject = _COMObject;
- var invokeType = _COMType;
+ var invokeObject = _comObject;
+ var invokeType = _comType;
object[] args;
ParameterInfo parameter;
@@ -661,7 +570,7 @@ namespace Greenshot.Interop {
wrapper = RemotingServices.GetRealProxy(args[i]) as COMWrapper;
if (null != wrapper) {
originalArgs[i] = wrapper;
- args[i] = wrapper._COMObject;
+ args[i] = wrapper._comObject;
}
} else if (0 != outArgsCount && argModifiers[0][i]) {
byValType = GetByValType(parameters[i].ParameterType);
@@ -755,7 +664,7 @@ namespace Greenshot.Interop {
} else if (byValType.IsInterface) {
if (Marshal.IsComObject(arg)) {
wrapper = originalArgs[i];
- if (null != wrapper && wrapper._COMObject != arg) {
+ if (null != wrapper && wrapper._comObject != arg) {
wrapper.Dispose();
wrapper = null;
}
diff --git a/GreenshotPlugin/UnmanagedHelpers/Structs.cs b/GreenshotPlugin/UnmanagedHelpers/Structs.cs
index 3ad858623..e3d06d1fa 100644
--- a/GreenshotPlugin/UnmanagedHelpers/Structs.cs
+++ b/GreenshotPlugin/UnmanagedHelpers/Structs.cs
@@ -64,7 +64,7 @@ namespace GreenshotPlugin.UnmanagedHelpers {
return new Point(X, Y);
}
- override public string ToString() {
+ public override string ToString() {
return X + "," + Y;
}
}
diff --git a/GreenshotPlugin/UnmanagedHelpers/Win32Errors.cs b/GreenshotPlugin/UnmanagedHelpers/Win32Errors.cs
index f6614d1b5..6c9b802d4 100644
--- a/GreenshotPlugin/UnmanagedHelpers/Win32Errors.cs
+++ b/GreenshotPlugin/UnmanagedHelpers/Win32Errors.cs
@@ -22,9 +22,6 @@ using System;
using System.Runtime.InteropServices;
using System.Text;
-///
-/// Win32 error codes
-///
namespace GreenshotPlugin.UnmanagedHelpers {
///
/// A Win32 error code.