Skip to content

Commit

Permalink
Update README.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
try0 committed Apr 21, 2020
1 parent 1ee1767 commit 19c754c
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ Messages that could not be rendered in the current request are persisted in the

## Version

0.2.0
0.3.0

version >=.NETFramework 4.6.1, .NET Standard 2.0


## Usage

### NuGet
[FeedbackMessages](https://www.nuget.org/packages/FeedbackMessages/0.2.0) .NETFramework WebForms
[FeedbackMessages](https://www.nuget.org/packages/FeedbackMessages/0.3.0) .NETFramework WebForms

[FeedbackMessages.Mvc](https://www.nuget.org/packages/FeedbackMessages.Mvc/0.2.0) .NETFramework Mvc
[FeedbackMessages.Mvc](https://www.nuget.org/packages/FeedbackMessages.Mvc/0.3.0) .NETFramework Mvc

[FeedbackMessages.AspNetCore.Mvc](https://www.nuget.org/packages/FeedbackMessages.AspNetCore.Mvc/0.2.0) .NETCore Mvc, RazorPages
[FeedbackMessages.AspNetCore.Mvc](https://www.nuget.org/packages/FeedbackMessages.AspNetCore.Mvc/0.3.0) .NETCore Mvc, RazorPages


---
Expand All @@ -32,9 +32,9 @@ version >=.NETFramework 4.6.1, .NET Standard 2.0

In your application's start up process.
```C#
FeedbackMessageSettings.Initializer
FeedbackMessageSettings.CreateInitializer()
// custom renderer for feedback-message-panel
.SetMessageRenderer(() => {
.SetMessageRendererFactory(() => {

var messageRenderer = new FeedbackMessageRenderer();
messageRenderer.OuterTagName = "div";
Expand All @@ -48,7 +48,13 @@ FeedbackMessageSettings.Initializer
return messageRenderer;
})
// custom script builder.
.SetScriptBuilder(new FeedbackMessageScriptBuilder(msg => $"alert('{msg.ToString()}');"))
.SetScriptBuilderInstance(new FeedbackMessageScriptBuilder(msg => $"alert('{msg.ToString()}');"))
// custom store serializer.
.SetStoreSerializerInstance(new FeedbackMessageStoreSerializer()
{
Deserializer = serial => /* TODO */ new FeedbackMessageStore(),
Serializer = store => /* TODO */ ""
})
// init configs
.Initialize();
```
Expand All @@ -59,6 +65,7 @@ FeedbackMessageSettings.Initializer

* FeedbackMessageScriptBuilder throws Exception.

* FeedbackMessageStoreSerializer use System.Text.Json.JsonSerializer

---

Expand Down Expand Up @@ -99,7 +106,7 @@ In the case of display messages using JavaScript.
using FeedbackMessages.Extensions;

this.AppendFeedbackMessageScripts();
this.AppendFeedbackMessageScript();
```

---
Expand Down Expand Up @@ -142,7 +149,7 @@ In the case of display messages using JavaScript.

@using FeedbackMessages.Extensions;

@Html.FeedbackMessageScripts()
@Html.FeedbackMessageScript()
```


Expand All @@ -159,7 +166,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddMvc(options =>
{
// Required add filter
options.Filters.Add(FeedbackMessageFilter.Instance);
options.Filters.Add(FeedbackMessageActionFilter.Instance);
});

// Required add context accessor
Expand Down Expand Up @@ -206,7 +213,7 @@ In the case of display messages using JavaScript.
@using FeedbackMessages.Extensions;

<!-- render message area -->
@Html.FeedbackMessageScripts()
@Html.FeedbackMessageScript()

```

Expand All @@ -224,7 +231,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddMvc(options =>
{
// Required add filter
options.Filters.Add(FeedbackMessageFilter.Instance);
options.Filters.Add(FeedbackMessageActionFilter.Instance);
});

// Required add context accessor
Expand Down

0 comments on commit 19c754c

Please sign in to comment.