2013-09-05 17:47:13 +02:00
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Core.Models.PublishedContent
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Provides a base class for <c>IPublishedProperty</c> implementations which converts and caches
|
|
|
|
|
/// the value source to the actual value to use when rendering content.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal abstract class PublishedPropertyBase : IPublishedProperty
|
|
|
|
|
{
|
|
|
|
|
public readonly PublishedPropertyType PropertyType;
|
|
|
|
|
|
|
|
|
|
protected PublishedPropertyBase(PublishedPropertyType propertyType)
|
|
|
|
|
{
|
|
|
|
|
if (propertyType == null)
|
|
|
|
|
throw new ArgumentNullException("propertyType");
|
|
|
|
|
PropertyType = propertyType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Alias
|
|
|
|
|
{
|
2013-09-19 12:06:37 +02:00
|
|
|
get { return PropertyType.PropertyTypeAlias; }
|
2013-09-05 17:47:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// these have to be provided by the actual implementation
|
|
|
|
|
public abstract bool HasValue { get; }
|
|
|
|
|
public abstract object RawValue { get; }
|
|
|
|
|
public abstract object Value { get; }
|
|
|
|
|
public abstract object XPathValue { get; }
|
|
|
|
|
}
|
|
|
|
|
}
|