PropertySet => PublishedElement

This commit is contained in:
Stephan
2017-09-25 08:59:32 +02:00
parent 057d1a3395
commit d61ca898c4
64 changed files with 192 additions and 190 deletions

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
namespace Umbraco.Core.Models.PublishedContent
{
/// <summary>
/// Provides an abstract base class for <c>IPublishedElement</c> implementations that
/// wrap and extend another <c>IPublishedElement</c>.
/// </summary>
public abstract class PublishedElementWrapped : IPublishedElement
{
private readonly IPublishedElement _content;
/// <summary>
/// Initializes a new instance of the <see cref="PublishedElementWrapped"/> class
/// with an <c>IPublishedElement</c> instance to wrap.
/// </summary>
/// <param name="content">The content to wrap.</param>
protected PublishedElementWrapped(IPublishedElement content)
{
_content = content;
}
/// <summary>
/// Gets the wrapped content.
/// </summary>
/// <returns>The wrapped content, that was passed as an argument to the constructor.</returns>
public IPublishedElement Unwrap() => _content;
/// <inheritdoc />
public PublishedContentType ContentType => _content.ContentType;
/// <inheritdoc />
public Guid Key => _content.Key;
/// <inheritdoc />
public IEnumerable<IPublishedProperty> Properties => _content.Properties;
/// <inheritdoc />
public IPublishedProperty GetProperty(string alias) => _content.GetProperty(alias);
}
}