mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 18:57:28 -07:00
cleanup [skip ci]
This commit is contained in:
parent
4c7baa9476
commit
5685531770
3 changed files with 7 additions and 44 deletions
|
@ -42,11 +42,6 @@ namespace GreenshotJiraPlugin {
|
|||
private JiraApi _jiraApi;
|
||||
|
||||
public void Dispose() {
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected void Dispose(bool disposing) {
|
||||
if (_jiraApi != null)
|
||||
{
|
||||
Task.Run(async () => await Logout()).Wait();
|
||||
|
@ -59,10 +54,6 @@ namespace GreenshotJiraPlugin {
|
|||
_jiraApi = new JiraApi(new Uri(_url));
|
||||
}
|
||||
|
||||
~JiraConnector() {
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal login which catches the exceptions
|
||||
/// </summary>
|
||||
|
|
|
@ -52,11 +52,7 @@ namespace GreenshotJiraPlugin {
|
|||
_jira = jira;
|
||||
}
|
||||
|
||||
public override string Designation {
|
||||
get {
|
||||
return "Jira";
|
||||
}
|
||||
}
|
||||
public override string Designation => "Jira";
|
||||
|
||||
private string FormatUpload(Issue jira) {
|
||||
return Designation + " - " + jira.Key + ": " + jira.Fields.Summary.Substring(0, Math.Min(20, jira.Fields.Summary.Length));
|
||||
|
@ -72,17 +68,10 @@ namespace GreenshotJiraPlugin {
|
|||
}
|
||||
}
|
||||
|
||||
public override bool isActive {
|
||||
get {
|
||||
return base.isActive && !string.IsNullOrEmpty(Config.Url);
|
||||
}
|
||||
}
|
||||
public override bool isActive => base.isActive && !string.IsNullOrEmpty(Config.Url);
|
||||
|
||||
public override bool isDynamic => true;
|
||||
|
||||
public override bool isDynamic {
|
||||
get {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override Image DisplayIcon {
|
||||
get {
|
||||
var resources = new ComponentResourceManager(typeof(JiraPlugin));
|
||||
|
|
|
@ -32,7 +32,6 @@ namespace GreenshotJiraPlugin {
|
|||
/// </summary>
|
||||
public class JiraPlugin : IGreenshotPlugin {
|
||||
private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(JiraPlugin));
|
||||
private PluginAttribute _jiraPluginAttributes;
|
||||
private JiraConnector _jiraConnector;
|
||||
private JiraConfiguration _config;
|
||||
private static JiraPlugin _instance;
|
||||
|
@ -51,21 +50,11 @@ namespace GreenshotJiraPlugin {
|
|||
}
|
||||
}
|
||||
|
||||
public static JiraPlugin Instance {
|
||||
get {
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
public static JiraPlugin Instance => _instance;
|
||||
|
||||
public JiraPlugin() {
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
public PluginAttribute JiraPluginAttributes {
|
||||
get {
|
||||
return _jiraPluginAttributes;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<IDestination> Destinations() {
|
||||
yield return new JiraDestination(this);
|
||||
|
@ -76,12 +65,8 @@ namespace GreenshotJiraPlugin {
|
|||
}
|
||||
|
||||
//Needed for a fail-fast
|
||||
public JiraConnector CurrentJiraConnector {
|
||||
get {
|
||||
return _jiraConnector;
|
||||
}
|
||||
}
|
||||
|
||||
public JiraConnector CurrentJiraConnector => _jiraConnector;
|
||||
|
||||
public JiraConnector JiraConnector {
|
||||
get {
|
||||
if (_jiraConnector == null) {
|
||||
|
@ -98,8 +83,6 @@ namespace GreenshotJiraPlugin {
|
|||
/// <param name="myAttributes">My own attributes</param>
|
||||
/// <returns>true if plugin is initialized, false if not (doesn't show)</returns>
|
||||
public bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
|
||||
_jiraPluginAttributes = myAttributes;
|
||||
|
||||
// Register configuration (don't need the configuration itself)
|
||||
_config = IniConfig.GetIniSection<JiraConfiguration>();
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue