diff --git a/src/Umbraco.Core/ObjectResolution/ApplicationEventsResolver.cs b/src/Umbraco.Core/ObjectResolution/ApplicationEventsResolver.cs index be94d7a3b9..6933279258 100644 --- a/src/Umbraco.Core/ObjectResolution/ApplicationEventsResolver.cs +++ b/src/Umbraco.Core/ObjectResolution/ApplicationEventsResolver.cs @@ -15,7 +15,6 @@ namespace Umbraco.Core.ObjectResolution /// public sealed class ApplicationEventsResolver : ManyObjectsResolverBase, IDisposable { - private readonly LegacyStartupHandlerResolver _legacyResolver; /// @@ -23,7 +22,7 @@ namespace Umbraco.Core.ObjectResolution /// /// /// - /// + /// internal ApplicationEventsResolver(IServiceProvider serviceProvider, ILogger logger, IEnumerable applicationEventHandlers) : base(serviceProvider, logger, applicationEventHandlers) { @@ -34,7 +33,7 @@ namespace Umbraco.Core.ObjectResolution } /// - /// Override in order to only return types of IApplicationEventHandler and above, + /// Override in order to only return types of IApplicationEventHandler and above, /// do not include the legacy types of IApplicationStartupHandler /// protected override IEnumerable InstanceTypes @@ -69,7 +68,7 @@ namespace Umbraco.Core.ObjectResolution var handler = CollectionResolved; if (handler != null) handler(this, e); } - + /// /// Create instances of all of the legacy startup handlers /// @@ -82,11 +81,11 @@ namespace Umbraco.Core.ObjectResolution protected override bool SupportsClear { get { return false; } - } + } protected override bool SupportsInsert { - get { return false; } + get { return false; } } private class LegacyStartupHandlerResolver : ManyObjectsResolverBase, IDisposable @@ -171,9 +170,6 @@ namespace Umbraco.Core.ObjectResolution //Clear event handlers CollectionResolved = null; - } - - } } \ No newline at end of file diff --git a/src/Umbraco.Core/ObjectResolution/LazyManyObjectsResolverbase.cs b/src/Umbraco.Core/ObjectResolution/LazyManyObjectsResolverbase.cs index 2851a70e15..821b93ba03 100644 --- a/src/Umbraco.Core/ObjectResolution/LazyManyObjectsResolverbase.cs +++ b/src/Umbraco.Core/ObjectResolution/LazyManyObjectsResolverbase.cs @@ -17,7 +17,7 @@ namespace Umbraco.Core.ObjectResolution /// for when there is some processing overhead (i.e. Type finding in assemblies) to return the Types used to instantiate the instances. /// In some these cases we don't want to have to type-find during application startup, only when we need to resolve the instances. /// Important notes about this resolver: it does not support Insert or Remove and therefore does not support any ordering unless - /// the types are marked with the WeightedPluginAttribute. + /// the types are marked with the WeightAttribute. /// public abstract class LazyManyObjectsResolverBase : ManyObjectsResolverBase where TResolved : class diff --git a/src/Umbraco.Core/ObjectResolution/ManyObjectsResolverBase.cs b/src/Umbraco.Core/ObjectResolution/ManyObjectsResolverBase.cs index 1cfa81228a..3519bf86bc 100644 --- a/src/Umbraco.Core/ObjectResolution/ManyObjectsResolverBase.cs +++ b/src/Umbraco.Core/ObjectResolution/ManyObjectsResolverBase.cs @@ -23,7 +23,7 @@ namespace Umbraco.Core.ObjectResolution private readonly List _instanceTypes = new List(); private IEnumerable _sortedValues; - private int _defaultPluginWeight = 10; + private int _defaultPluginWeight = 100; #region Constructors @@ -179,7 +179,7 @@ namespace Umbraco.Core.ObjectResolution /// /// The sorted resolved object instances. /// - /// The order is based upon the WeightedPluginAttribute and DefaultPluginWeight. + /// The order is based upon the WeightAttribute and DefaultPluginWeight. /// Weights are sorted ascendingly (lowest weights come first). /// protected IEnumerable GetSortedValues() @@ -196,7 +196,7 @@ namespace Umbraco.Core.ObjectResolution /// /// Gets or sets the default type weight. /// - /// Determines the weight of types that do not have a WeightedPluginAttribute set on + /// Determines the weight of types that do not have a WeightAttribute set on /// them, when calling GetSortedValues. protected virtual int DefaultPluginWeight { @@ -212,7 +212,7 @@ namespace Umbraco.Core.ObjectResolution protected virtual int GetObjectWeight(object o) { var type = o.GetType(); - var attr = type.GetCustomAttribute(true); + var attr = type.GetCustomAttribute(true); return attr == null ? DefaultPluginWeight : attr.Weight; } diff --git a/src/Umbraco.Core/ObjectResolution/WeightedPluginAttribute.cs b/src/Umbraco.Core/ObjectResolution/WeightedPluginAttribute.cs deleted file mode 100644 index 69c763ed50..0000000000 --- a/src/Umbraco.Core/ObjectResolution/WeightedPluginAttribute.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; - -namespace Umbraco.Core.ObjectResolution -{ - /// - /// Indicates the relative weight of a resolved object type. - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] - public class WeightedPluginAttribute : Attribute - { - /// - /// Initializes a new instance of the class with a weight. - /// - /// The object type weight. - public WeightedPluginAttribute(int weight) - { - Weight = weight; - } - - /// - /// Gets or sets the weight of the object type. - /// - public int Weight { get; private set; } - } -} \ No newline at end of file diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 3c58503b57..dbd5199009 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -1204,7 +1204,7 @@ - + diff --git a/src/Umbraco.Tests/Resolvers/ManyResolverTests.cs b/src/Umbraco.Tests/Resolvers/ManyResolverTests.cs index 4cf1c3b56f..3ec470de4b 100644 --- a/src/Umbraco.Tests/Resolvers/ManyResolverTests.cs +++ b/src/Umbraco.Tests/Resolvers/ManyResolverTests.cs @@ -36,7 +36,7 @@ namespace Umbraco.Tests.Resolvers public class Resolved1 : Resolved { } - [WeightedPlugin(5)] // default is 10 + [Weight(5)] // default is 100 public class Resolved2 : Resolved { } diff --git a/src/Umbraco.Web/Media/ThumbnailProviders/FileExtensionIconThumbnailProvider.cs b/src/Umbraco.Web/Media/ThumbnailProviders/FileExtensionIconThumbnailProvider.cs index 4d6489cb2c..8699592467 100644 --- a/src/Umbraco.Web/Media/ThumbnailProviders/FileExtensionIconThumbnailProvider.cs +++ b/src/Umbraco.Web/Media/ThumbnailProviders/FileExtensionIconThumbnailProvider.cs @@ -8,7 +8,7 @@ using Umbraco.Core.IO; namespace Umbraco.Web.Media.ThumbnailProviders { - [WeightedPlugin(2000)] + [Weight(2000)] public class FileExtensionIconThumbnailProvider : AbstractThumbnailProvider { protected override IEnumerable SupportedExtensions diff --git a/src/Umbraco.Web/Media/ThumbnailProviders/ImageThumbnailProvider.cs b/src/Umbraco.Web/Media/ThumbnailProviders/ImageThumbnailProvider.cs index 6f9b26c79d..56fe6306e3 100644 --- a/src/Umbraco.Web/Media/ThumbnailProviders/ImageThumbnailProvider.cs +++ b/src/Umbraco.Web/Media/ThumbnailProviders/ImageThumbnailProvider.cs @@ -10,7 +10,7 @@ using Umbraco.Core.IO; namespace Umbraco.Web.Media.ThumbnailProviders { - [WeightedPlugin(1000)] + [Weight(1000)] public class ImageThumbnailProvider : AbstractThumbnailProvider { protected override IEnumerable SupportedExtensions diff --git a/src/Umbraco.Web/Media/ThumbnailProviders/MediaTypeIconThumbnailProvider.cs b/src/Umbraco.Web/Media/ThumbnailProviders/MediaTypeIconThumbnailProvider.cs index be1e6b4b42..6112d60471 100644 --- a/src/Umbraco.Web/Media/ThumbnailProviders/MediaTypeIconThumbnailProvider.cs +++ b/src/Umbraco.Web/Media/ThumbnailProviders/MediaTypeIconThumbnailProvider.cs @@ -8,7 +8,7 @@ using Umbraco.Core.IO; namespace Umbraco.Web.Media.ThumbnailProviders { - [WeightedPlugin(3000)] + [Weight(3000)] public class MediaTypeIconThumbnailProvider : AbstractThumbnailProvider {