Fixes: U4-4182 Exception during plugins loading

This commit is contained in:
Shannon
2014-03-11 17:00:35 +11:00
parent 894a649574
commit 2ecab70772
7 changed files with 24 additions and 17 deletions

View File

@@ -318,11 +318,9 @@ namespace Umbraco.Core
PropertyEditorValueConvertersResolver.Current = new PropertyEditorValueConvertersResolver(
PluginManager.Current.ResolvePropertyEditorValueConverters());
//add the internal ones, these are not public currently so need to add them manually
PropertyValueConvertersResolver.Current = new PropertyValueConvertersResolver(
PluginManager.Current.ResolvePropertyValueConverters());
// fixme - why not use the following syntax?
//PluginManager.Current.ResolveTypes<IPropertyValueConverter>());
// need to filter out the ones we dont want!!
PropertyValueConvertersResolver.Current = new PropertyValueConvertersResolver(
PluginManager.Current.ResolveTypes<IPropertyValueConverter>());
// use the new DefaultShortStringHelper
ShortStringHelperResolver.Current = new ShortStringHelperResolver(

View File

@@ -0,0 +1,13 @@
using System;
namespace Umbraco.Core
{
/// <summary>
/// Used to notify the TypeFinder to ignore any class attributed with this during it's discovery
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public sealed class HideFromTypeFinderAttribute : Attribute
{
}
}

View File

@@ -269,7 +269,7 @@ namespace Umbraco.Core.Models.PublishedContent
: Enumerable.Empty<IPropertyValueConverter>();
}
class CompatConverter : PropertyValueConverterBase
private class CompatConverter : PropertyValueConverterBase
{
private readonly IPropertyEditorValueConverter _converter;

View File

@@ -507,15 +507,6 @@ namespace Umbraco.Core
return ResolveTypes<IPropertyEditorValueConverter>();
}
/// <summary>
/// Returns all available PropertyValueConverter
/// </summary>
/// <returns></returns>
internal IEnumerable<Type> ResolvePropertyValueConverters()
{
return ResolveTypes<IPropertyValueConverter>();
}
/// <summary>
/// Returns all available IDataType in application
/// </summary>

View File

@@ -525,8 +525,12 @@ namespace Umbraco.Core
//now filter the types based on the onlyConcreteClasses flag, not interfaces, not static classes
var filteredTypes = allSubTypes
.Where(t => (TypeHelper.IsNonStaticClass(t)
.Where(t => (TypeHelper.IsNonStaticClass(t)
//Do not include nested private classes - since we are in full trust now this will find those too!
&& t.IsNestedPrivate == false
&& (onlyConcreteClasses == false || t.IsAbstract == false)
//Do not include classes that are flagged to hide from the type finder
&& t.GetCustomAttribute<HideFromTypeFinderAttribute>() == null
&& additionalFilter(t)))
.ToArray();

View File

@@ -6,7 +6,7 @@ using System.Reflection;
namespace Umbraco.Core
{
/// <summary>
/// <summary>
/// A utility class for type checking, this provides internal caching so that calls to these methods will be faster
/// than doing a manual type check in c#
/// </summary>

View File

@@ -304,6 +304,7 @@
<Compile Include="Events\RollbackEventArgs.cs" />
<Compile Include="Events\SaveEventArgs.cs" />
<Compile Include="Events\SendToPublishEventArgs.cs" />
<Compile Include="HideFromTypeFinderAttribute.cs" />
<Compile Include="IApplicationEventHandler.cs" />
<Compile Include="IDisposeOnRequestEnd.cs" />
<Compile Include="IO\ResizedImage.cs" />