From aa288877be7ccfc7b271c6565ebe43aba91d4384 Mon Sep 17 00:00:00 2001 From: "Morten@Thinkpad-X220" Date: Wed, 3 Oct 2012 08:12:04 -0200 Subject: [PATCH] Renaming IDocumentProperty to IPublishedContentProperty --- src/Umbraco.Core/Dynamics/DynamicPublishedContent.cs | 10 +++++----- src/Umbraco.Core/Dynamics/PropertyResult.cs | 4 ++-- src/Umbraco.Core/Models/IPublishedContent.cs | 4 ++-- ...umentProperty.cs => IPublishedContentProperty.cs} | 2 +- src/Umbraco.Core/Umbraco.Core.csproj | 2 +- src/Umbraco.Tests/DynamicDocument/DocumentTests.cs | 8 ++++---- src/Umbraco.Web/DefaultPublishedMediaStore.cs | 12 ++++++------ src/Umbraco.Web/DocumentExtensions.cs | 2 +- src/Umbraco.Web/Models/XmlDocumentProperty.cs | 2 +- src/Umbraco.Web/Models/XmlPublishedContent.cs | 6 +++--- .../RazorDynamicNode/DynamicDocumentExtensions.cs | 2 +- 11 files changed, 27 insertions(+), 27 deletions(-) rename src/Umbraco.Core/Models/{IDocumentProperty.cs => IPublishedContentProperty.cs} (70%) diff --git a/src/Umbraco.Core/Dynamics/DynamicPublishedContent.cs b/src/Umbraco.Core/Dynamics/DynamicPublishedContent.cs index efc97dba7a..4ac3f5a342 100644 --- a/src/Umbraco.Core/Dynamics/DynamicPublishedContent.cs +++ b/src/Umbraco.Core/Dynamics/DynamicPublishedContent.cs @@ -941,7 +941,7 @@ namespace Umbraco.Core.Dynamics get { return _publishedContent.Level; } } - public IEnumerable Properties + public IEnumerable Properties { get { return _publishedContent.Properties; } } @@ -969,11 +969,11 @@ namespace Umbraco.Core.Dynamics #region GetProperty methods which can be used with the dynamic object - public IDocumentProperty GetProperty(string alias) + public IPublishedContentProperty GetProperty(string alias) { return GetProperty(alias, false); } - public IDocumentProperty GetProperty(string alias, bool recursive) + public IPublishedContentProperty GetProperty(string alias, bool recursive) { return alias.StartsWith("@") ? GetReflectedProperty(alias.TrimStart('@')) @@ -1497,7 +1497,7 @@ namespace Umbraco.Core.Dynamics get { return _publishedContent.Level; } } - System.Collections.ObjectModel.Collection IPublishedContent.Properties + System.Collections.ObjectModel.Collection IPublishedContent.Properties { get { return _publishedContent.Properties; } } @@ -1507,7 +1507,7 @@ namespace Umbraco.Core.Dynamics get { return _publishedContent.Children; } } - IDocumentProperty IPublishedContent.GetProperty(string alias) + IPublishedContentProperty IPublishedContent.GetProperty(string alias) { return _publishedContent.GetProperty(alias); } diff --git a/src/Umbraco.Core/Dynamics/PropertyResult.cs b/src/Umbraco.Core/Dynamics/PropertyResult.cs index bcabfd05e4..7b50b34c5c 100644 --- a/src/Umbraco.Core/Dynamics/PropertyResult.cs +++ b/src/Umbraco.Core/Dynamics/PropertyResult.cs @@ -5,9 +5,9 @@ using System.Web; namespace Umbraco.Core.Dynamics { - internal class PropertyResult : IDocumentProperty, IHtmlString + internal class PropertyResult : IPublishedContentProperty, IHtmlString { - internal PropertyResult(IDocumentProperty source, PropertyResultType type) + internal PropertyResult(IPublishedContentProperty source, PropertyResultType type) { if (source == null) throw new ArgumentNullException("source"); diff --git a/src/Umbraco.Core/Models/IPublishedContent.cs b/src/Umbraco.Core/Models/IPublishedContent.cs index c9695ad52a..869a6ae696 100644 --- a/src/Umbraco.Core/Models/IPublishedContent.cs +++ b/src/Umbraco.Core/Models/IPublishedContent.cs @@ -30,7 +30,7 @@ namespace Umbraco.Core.Models DateTime UpdateDate { get; } Guid Version { get; } int Level { get; } - Collection Properties { get; } + Collection Properties { get; } IEnumerable Children { get; } /// @@ -46,6 +46,6 @@ namespace Umbraco.Core.Models /// In some cases Pulish Stores, a property value may exist in multiple places and we need to fallback to different cached locations /// therefore sometimes the 'Properties' collection may not be sufficient. /// - IDocumentProperty GetProperty(string alias); + IPublishedContentProperty GetProperty(string alias); } } \ No newline at end of file diff --git a/src/Umbraco.Core/Models/IDocumentProperty.cs b/src/Umbraco.Core/Models/IPublishedContentProperty.cs similarity index 70% rename from src/Umbraco.Core/Models/IDocumentProperty.cs rename to src/Umbraco.Core/Models/IPublishedContentProperty.cs index 67494c92e6..6361c29683 100644 --- a/src/Umbraco.Core/Models/IDocumentProperty.cs +++ b/src/Umbraco.Core/Models/IPublishedContentProperty.cs @@ -2,7 +2,7 @@ using System; namespace Umbraco.Core.Models { - public interface IDocumentProperty + public interface IPublishedContentProperty { string Alias { get; } object Value { get; } diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 225322eb1f..5da4fcda1e 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -159,7 +159,7 @@ - + diff --git a/src/Umbraco.Tests/DynamicDocument/DocumentTests.cs b/src/Umbraco.Tests/DynamicDocument/DocumentTests.cs index edf68d6b71..cf66f1c833 100644 --- a/src/Umbraco.Tests/DynamicDocument/DocumentTests.cs +++ b/src/Umbraco.Tests/DynamicDocument/DocumentTests.cs @@ -137,8 +137,8 @@ namespace Umbraco.Tests.DynamicDocument WriterName = "Shannon", Parent = null, Level = 1, - Properties = new Collection( - new List() + Properties = new Collection( + new List() { new PropertyResult("property1", "value" + indexVals, Guid.NewGuid(), PropertyResultType.UserProperty), new PropertyResult("property2", "value" + (indexVals + 1), Guid.NewGuid(), PropertyResultType.UserProperty) @@ -186,9 +186,9 @@ namespace Umbraco.Tests.DynamicDocument public DateTime UpdateDate { get; set; } public Guid Version { get; set; } public int Level { get; set; } - public Collection Properties { get; set; } + public Collection Properties { get; set; } public IEnumerable Children { get; set; } - public IDocumentProperty GetProperty(string alias) + public IPublishedContentProperty GetProperty(string alias) { return Properties.FirstOrDefault(x => x.Alias.InvariantEquals(alias)); } diff --git a/src/Umbraco.Web/DefaultPublishedMediaStore.cs b/src/Umbraco.Web/DefaultPublishedMediaStore.cs index 344964da6e..7f2289d088 100644 --- a/src/Umbraco.Web/DefaultPublishedMediaStore.cs +++ b/src/Umbraco.Web/DefaultPublishedMediaStore.cs @@ -167,7 +167,7 @@ namespace Umbraco.Web /// /// /// - private IDocumentProperty GetProperty(DictionaryPublishedContent dd, string alias) + private IPublishedContentProperty GetProperty(DictionaryPublishedContent dd, string alias) { if (dd.LoadedFromExamine) { @@ -285,7 +285,7 @@ namespace Umbraco.Web IDictionary valueDictionary, Func getParent, Func> getChildren, - Func getProperty) + Func getProperty) { if (valueDictionary == null) throw new ArgumentNullException("valueDictionary"); if (getParent == null) throw new ArgumentNullException("getParent"); @@ -322,7 +322,7 @@ namespace Umbraco.Web } }, "parentID"); - Properties = new Collection(); + Properties = new Collection(); //loop through remaining values that haven't been applied foreach (var i in valueDictionary.Where(x => !_keysAdded.Contains(x.Key))) @@ -341,7 +341,7 @@ namespace Umbraco.Web private readonly Func _getParent; private readonly Func> _getChildren; - private readonly Func _getProperty; + private readonly Func _getProperty; public IPublishedContent Parent { @@ -365,13 +365,13 @@ namespace Umbraco.Web public DateTime UpdateDate { get; private set; } public Guid Version { get; private set; } public int Level { get; private set; } - public Collection Properties { get; private set; } + public Collection Properties { get; private set; } public IEnumerable Children { get { return _getChildren(this); } } - public IDocumentProperty GetProperty(string alias) + public IPublishedContentProperty GetProperty(string alias) { return _getProperty(this, alias); } diff --git a/src/Umbraco.Web/DocumentExtensions.cs b/src/Umbraco.Web/DocumentExtensions.cs index a2e783e1ec..647d0d694c 100644 --- a/src/Umbraco.Web/DocumentExtensions.cs +++ b/src/Umbraco.Web/DocumentExtensions.cs @@ -80,7 +80,7 @@ namespace Umbraco.Web {"Url", urlProvider.GetNiceUrl(n.Id)} }; var userVals = new Dictionary(); - foreach (var p in from IDocumentProperty p in n.Properties where p.Value != null select p) + foreach (var p in from IPublishedContentProperty p in n.Properties where p.Value != null select p) { userVals[p.Alias] = p.Value; } diff --git a/src/Umbraco.Web/Models/XmlDocumentProperty.cs b/src/Umbraco.Web/Models/XmlDocumentProperty.cs index 7affc17852..20b9bf975e 100644 --- a/src/Umbraco.Web/Models/XmlDocumentProperty.cs +++ b/src/Umbraco.Web/Models/XmlDocumentProperty.cs @@ -15,7 +15,7 @@ namespace Umbraco.Web.Models /// [Serializable] [XmlType(Namespace = "http://umbraco.org/webservices/")] - public class XmlDocumentProperty : IDocumentProperty + public class XmlDocumentProperty : IPublishedContentProperty { private readonly Guid _version; private readonly string _alias; diff --git a/src/Umbraco.Web/Models/XmlPublishedContent.cs b/src/Umbraco.Web/Models/XmlPublishedContent.cs index d603e2ef5a..724b5a0323 100644 --- a/src/Umbraco.Web/Models/XmlPublishedContent.cs +++ b/src/Umbraco.Web/Models/XmlPublishedContent.cs @@ -60,7 +60,7 @@ namespace Umbraco.Web.Models private DateTime _createDate; private DateTime _updateDate; private Guid _version; - private readonly Collection _properties = new Collection(); + private readonly Collection _properties = new Collection(); private readonly XmlNode _pageXmlNode; private int _sortOrder; private int _level; @@ -75,7 +75,7 @@ namespace Umbraco.Web.Models } } - public IDocumentProperty GetProperty(string alias) + public IPublishedContentProperty GetProperty(string alias) { return Properties.FirstOrDefault(x => x.Alias.InvariantEquals(alias)); } @@ -251,7 +251,7 @@ namespace Umbraco.Web.Models } } - public Collection Properties + public Collection Properties { get { diff --git a/src/umbraco.MacroEngines/RazorDynamicNode/DynamicDocumentExtensions.cs b/src/umbraco.MacroEngines/RazorDynamicNode/DynamicDocumentExtensions.cs index fbfdc549a9..eb8e516d11 100644 --- a/src/umbraco.MacroEngines/RazorDynamicNode/DynamicDocumentExtensions.cs +++ b/src/umbraco.MacroEngines/RazorDynamicNode/DynamicDocumentExtensions.cs @@ -16,7 +16,7 @@ namespace umbraco.MacroEngines.Library internal static class DynamicDocumentExtensions { - internal static IProperty ConvertToNodeProperty(this IDocumentProperty prop) + internal static IProperty ConvertToNodeProperty(this IPublishedContentProperty prop) { return new PropertyResult(prop.Alias, prop.Value.ToString(), prop.Version); }