2021-01-19 18:29:14 +11:00
|
|
|
using Umbraco.Core.Configuration;
|
2020-03-03 11:18:54 +00:00
|
|
|
|
|
|
|
|
namespace Umbraco.Configuration
|
2019-06-24 11:58:36 +02:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Provides extensions for the <see cref="ModelsMode"/> enumeration.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class ModelsModeExtensions
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a value indicating whether the mode is LiveAnything or PureLive.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static bool IsLive(this ModelsMode modelsMode)
|
2021-01-19 18:29:14 +11:00
|
|
|
=> modelsMode == ModelsMode.PureLive || modelsMode == ModelsMode.LiveAppData;
|
2019-06-24 11:58:36 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a value indicating whether the mode is LiveAnything but not PureLive.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static bool IsLiveNotPure(this ModelsMode modelsMode)
|
2021-01-19 18:29:14 +11:00
|
|
|
=> modelsMode == ModelsMode.LiveAppData;
|
2019-06-24 11:58:36 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a value indicating whether the mode supports explicit generation (as opposed to pure live).
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static bool SupportsExplicitGeneration(this ModelsMode modelsMode)
|
2021-01-19 18:29:14 +11:00
|
|
|
=> modelsMode == ModelsMode.AppData || modelsMode == ModelsMode.LiveAppData;
|
2019-06-24 11:58:36 +02:00
|
|
|
}
|
|
|
|
|
}
|