U4-9322 - missing files

This commit is contained in:
Stephan
2017-01-20 18:33:21 +01:00
parent 1701eb2450
commit a3150b7d4e
3 changed files with 34 additions and 34 deletions

View File

@@ -21,6 +21,11 @@ namespace Umbraco.Core.Scoping
/// </summary>
IList<EventMessage> Messages { get; }
/// <summary>
/// Gets the event manager
/// </summary>
IEventManager Events { get; }
/// <summary>
/// Gets the repository cache mode.
/// </summary>
@@ -31,11 +36,6 @@ namespace Umbraco.Core.Scoping
/// </summary>
IsolatedRuntimeCache IsolatedRuntimeCache { get; }
/// <summary>
/// Gets the event manager
/// </summary>
IEventManager EventManager { get; }
/// <summary>
/// Completes the scope.
/// </summary>

View File

@@ -68,7 +68,7 @@ namespace Umbraco.Core.Scoping
return _messages ?? (_messages = new List<EventMessage>());
}
}
public IList<EventMessage> MessagesOrNull
{
get
@@ -130,6 +130,6 @@ namespace Umbraco.Core.Scoping
_disposed = true;
GC.SuppressFinalize(this);
}
}
}
}

View File

@@ -156,14 +156,14 @@ namespace Umbraco.Core.Scoping
}
}
public UmbracoDatabase DatabaseOrNull
{
get
{
EnsureNotDisposed();
return ParentScope == null ? _database : ParentScope.DatabaseOrNull;
}
}
//public UmbracoDatabase DatabaseOrNull
//{
// get
// {
// EnsureNotDisposed();
// return ParentScope == null ? _database : ParentScope.DatabaseOrNull;
// }
//}
/// <inheritdoc />
public IList<EventMessage> Messages
@@ -172,26 +172,26 @@ namespace Umbraco.Core.Scoping
{
EnsureNotDisposed();
if (ParentScope != null) return ParentScope.Messages;
if (_messages == null)
_messages = new List<EventMessage>();
return _messages;
return _messages ?? (_messages = new List<EventMessage>());
}
}
public IList<EventMessage> MessagesOrNull
{
get
{
EnsureNotDisposed();
return ParentScope == null ? _messages : ParentScope.MessagesOrNull;
}
}
public IEventManager EventManager
//public IList<EventMessage> MessagesOrNull
//{
// get
// {
// EnsureNotDisposed();
// return ParentScope == null ? _messages : ParentScope.MessagesOrNull;
// }
//}
/// <inheritdoc />
public IEventManager Events
{
get
{
EnsureNotDisposed();
if (ParentScope != null) return ParentScope.Events;
return _eventManager ?? (_eventManager = new ScopedEventManager());
}
}
@@ -240,11 +240,6 @@ namespace Umbraco.Core.Scoping
else
DisposeLastScope();
if (_eventManager != null)
{
_eventManager.Dispose();
}
_disposed = true;
GC.SuppressFinalize(this);
}
@@ -279,7 +274,7 @@ namespace Umbraco.Core.Scoping
{
try
{
action(completed); // fixme try catch and everything
action(completed);
}
catch (Exception e)
{
@@ -290,6 +285,11 @@ namespace Umbraco.Core.Scoping
}
if (exceptions != null)
throw new AggregateException("Exceptions were throws by complete actions.", exceptions);
// now trigger every events
// fixme - should some of them trigger within the transaction?
if (_eventManager != null)
_eventManager.Dispose();
}
private IDictionary<string, Action<bool>> ExitActions