Back to IPublishedContentProperty (for 6 only)

This commit is contained in:
Stephan
2014-04-30 16:35:12 +02:00
parent 7d8da56dcb
commit cd5581bef6
24 changed files with 76 additions and 76 deletions

View File

@@ -11,7 +11,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
class PublishedFragment : PublishedContentBase
{
private readonly PublishedContentType _contentType;
private readonly IPublishedProperty[] _properties;
private readonly IPublishedContentProperty[] _properties;
public PublishedFragment(string contentTypeAlias, IDictionary<string, object> dataValues,
bool isPreviewing, bool managed)
@@ -35,7 +35,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
? new PublishedFragmentProperty(x, this, dataValue)
: new PublishedFragmentProperty(x, this);
})
.Cast<IPublishedProperty>()
.Cast<IPublishedContentProperty>()
.ToArray();
}
@@ -142,12 +142,12 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
get { throw new NotImplementedException(); }
}
public override ICollection<IPublishedProperty> Properties
public override ICollection<IPublishedContentProperty> Properties
{
get { return _properties; }
}
public override IPublishedProperty GetProperty(string alias)
public override IPublishedContentProperty GetProperty(string alias)
{
return _properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(alias));
}

View File

@@ -317,7 +317,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
/// <param name="dd"> </param>
/// <param name="alias"></param>
/// <returns></returns>
private IPublishedProperty GetProperty(DictionaryPublishedContent dd, string alias)
private IPublishedContentProperty GetProperty(DictionaryPublishedContent dd, string alias)
{
if (dd.LoadedFromExamine)
{
@@ -485,7 +485,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
IDictionary<string, string> valueDictionary,
Func<DictionaryPublishedContent, IPublishedContent> getParent,
Func<DictionaryPublishedContent, IEnumerable<IPublishedContent>> getChildren,
Func<DictionaryPublishedContent, string, IPublishedProperty> getProperty,
Func<DictionaryPublishedContent, string, IPublishedContentProperty> getProperty,
bool fromExamine)
{
if (valueDictionary == null) throw new ArgumentNullException("valueDictionary");
@@ -524,12 +524,12 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
}, "parentID");
_contentType = PublishedContentType.Get(PublishedItemType.Media, _documentTypeAlias);
_properties = new Collection<IPublishedProperty>();
_properties = new Collection<IPublishedContentProperty>();
//loop through remaining values that haven't been applied
foreach (var i in valueDictionary.Where(x => !_keysAdded.Contains(x.Key)))
{
IPublishedProperty property;
IPublishedContentProperty property;
// must ignore that one
if (i.Key == "version" || i.Key == "isDoc") continue;
@@ -595,7 +595,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
private readonly Func<DictionaryPublishedContent, IPublishedContent> _getParent;
private readonly Func<DictionaryPublishedContent, IEnumerable<IPublishedContent>> _getChildren;
private readonly Func<DictionaryPublishedContent, string, IPublishedProperty> _getProperty;
private readonly Func<DictionaryPublishedContent, string, IPublishedContentProperty> _getProperty;
/// <summary>
/// Returns 'Media' as the item type
@@ -700,7 +700,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
get { return false; }
}
public override ICollection<IPublishedProperty> Properties
public override ICollection<IPublishedContentProperty> Properties
{
get { return _properties; }
}
@@ -710,7 +710,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
get { return _getChildren(this); }
}
public override IPublishedProperty GetProperty(string alias)
public override IPublishedContentProperty GetProperty(string alias)
{
return _getProperty(this, alias);
}
@@ -723,11 +723,11 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
// override to implement cache
// cache at context level, ie once for the whole request
// but cache is not shared by requests because we wouldn't know how to clear it
public override IPublishedProperty GetProperty(string alias, bool recurse)
public override IPublishedContentProperty GetProperty(string alias, bool recurse)
{
if (recurse == false) return GetProperty(alias);
IPublishedProperty property;
IPublishedContentProperty property;
string key = null;
var cache = UmbracoContextCache.Current;
@@ -737,7 +737,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
object o;
if (cache.TryGetValue(key, out o))
{
property = o as IPublishedProperty;
property = o as IPublishedContentProperty;
if (property == null)
throw new InvalidOperationException("Corrupted cache.");
return property;
@@ -770,7 +770,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
private DateTime _updateDate;
private Guid _version;
private int _level;
private readonly ICollection<IPublishedProperty> _properties;
private readonly ICollection<IPublishedContentProperty> _properties;
private readonly PublishedContentType _contentType;
private void ValidateAndSetProperty(IDictionary<string, string> valueDictionary, Action<string> setProperty, params string[] potentialKeys)

View File

@@ -77,7 +77,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
private DateTime _createDate;
private DateTime _updateDate;
private Guid _version;
private IPublishedProperty[] _properties;
private IPublishedContentProperty[] _properties;
private int _sortOrder;
private int _level;
private bool _isDraft;
@@ -96,7 +96,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
}
}
public override IPublishedProperty GetProperty(string alias)
public override IPublishedContentProperty GetProperty(string alias)
{
return Properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(alias));
}
@@ -104,7 +104,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
// override to implement cache
// cache at context level, ie once for the whole request
// but cache is not shared by requests because we wouldn't know how to clear it
public override IPublishedProperty GetProperty(string alias, bool recurse)
public override IPublishedContentProperty GetProperty(string alias, bool recurse)
{
if (recurse == false) return GetProperty(alias);
@@ -118,7 +118,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
if (value == null)
return null;
var property = value as IPublishedProperty;
var property = value as IPublishedContentProperty;
if (property == null)
throw new InvalidOperationException("Corrupted cache.");
@@ -310,7 +310,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
}
}
public override ICollection<IPublishedProperty> Properties
public override ICollection<IPublishedContentProperty> Properties
{
get
{
@@ -422,7 +422,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
return propertyNodes.TryGetValue(p.PropertyTypeAlias.ToLowerInvariant(), out n)
? new XmlPublishedProperty(p, _isPreviewing, n)
: new XmlPublishedProperty(p, _isPreviewing);
}).Cast<IPublishedProperty>().ToArray();
}).Cast<IPublishedContentProperty>().ToArray();
// warn: this is not thread-safe...
_initialized = true;