From d90d94e8a7000bc8fca2b08638c3d5af2c9c3092 Mon Sep 17 00:00:00 2001 From: Danil Kislov Date: Wed, 20 Mar 2019 13:59:33 +0300 Subject: [PATCH] =?UTF-8?q?=D0=95=D1=89=D0=B5=20=D0=BD=D0=B5=D0=BC=D0=BD?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B3=D0=B0=20=D0=B0=D0=BB=D0=B3=D0=BE=D1=80?= =?UTF-8?q?=D0=B8=D1=82=D0=BC=D0=B0=20=D1=80=D0=B0=D1=81=D0=BF=D1=80=D0=B5?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B2=20Jira?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .semver.txt | 2 +- .../JiraIntegration/JiraCommitEmulator.cs | 13 +--- src/JiraTimeBot/Program.cs | 8 ++- src/JiraTimeBot/Properties/AssemblyInfo.cs | 62 +++++++++---------- 4 files changed, 39 insertions(+), 46 deletions(-) diff --git a/.semver.txt b/.semver.txt index 79728fe..4a4127c 100644 --- a/.semver.txt +++ b/.semver.txt @@ -1 +1 @@ -1.0.24 +1.0.25 diff --git a/src/JiraTimeBot/JiraIntegration/JiraCommitEmulator.cs b/src/JiraTimeBot/JiraIntegration/JiraCommitEmulator.cs index 7420eac..42fae56 100644 --- a/src/JiraTimeBot/JiraIntegration/JiraCommitEmulator.cs +++ b/src/JiraTimeBot/JiraIntegration/JiraCommitEmulator.cs @@ -34,20 +34,11 @@ namespace JiraTimeBot.JiraIntegration { return new List(); } - - List comments = new List(); - if (issue.Type?.Name != "Дубликат") - { - _log.Trace($"Получаю комментарии по задаче {issue.Key} ({issue.Type?.Name})."); - comments = issue.GetCommentsAsync(cancellationToken).Result?.ToList() ?? new List(); - } - else - { - _log.Trace($"Пропускаю комментарии по задаче {issue.Key} ({issue.Type?.Name})."); - } + var comments = issue.GetCommentsAsync(cancellationToken).Result?.ToList() ?? new List(); var user = settings.JiraUserName; var userComments = comments.Where(f => f.Author.Equals(user, StringComparison.InvariantCultureIgnoreCase)).ToList(); + _log.Trace($"Получены комментарии по задаче {issue.Key} ({issue.Type?.Name}): {userComments.Count}."); if (userComments.Any()) { diff --git a/src/JiraTimeBot/Program.cs b/src/JiraTimeBot/Program.cs index 696784c..e126dac 100644 --- a/src/JiraTimeBot/Program.cs +++ b/src/JiraTimeBot/Program.cs @@ -1,5 +1,7 @@ using JiraTimeBot.UI; using System; +using System.Diagnostics; +using System.Runtime.InteropServices; using System.Threading; using System.Windows.Forms; @@ -7,19 +9,19 @@ namespace JiraTimeBot { static class Program { - private static Mutex _mutex = new Mutex(true, "{44426B3E-B901-4792-ACEA-1385D79DBAD1}"); + private static readonly Mutex Mutex = new Mutex(true, "{44426B3E-B901-4792-ACEA-1385D79DBAD1}"); /// /// The main entry point for the application. /// [STAThread] static void Main() { - if (_mutex.WaitOne(TimeSpan.Zero, true)) + if (Mutex.WaitOne(TimeSpan.Zero, true)) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMain()); - _mutex.ReleaseMutex(); + Mutex.ReleaseMutex(); } else { diff --git a/src/JiraTimeBot/Properties/AssemblyInfo.cs b/src/JiraTimeBot/Properties/AssemblyInfo.cs index 8e5e9dd..f13cf8c 100644 --- a/src/JiraTimeBot/Properties/AssemblyInfo.cs +++ b/src/JiraTimeBot/Properties/AssemblyInfo.cs @@ -1,31 +1,31 @@ -using System.Reflection; -using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("JiraTimeBot")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("JiraTimeBot")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f3b89316-c38c-4ce6-9d88-0b1373cfba1a")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.24")] -[assembly: AssemblyFileVersion("1.0.24")] -[assembly: AssemblyInformationalVersion("1.0.24")] +using System.Reflection; +using System.Runtime.InteropServices; +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("JiraTimeBot")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("JiraTimeBot")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f3b89316-c38c-4ce6-9d88-0b1373cfba1a")] +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.25")] +[assembly: AssemblyFileVersion("1.0.25")] +[assembly: AssemblyInformationalVersion("1.0.25")]