Adding some internal bits in the ServiceContextManager and PackagingService

This commit is contained in:
Morten Christensen
2013-06-25 13:43:57 +02:00
parent 188aca499a
commit e4387b8dae
2 changed files with 22 additions and 3 deletions

View File

@@ -45,6 +45,17 @@ namespace Umbraco.Core.Services
_importedContentTypes = new Dictionary<string, IContentType>();
}
#region Generic export methods
internal void ExportToFile(string absoluteFilePath, string nodeType, int id)
{
var contentType = _contentTypeService.GetContentType(id);
var xml = Export(contentType);
xml.Save(absoluteFilePath);
}
#endregion
#region Content
/// <summary>

View File

@@ -1,6 +1,5 @@
using System;
using System.Diagnostics;
using System.Reflection;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.Mappers;
using Umbraco.Core.Persistence.UnitOfWork;
@@ -24,10 +23,19 @@ namespace Umbraco.Core.Standalone
Trace.WriteLine("ServiceContextManager-Current AppDomain: " + AppDomain.CurrentDomain.FriendlyName);
Trace.WriteLine("ServiceContextManager-Current AppDomain: " + AppDomain.CurrentDomain.BaseDirectory);
var examineEventHandlerToRemove = Type.GetType("Umbraco.Web.Search.ExamineEvents, Umbraco.Web");
//var webAssembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(x => x.FullName.StartsWith("umbraco"));
//if (webAssembly != null && examineEventHandlerToRemove == null)
//{
// var examineEventType = webAssembly.GetType("Umbraco.Web.Search.ExamineEvents");
// examineEventHandlerToRemove = examineEventType;
//}
_application = StandaloneCoreApplication.GetApplication(baseDirectory);
_application.WithoutApplicationEventHandler(examineEventHandlerToRemove);
var examineEventHandlerToRemove = Type.GetType("Umbraco.Web.Search.ExamineEvents, umbraco");
if (examineEventHandlerToRemove != null)
_application.WithoutApplicationEventHandler(examineEventHandlerToRemove);
_application.Start();
}