-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
98 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...Web App Example/Tavenem.Wiki.Blazor.Example.Client/Services/CustomArticleRenderManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using Microsoft.AspNetCore.Components.Web; | ||
using System.Diagnostics.CodeAnalysis; | ||
using Tavenem.Wiki.Blazor.Client.Services; | ||
|
||
namespace Tavenem.Wiki.Blazor.Example.Client.Services; | ||
|
||
public class CustomArticleRenderManager : IArticleRenderManager | ||
{ | ||
/// <inheritdoc /> | ||
[return: DynamicallyAccessedMembers((DynamicallyAccessedMemberTypes)(-1))] | ||
public Type? GetArticleEndMatter(Page page) => null; | ||
|
||
/// <inheritdoc /> | ||
public IComponentRenderMode? GetArticleEndMatterRenderMode(Page page) => null; | ||
|
||
/// <inheritdoc /> | ||
[return: DynamicallyAccessedMembers((DynamicallyAccessedMemberTypes)(-1))] | ||
public Type? GetArticleFrontMatter(Page page) => string.IsNullOrEmpty(page.Title.Namespace) | ||
&& string.IsNullOrEmpty(page.Title.Title) | ||
? typeof(MainFrontMatter) | ||
: null; | ||
|
||
/// <inheritdoc /> | ||
public IComponentRenderMode? GetArticleFrontMatterRenderMode(Page page) => string.IsNullOrEmpty(page.Title.Namespace) | ||
&& string.IsNullOrEmpty(page.Title.Title) | ||
? RenderMode.InteractiveWebAssembly | ||
: null; | ||
} |
14 changes: 14 additions & 0 deletions
14
sample/Web App Example/Tavenem.Wiki.Blazor.Example.Client/Services/CustomOfflineManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Tavenem.Wiki.Blazor.Client.Services; | ||
|
||
namespace Tavenem.Wiki.Blazor.Example.Client.Services; | ||
|
||
public class CustomOfflineManager : IOfflineManager | ||
{ | ||
/// <inheritdoc /> | ||
public ValueTask<bool> CanEditOfflineAsync(string title, string wikiNamespace, string? domain) | ||
=> ValueTask.FromResult(true); | ||
|
||
/// <inheritdoc /> | ||
public ValueTask<bool> IsOfflineDomainAsync(string domain) | ||
=> ValueTask.FromResult(false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
sample/WebAssembly Example/Services/CustomOfflineManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Tavenem.Wiki.Blazor.Client.Services; | ||
|
||
namespace Tavenem.Wiki.Blazor.Sample.Services; | ||
|
||
public class CustomOfflineManager : IOfflineManager | ||
{ | ||
/// <inheritdoc /> | ||
public ValueTask<bool> CanEditOfflineAsync(string title, string wikiNamespace, string? domain) | ||
=> ValueTask.FromResult(true); | ||
|
||
/// <inheritdoc /> | ||
public ValueTask<bool> IsOfflineDomainAsync(string domain) | ||
=> ValueTask.FromResult(false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters