more unused code removed

This commit is contained in:
Shannon
2015-01-20 18:17:11 +11:00
parent 2342ba5537
commit 215113d635
9 changed files with 14 additions and 70 deletions

View File

@@ -1,11 +1,11 @@
using umbraco.interfaces;
namespace Umbraco.Core
{
/// <summary>
/// Custom IApplicationStartupHandler that auto subscribes to the applications events
/// </summary>
public interface IApplicationEventHandler : IApplicationStartupHandler
public interface IApplicationEventHandler
{
/// <summary>
/// ApplicationContext is created and other static objects that require initialization have been setup

View File

@@ -39,16 +39,7 @@ namespace Umbraco.Tests
PluginManager.Current = null;
}
/// <summary>
/// Ensures that the media factory finds the correct number of IMediaFactory
/// </summary>
[Test]
public void Find_Media_Factories()
{
var factories = MediaFactory.Factories;
Assert.AreEqual(2, factories.Count());
}
#region Classes for tests
public class MediaFactory1 : IMediaFactory
{

View File

@@ -40,7 +40,7 @@ namespace Umbraco.Tests.Plugins
_manager.AssembliesToScan = new[]
{
this.GetType().Assembly,
typeof(ApplicationStartupHandler).Assembly,
//typeof(ApplicationStartupHandler).Assembly,
typeof(SqlCEHelper).Assembly,
typeof(CMSNode).Assembly,
typeof(System.Guid).Assembly,

View File

@@ -41,7 +41,7 @@ namespace Umbraco.Tests.Plugins
_assemblies = new[]
{
this.GetType().Assembly,
typeof(ApplicationStartupHandler).Assembly,
//typeof(ApplicationStartupHandler).Assembly,
typeof(SqlCEHelper).Assembly,
typeof(CMSNode).Assembly,
typeof(System.Guid).Assembly,
@@ -67,16 +67,16 @@ namespace Umbraco.Tests.Plugins
Assert.AreEqual(2, typesFound.Count());
}
[Test]
public void Find_Classes_Of_Type()
{
var typesFound = TypeFinder.FindClassesOfType<IApplicationStartupHandler>(_assemblies);
var originalTypesFound = TypeFinderOriginal.FindClassesOfType<IApplicationStartupHandler>(_assemblies);
//[Test]
//public void Find_Classes_Of_Type()
//{
// var typesFound = TypeFinder.FindClassesOfType<IApplicationStartupHandler>(_assemblies);
// var originalTypesFound = TypeFinderOriginal.FindClassesOfType<IApplicationStartupHandler>(_assemblies);
Assert.AreEqual(originalTypesFound.Count(), typesFound.Count());
Assert.AreEqual(5, typesFound.Count());
Assert.AreEqual(5, originalTypesFound.Count());
}
// Assert.AreEqual(originalTypesFound.Count(), typesFound.Count());
// Assert.AreEqual(5, typesFound.Count());
// Assert.AreEqual(5, originalTypesFound.Count());
//}
[Test]
public void Find_Classes_With_Attribute()

View File

@@ -1449,9 +1449,6 @@
<DependentUpon>MacroContainerService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\webservices\MediaUploader.ashx.cs">
<DependentUpon>MediaUploader.ashx</DependentUpon>
</Compile>
<Compile Include="umbraco.presentation\umbraco\webservices\TagsAutoCompleteHandler.ashx.cs">
<DependentUpon>TagsAutoCompleteHandler.ashx</DependentUpon>
</Compile>
@@ -1832,7 +1829,6 @@
</None>
<Content Include="umbraco.presentation\umbraco\webservices\TagsAutoCompleteHandler.ashx" />
<Content Include="umbraco.presentation\umbraco\webservices\UltimatePickerAutoCompleteHandler.ashx" />
<Content Include="umbraco.presentation\umbraco\webservices\MediaUploader.ashx" />
<None Include="Web References\org.umbraco.update\checkforupgrade.disco" />
<None Include="Web References\org.umbraco.update\checkforupgrade.wsdl" />
<None Include="Web References\org.umbraco.update\Reference.map">

View File

@@ -6,7 +6,6 @@
<repository path="..\umbraco.controls\packages.config" />
<repository path="..\Umbraco.Core\packages.config" />
<repository path="..\umbraco.datalayer\packages.config" />
<repository path="..\umbraco.editorControls\packages.config" />
<repository path="..\Umbraco.Tests\packages.config" />
<repository path="..\Umbraco.Web.UI\packages.config" />
<repository path="..\Umbraco.Web\packages.config" />

View File

@@ -182,10 +182,8 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="ApplicationAttribute.cs" />
<Compile Include="ApplicationBase.cs" />
<Compile Include="ApplicationDefinitions.cs" />
<Compile Include="ApplicationRegistrar.cs" />
<Compile Include="ApplicationStartupHandler.cs" />
<Compile Include="ApplicationTree.cs" />
<Compile Include="ApplicationTreeRegistrar.cs" />
<Compile Include="DefaultApps.cs" />

View File

@@ -9,45 +9,6 @@ using umbraco.BusinessLogic.Utils;
namespace umbraco.cms.businesslogic.media
{
//TODO: This class needs to be changed to use the new MultipleResolverBase, doing this will require migrating and cleaning up
// a bunch of types so I have left it existing here under legacy code for now.
public class MediaFactory
{
internal static readonly List<IMediaFactory> Factories = new List<IMediaFactory>();
static MediaFactory()
{
Initialize();
}
private static void Initialize()
{
Factories.AddRange(
PluginManager.Current.CreateInstances<IMediaFactory>(
PluginManager.Current.ResolveMediaFactories()));
Factories.Sort((f1, f2) => f1.Priority.CompareTo(f2.Priority));
}
public static IMediaFactory GetMediaFactory(int parentId, PostedMediaFile postedFile, User user)
{
var ext = Path.GetExtension(postedFile.FileName);
if (ext == null)
return null;
var factories = Factories.Where(mf => mf.Extensions.Contains(ext.ToLower().TrimStart('.'))).ToList();
if (factories.Count == 0)
factories = Factories.Where(mf => mf.Extensions.Contains("*")).ToList();
if (factories.Count > 0)
return factories.FirstOrDefault(factory => factory.CanHandleMedia(parentId, postedFile, user));
return null;
}
}
public class PostedMediaFile
{

View File

@@ -123,7 +123,6 @@
<Link>Properties\SolutionInfo.cs</Link>
</Compile>
<Compile Include="IApplication.cs" />
<Compile Include="IApplicationStartupHandler.cs" />
<Compile Include="INode.cs" />
<Compile Include="IProperty.cs" />
<Compile Include="ITag.cs" />