2021-02-18 11:06:02 +01:00
|
|
|
using Umbraco.Cms.Core.Configuration;
|
2020-03-03 11:18:54 +00:00
|
|
|
|
2021-02-18 11:06:02 +01:00
|
|
|
namespace Umbraco.Extensions
|
2019-06-24 11:58:36 +02:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Provides extensions for the <see cref="ModelsMode"/> enumeration.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class ModelsModeExtensions
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2021-05-26 07:36:21 +01:00
|
|
|
/// Gets a value indicating whether the mode is *Auto.
|
2019-06-24 11:58:36 +02:00
|
|
|
/// </summary>
|
2021-05-26 07:36:21 +01:00
|
|
|
public static bool IsAuto(this ModelsMode modelsMode)
|
|
|
|
|
=> modelsMode == ModelsMode.InMemoryAuto || modelsMode == ModelsMode.SourceCodeAuto;
|
2019-06-24 11:58:36 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
2021-05-26 07:36:21 +01:00
|
|
|
/// Gets a value indicating whether the mode is *Auto but not InMemory.
|
2019-06-24 11:58:36 +02:00
|
|
|
/// </summary>
|
2021-05-26 07:36:21 +01:00
|
|
|
public static bool IsAutoNotInMemory(this ModelsMode modelsMode)
|
|
|
|
|
=> modelsMode == ModelsMode.SourceCodeAuto;
|
2019-06-24 11:58:36 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
2021-05-26 07:36:21 +01:00
|
|
|
/// Gets a value indicating whether the mode supports explicit manual generation.
|
2019-06-24 11:58:36 +02:00
|
|
|
/// </summary>
|
|
|
|
|
public static bool SupportsExplicitGeneration(this ModelsMode modelsMode)
|
2021-05-26 07:36:21 +01:00
|
|
|
=> modelsMode == ModelsMode.SourceCodeManual || modelsMode == ModelsMode.SourceCodeAuto;
|
2019-06-24 11:58:36 +02:00
|
|
|
}
|
|
|
|
|
}
|