-
-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BlazoriseLicenseLimitsHelper | Null check BlazoriseLicenseChecker and…
… provide sane defaults for unlicensed user limits
- Loading branch information
1 parent
703b618
commit 46baa6d
Showing
8 changed files
with
74 additions
and
15 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
57 changes: 57 additions & 0 deletions
57
Source/Blazorise/Licensing/BlazoriseLicenseLimitsHelper.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,57 @@ | ||
namespace Blazorise.Licensing; | ||
|
||
/// <summary> | ||
/// Ultimately provides sane defaults for Blazorise licensing, in case required scoped services are not provided | ||
/// </summary> | ||
public static class BlazoriseLicenseLimitsHelper | ||
{ | ||
/// <summary> | ||
/// Returns the maximum number of rows that can be displayed. | ||
/// Null if no limit is set. | ||
/// </summary> | ||
/// <returns></returns> | ||
public static int? GetDataGridRowsLimit( BlazoriseLicenseChecker blazoriseLicenseChecker ) | ||
{ | ||
return blazoriseLicenseChecker is null ? BlazoriseLicenseProvider.DEFAULT_UNLICENSED_LIMIT_DATAGRID_MAX_ROWS : blazoriseLicenseChecker.GetDataGridRowsLimit(); | ||
} | ||
|
||
/// <summary> | ||
/// Returns the maximum number of rows that can be displayed. | ||
/// Null if no limit is set. | ||
/// </summary> | ||
/// <returns></returns> | ||
public static int? GetAutocompleteRowsLimit( BlazoriseLicenseChecker blazoriseLicenseChecker ) | ||
{ | ||
return blazoriseLicenseChecker is null ? BlazoriseLicenseProvider.DEFAULT_UNLICENSED_LIMIT_AUTOCOMPLETE_MAX_ROWS : blazoriseLicenseChecker.GetAutocompleteRowsLimit(); | ||
} | ||
|
||
/// <summary> | ||
/// Returns the maximum number of rows that can be displayed. | ||
/// Null if no limit is set. | ||
/// </summary> | ||
/// <returns></returns> | ||
public static int? GetChartsRowsLimit( BlazoriseLicenseChecker blazoriseLicenseChecker ) | ||
{ | ||
return blazoriseLicenseChecker is null ? BlazoriseLicenseProvider.DEFAULT_UNLICENSED_LIMIT_CHARTS_MAX_ROWS : blazoriseLicenseChecker.GetChartsRowsLimit(); | ||
} | ||
|
||
/// <summary> | ||
/// Returns the maximum number of rows that can be displayed. | ||
/// Null if no limit is set. | ||
/// </summary> | ||
/// <returns></returns> | ||
public static int? GetListViewRowsLimit( BlazoriseLicenseChecker blazoriseLicenseChecker ) | ||
{ | ||
return blazoriseLicenseChecker is null ? BlazoriseLicenseProvider.DEFAULT_UNLICENSED_LIMIT_LISTVIEW_MAX_ROWS : blazoriseLicenseChecker.GetListViewRowsLimit(); | ||
} | ||
|
||
/// <summary> | ||
/// Returns the maximum number of rows that can be displayed. | ||
/// Null if no limit is set. | ||
/// </summary> | ||
/// <returns></returns> | ||
public static int? GetTreeViewRowsLimit( BlazoriseLicenseChecker blazoriseLicenseChecker ) | ||
{ | ||
return blazoriseLicenseChecker is null ? BlazoriseLicenseProvider.DEFAULT_UNLICENSED_LIMIT_TREEVIEW_MAX_ROWS : blazoriseLicenseChecker.GetTreeViewRowsLimit(); | ||
} | ||
} |
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
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