-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependencies, move net50 to net60
- Loading branch information
Showing
18 changed files
with
604 additions
and
619 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
using System.Threading.Tasks; | ||
|
||
namespace Axuno.TextTemplating | ||
namespace Axuno.TextTemplating; | ||
|
||
public interface ITemplateContentProvider | ||
{ | ||
public interface ITemplateContentProvider | ||
{ | ||
Task<string?> GetContentAsync( | ||
string templateName, | ||
string? cultureName = null, | ||
bool tryDefaults = true, | ||
bool useCurrentCultureIfCultureNameIsNull = true | ||
); | ||
Task<string?> GetContentAsync( | ||
string templateName, | ||
string? cultureName = null, | ||
bool tryDefaults = true, | ||
bool useCurrentCultureIfCultureNameIsNull = true | ||
); | ||
|
||
Task<string?> GetContentAsync( | ||
TemplateDefinition templateDefinition, | ||
string? cultureName = null, | ||
bool tryDefaults = true, | ||
bool useCurrentCultureIfCultureNameIsNull = true | ||
); | ||
} | ||
} | ||
Task<string?> GetContentAsync( | ||
TemplateDefinition templateDefinition, | ||
string? cultureName = null, | ||
bool tryDefaults = true, | ||
bool useCurrentCultureIfCultureNameIsNull = true | ||
); | ||
} |
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 |
---|---|---|
@@ -1,13 +1,12 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Axuno.TextTemplating | ||
namespace Axuno.TextTemplating; | ||
|
||
public interface ITemplateDefinitionContext | ||
{ | ||
public interface ITemplateDefinitionContext | ||
{ | ||
IReadOnlyList<TemplateDefinition> GetAll(string name); | ||
IReadOnlyList<TemplateDefinition> GetAll(string name); | ||
|
||
TemplateDefinition? Get(string name); | ||
TemplateDefinition? Get(string name); | ||
|
||
void Add(params TemplateDefinition[] definitions); | ||
} | ||
} | ||
void Add(params TemplateDefinition[] definitions); | ||
} |
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 |
---|---|---|
@@ -1,12 +1,11 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Axuno.TextTemplating | ||
namespace Axuno.TextTemplating; | ||
|
||
public interface ITemplateDefinitionManager | ||
{ | ||
public interface ITemplateDefinitionManager | ||
{ | ||
|
||
TemplateDefinition? Get(string name); | ||
TemplateDefinition? Get(string name); | ||
|
||
IReadOnlyList<TemplateDefinition> GetAll(); | ||
} | ||
} | ||
IReadOnlyList<TemplateDefinition> GetAll(); | ||
} |
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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
namespace Axuno.TextTemplating | ||
namespace Axuno.TextTemplating; | ||
|
||
public interface ITemplateDefinitionProvider | ||
{ | ||
public interface ITemplateDefinitionProvider | ||
{ | ||
void PreDefine(ITemplateDefinitionContext context); | ||
void PreDefine(ITemplateDefinitionContext context); | ||
|
||
void Define(ITemplateDefinitionContext context); | ||
void Define(ITemplateDefinitionContext context); | ||
|
||
void PostDefine(ITemplateDefinitionContext context); | ||
} | ||
} | ||
void PostDefine(ITemplateDefinitionContext context); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Axuno.TextTemplating | ||
namespace Axuno.TextTemplating; | ||
|
||
/// <summary> | ||
/// A shortcut for <see cref="ITypeList{TBaseType}"/> to use object as base type. | ||
/// </summary> | ||
public interface ITypeList : ITypeList<object> | ||
{ } | ||
|
||
/// <summary> | ||
/// Extends <see cref="IList{Type}"/> to add restriction a specific base type. | ||
/// </summary> | ||
/// <typeparam name="TBaseType">Base Type of <see cref="Type"/>s in this list</typeparam> | ||
public interface ITypeList<in TBaseType> : IList<Type> | ||
{ | ||
/// <summary> | ||
/// A shortcut for <see cref="ITypeList{TBaseType}"/> to use object as base type. | ||
/// Adds a type to list. | ||
/// </summary> | ||
public interface ITypeList : ITypeList<object> | ||
{ } | ||
/// <typeparam name="T">Type</typeparam> | ||
void Add<T>() where T : TBaseType; | ||
|
||
/// <summary> | ||
/// Extends <see cref="IList{Type}"/> to add restriction a specific base type. | ||
/// Adds a type to list if it's not already in the list. | ||
/// </summary> | ||
/// <typeparam name="TBaseType">Base Type of <see cref="Type"/>s in this list</typeparam> | ||
public interface ITypeList<in TBaseType> : IList<Type> | ||
{ | ||
/// <summary> | ||
/// Adds a type to list. | ||
/// </summary> | ||
/// <typeparam name="T">Type</typeparam> | ||
void Add<T>() where T : TBaseType; | ||
/// <typeparam name="T">Type</typeparam> | ||
bool TryAdd<T>() where T : TBaseType; | ||
|
||
/// <summary> | ||
/// Adds a type to list if it's not already in the list. | ||
/// </summary> | ||
/// <typeparam name="T">Type</typeparam> | ||
bool TryAdd<T>() where T : TBaseType; | ||
|
||
/// <summary> | ||
/// Checks if a type exists in the list. | ||
/// </summary> | ||
/// <typeparam name="T">Type</typeparam> | ||
/// <returns></returns> | ||
bool Contains<T>() where T : TBaseType; | ||
/// <summary> | ||
/// Checks if a type exists in the list. | ||
/// </summary> | ||
/// <typeparam name="T">Type</typeparam> | ||
/// <returns></returns> | ||
bool Contains<T>() where T : TBaseType; | ||
|
||
/// <summary> | ||
/// Removes a type from list | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
void Remove<T>() where T : TBaseType; | ||
} | ||
} | ||
/// <summary> | ||
/// Removes a type from list | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
void Remove<T>() where T : TBaseType; | ||
} |
31 changes: 15 additions & 16 deletions
31
Src/Axuno.TextTemplating/TemplateContentContributorContext.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 |
---|---|---|
@@ -1,25 +1,24 @@ | ||
using System; | ||
|
||
|
||
namespace Axuno.TextTemplating | ||
namespace Axuno.TextTemplating; | ||
|
||
public class TemplateContentContributorContext | ||
{ | ||
public class TemplateContentContributorContext | ||
{ | ||
|
||
public TemplateDefinition TemplateDefinition { get; } | ||
public TemplateDefinition TemplateDefinition { get; } | ||
|
||
public IServiceProvider ServiceProvider { get; } | ||
public IServiceProvider ServiceProvider { get; } | ||
|
||
public string? Culture { get; } | ||
public string? Culture { get; } | ||
|
||
public TemplateContentContributorContext( | ||
TemplateDefinition templateDefinition, | ||
IServiceProvider serviceProvider, | ||
string? culture) | ||
{ | ||
TemplateDefinition = Check.NotNull(templateDefinition, nameof(templateDefinition)); | ||
ServiceProvider = Check.NotNull(serviceProvider, nameof(serviceProvider)); | ||
Culture = culture; | ||
} | ||
public TemplateContentContributorContext( | ||
TemplateDefinition templateDefinition, | ||
IServiceProvider serviceProvider, | ||
string? culture) | ||
{ | ||
TemplateDefinition = Check.NotNull(templateDefinition, nameof(templateDefinition)); | ||
ServiceProvider = Check.NotNull(serviceProvider, nameof(serviceProvider)); | ||
Culture = culture; | ||
} | ||
} | ||
} |
Oops, something went wrong.