2018-06-29 19:52:40 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Runtime.Serialization;
|
2021-02-18 11:06:02 +01:00
|
|
|
|
using Umbraco.Cms.Core.Models.Entities;
|
2018-06-29 19:52:40 +02:00
|
|
|
|
|
2021-02-18 11:06:02 +01:00
|
|
|
|
namespace Umbraco.Cms.Core.Models
|
2018-06-29 19:52:40 +02:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents a Stylesheet Property
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// Properties are always formatted to have a single selector, so it can be used in the backoffice
|
|
|
|
|
|
/// </remarks>
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
|
[DataContract(IsReference = true)]
|
2019-11-12 13:33:02 +11:00
|
|
|
|
public class StylesheetProperty : BeingDirtyBase, IValueObject, IStylesheetProperty
|
2018-06-29 19:52:40 +02:00
|
|
|
|
{
|
|
|
|
|
|
private string _alias;
|
|
|
|
|
|
private string _value;
|
|
|
|
|
|
|
|
|
|
|
|
public StylesheetProperty(string name, string @alias, string value)
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = name;
|
|
|
|
|
|
_alias = alias;
|
|
|
|
|
|
_value = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The CSS rule name that can be used by Umbraco in the back office
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Name { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// This is the CSS Selector
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Alias
|
|
|
|
|
|
{
|
2019-02-04 19:52:04 +11:00
|
|
|
|
get => _alias;
|
|
|
|
|
|
set => SetPropertyValueAndDetectChanges(value, ref _alias, nameof(Alias));
|
2018-06-29 19:52:40 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The CSS value for the selector
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string Value
|
|
|
|
|
|
{
|
2019-02-04 19:52:04 +11:00
|
|
|
|
get => _value;
|
|
|
|
|
|
set => SetPropertyValueAndDetectChanges(value, ref _value, nameof(Value));
|
2018-06-29 19:52:40 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|