mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.3 KiB
60 lines
1.3 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschränkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using System;
|
|
|
|
namespace Squidex.Domain.Apps.Core.Schemas
|
|
{
|
|
public abstract class NamedElementPropertiesBase
|
|
{
|
|
private string label;
|
|
private string hints;
|
|
|
|
protected bool IsFrozen { get; private set; }
|
|
|
|
public string Label
|
|
{
|
|
get
|
|
{
|
|
return label;
|
|
}
|
|
set
|
|
{
|
|
ThrowIfFrozen();
|
|
|
|
label = value;
|
|
}
|
|
}
|
|
|
|
public string Hints
|
|
{
|
|
get
|
|
{
|
|
return hints;
|
|
}
|
|
set
|
|
{
|
|
ThrowIfFrozen();
|
|
|
|
hints = value;
|
|
}
|
|
}
|
|
|
|
protected void ThrowIfFrozen()
|
|
{
|
|
if (IsFrozen)
|
|
{
|
|
throw new InvalidOperationException("Object is frozen.");
|
|
}
|
|
}
|
|
|
|
public void Freeze()
|
|
{
|
|
IsFrozen = true;
|
|
}
|
|
}
|
|
}
|