Skip to content

Commit

Permalink
Add StringFormatMethod attributes for better intellisense
Browse files Browse the repository at this point in the history
  • Loading branch information
pieceofsummer committed Oct 1, 2018
1 parent 08f0e8c commit b7836ae
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.4.1-{build}
version: 1.4.2-{build}

os: Visual Studio 2017

Expand Down
9 changes: 9 additions & 0 deletions src/Hangfire.Console/ConsoleExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Hangfire.Console.Server;
using Hangfire.Server;
using System;
using JetBrains.Annotations;

namespace Hangfire.Console
{
Expand Down Expand Up @@ -103,6 +104,7 @@ public static void WriteLine(this PerformContext context, object value)
/// <param name="context">Context</param>
/// <param name="format">Format string</param>
/// <param name="arg0">Argument</param>
[StringFormatMethod("format")]
public static void WriteLine(this PerformContext context, string format, object arg0)
=> WriteLine(context, string.Format(format, arg0));

Expand All @@ -113,6 +115,7 @@ public static void WriteLine(this PerformContext context, string format, object
/// <param name="format">Format string</param>
/// <param name="arg0">Argument</param>
/// <param name="arg1">Argument</param>
[StringFormatMethod("format")]
public static void WriteLine(this PerformContext context, string format, object arg0, object arg1)
=> WriteLine(context, string.Format(format, arg0, arg1));

Expand All @@ -124,6 +127,7 @@ public static void WriteLine(this PerformContext context, string format, object
/// <param name="arg0">Argument</param>
/// <param name="arg1">Argument</param>
/// <param name="arg2">Argument</param>
[StringFormatMethod("format")]
public static void WriteLine(this PerformContext context, string format, object arg0, object arg1, object arg2)
=> WriteLine(context, string.Format(format, arg0, arg1, arg2));

Expand All @@ -133,6 +137,7 @@ public static void WriteLine(this PerformContext context, string format, object
/// <param name="context">Context</param>
/// <param name="format">Format string</param>
/// <param name="args">Arguments</param>
[StringFormatMethod("format")]
public static void WriteLine(this PerformContext context, string format, params object[] args)
=> WriteLine(context, string.Format(format, args));

Expand All @@ -152,6 +157,7 @@ public static void WriteLine(this PerformContext context, ConsoleTextColor color
/// <param name="color">Text color</param>
/// <param name="format">Format string</param>
/// <param name="arg0">Argument</param>
[StringFormatMethod("format")]
public static void WriteLine(this PerformContext context, ConsoleTextColor color, string format, object arg0)
=> WriteLine(context, color, string.Format(format, arg0));

Expand All @@ -163,6 +169,7 @@ public static void WriteLine(this PerformContext context, ConsoleTextColor color
/// <param name="format">Format string</param>
/// <param name="arg0">Argument</param>
/// <param name="arg1">Argument</param>
[StringFormatMethod("format")]
public static void WriteLine(this PerformContext context, ConsoleTextColor color, string format, object arg0, object arg1)
=> WriteLine(context, color, string.Format(format, arg0, arg1));

Expand All @@ -175,6 +182,7 @@ public static void WriteLine(this PerformContext context, ConsoleTextColor color
/// <param name="arg0">Argument</param>
/// <param name="arg1">Argument</param>
/// <param name="arg2">Argument</param>
[StringFormatMethod("format")]
public static void WriteLine(this PerformContext context, ConsoleTextColor color, string format, object arg0, object arg1, object arg2)
=> WriteLine(context, color, string.Format(format, arg0, arg1, arg2));

Expand All @@ -185,6 +193,7 @@ public static void WriteLine(this PerformContext context, ConsoleTextColor color
/// <param name="color">Text color</param>
/// <param name="format">Format string</param>
/// <param name="args">Arguments</param>
[StringFormatMethod("format")]
public static void WriteLine(this PerformContext context, ConsoleTextColor color, string format, params object[] args)
=> WriteLine(context, color, string.Format(format, args));
}
Expand Down
6 changes: 5 additions & 1 deletion src/Hangfire.Console/Hangfire.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<Description>Job console for Hangfire</Description>
<AssemblyTitle>Hangfire.Console</AssemblyTitle>
<VersionPrefix>1.4.1</VersionPrefix>
<VersionPrefix>1.4.2</VersionPrefix>
<Authors>Alexey Skalozub</Authors>
<TargetFrameworks>netstandard1.3;net45</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand All @@ -11,6 +11,9 @@
<PackageId>Hangfire.Console</PackageId>
<PackageTags>hangfire;console;logging</PackageTags>
<PackageReleaseNotes>History:
v1.4.2:
• Added StringFormatMethod attributes on WriteLine methods (for better intellisense)

v1.4.1:
• Fix job progress style
• Use explicit json serializer settings
Expand Down Expand Up @@ -113,6 +116,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Hangfire.Core" Version="1.6.0" />
<PackageReference Include="JetBrains.Annotations" Version="11.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
Expand Down

0 comments on commit b7836ae

Please sign in to comment.