Skip to content

Commit 6701004

Browse files
committed
Icon added
C# 9 enabled Nullable enable GenerateDocumentationFile set instead of file path [R] Nullable [R] Expression-body methods
1 parent f18d41f commit 6701004

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

Simplify.Web.MessageBox/IMessageBoxHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ public interface IMessageBoxHandler
2525
/// <param name="text">Text of a message box</param>
2626
/// <param name="status">Status of a message box</param>
2727
/// <param name="title">Title of a message box</param>
28-
void Show(string text, MessageBoxStatus status = MessageBoxStatus.Error, string title = null);
28+
void Show(string text, MessageBoxStatus status = MessageBoxStatus.Error, string? title = null);
2929

3030
/// <summary>
3131
///Generate message box HTML and set to data collector
3232
/// </summary>
3333
/// <param name="stringTableItemName">Show message from string table item</param>
3434
/// <param name="status">Status of a message box</param>
3535
/// <param name="title">Title of a message box</param>
36-
void ShowSt(string stringTableItemName, MessageBoxStatus status = MessageBoxStatus.Error, string title = null);
36+
void ShowSt(string stringTableItemName, MessageBoxStatus status = MessageBoxStatus.Error, string? title = null);
3737

3838
/// <summary>
3939
/// Get inline message box HTML

Simplify.Web.MessageBox/MessageBoxHandler.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public MessageBoxHandler(ITemplateFactory templateFactory, IStringTable stringTa
4848
/// <param name="text">Text of a message box</param>
4949
/// <param name="status">Status of a message box</param>
5050
/// <param name="title">Title of a message box</param>
51-
public void Show(string text, MessageBoxStatus status = MessageBoxStatus.Error, string title = null)
51+
public void Show(string? text, MessageBoxStatus status = MessageBoxStatus.Error, string? title = null)
5252
{
5353
if (string.IsNullOrEmpty(text))
5454
throw new ArgumentNullException(nameof(text));
@@ -85,18 +85,16 @@ public void Show(string text, MessageBoxStatus status = MessageBoxStatus.Error,
8585
/// <param name="stringTableItemName">Show message from string table item</param>
8686
/// <param name="status">Status of a message box</param>
8787
/// <param name="title">Title of a message box</param>
88-
public void ShowSt(string stringTableItemName, MessageBoxStatus status = MessageBoxStatus.Error, string title = null)
89-
{
88+
public void ShowSt(string stringTableItemName, MessageBoxStatus status = MessageBoxStatus.Error, string? title = null) =>
9089
Show(_stringTable.GetItem(stringTableItemName), status, title);
91-
}
9290

9391
/// <summary>
9492
/// Get inline message box HTML
9593
/// </summary>
9694
/// <param name="text">Text of a message box</param>
9795
/// <param name="status">Status of a message box</param>
9896
/// <returns>Message box html</returns>
99-
public string GetInline(string text, MessageBoxStatus status = MessageBoxStatus.Error)
97+
public string GetInline(string? text, MessageBoxStatus status = MessageBoxStatus.Error)
10098
{
10199
if (string.IsNullOrEmpty(text))
102100
throw new ArgumentNullException(nameof(text));
@@ -131,9 +129,7 @@ public string GetInline(string text, MessageBoxStatus status = MessageBoxStatus.
131129
/// <param name="stringTableItemName">Show message from string table item</param>
132130
/// <param name="status">Status of a message box</param>
133131
/// <returns>Message box html</returns>
134-
public string GetInlineSt(string stringTableItemName, MessageBoxStatus status = MessageBoxStatus.Error)
135-
{
136-
return GetInline(_stringTable.GetItem(stringTableItemName), status);
137-
}
132+
public string GetInlineSt(string stringTableItemName, MessageBoxStatus status = MessageBoxStatus.Error) =>
133+
GetInline(_stringTable.GetItem(stringTableItemName), status);
138134
}
139135
}

Simplify.Web.MessageBox/Responses/MessageBox.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class MessageBox : ControllerResponse
1414
/// <param name="status">The message box status.</param>
1515
/// <param name="statusCode">The HTTP response status code.</param>
1616
/// <param name="title">The title.</param>
17-
public MessageBox(string text, MessageBoxStatus status = MessageBoxStatus.Error, int statusCode = 200, string title = null)
17+
public MessageBox(string text, MessageBoxStatus status = MessageBoxStatus.Error, int statusCode = 200, string? title = null)
1818
{
1919
Text = text;
2020
Status = status;
@@ -65,7 +65,7 @@ public MessageBox(string text, int statusCode, MessageBoxStatus status = Message
6565
/// <value>
6666
/// The title.
6767
/// </value>
68-
public string Title { get; }
68+
public string? Title { get; }
6969

7070
/// <summary>
7171
/// Processes this response

Simplify.Web.MessageBox/Simplify.Web.MessageBox.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net5.0;netstandard2.0;net462</TargetFrameworks>
4+
<LangVersion>9.0</LangVersion>
5+
<Nullable>enable</Nullable>
46
<IncludeSymbols>true</IncludeSymbols>
57
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
68
<OutputPath>bin\Any CPU\$(Configuration)\</OutputPath>
7-
<DocumentationFile>bin\Any CPU\$(Configuration)\$(TargetFramework)\Simplify.Web.MessageBox.xml</DocumentationFile>
9+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
810

911
<Version>1.4.3</Version>
1012

@@ -13,7 +15,7 @@
1315
<Description>Simplify.Web static message box templates and controller response</Description>
1416
<Copyright>Licensed under LGPL</Copyright>
1517
<PackageProjectUrl>https://github.com/SimplifyNet/Simplify.Web.MessageBox</PackageProjectUrl>
16-
<PackageIconUrl>https://raw.githubusercontent.com/SimplifyNet/Images/master/LogoWeb32x32.png</PackageIconUrl>
18+
<PackageIcon>icon.png</PackageIcon>
1719
<RepositoryUrl>https://github.com/SimplifyNet/Simplify.Web.MessageBox</RepositoryUrl>
1820
<RepositoryType>GIT</RepositoryType>
1921
<PackageTags>Simplify.Web</PackageTags>

images/icon.png

8.36 KB
Loading

0 commit comments

Comments
 (0)