Skip to content

Commit

Permalink
Avoid removing a public method (used by forms 8.0.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
bergmania committed Mar 18, 2019
1 parent 2f187fa commit 44beb81
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Umbraco.Web/Editors/EditorModelEventManager.cs
@@ -1,4 +1,6 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Web.Http.Filters;
using Umbraco.Core.Dashboards;
using Umbraco.Core.Events;
Expand All @@ -15,11 +17,15 @@ public sealed class EditorModelEventManager
public static event TypedEventHandler<HttpActionExecutedContext, EditorModelEventArgs<MediaItemDisplay>> SendingMediaModel;
public static event TypedEventHandler<HttpActionExecutedContext, EditorModelEventArgs<MemberDisplay>> SendingMemberModel;
public static event TypedEventHandler<HttpActionExecutedContext, EditorModelEventArgs<UserDisplay>> SendingUserModel;
public static event TypedEventHandler<HttpActionExecutedContext, EditorModelEventArgs<IEnumerable<Tab<IDashboardSlim>>>> SendingDashboardModel;

[Obsolete("Please Use SendingDashboardModelV2")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static event TypedEventHandler<HttpActionExecutedContext, EditorModelEventArgs<IEnumerable<Tab<IDashboard>>>> SendingDashboardModel;
public static event TypedEventHandler<HttpActionExecutedContext, EditorModelEventArgs<IEnumerable<Tab<IDashboardSlim>>>> SendingDashboardModelV2;

private static void OnSendingDashboardModel(HttpActionExecutedContext sender, EditorModelEventArgs<IEnumerable<Tab<IDashboardSlim>>> e)
{
var handler = SendingDashboardModel;
var handler = SendingDashboardModelV2;
handler?.Invoke(sender, e);
}

Expand Down

2 comments on commit 44beb81

@marcemarc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bergmania Would SendingDashboardSlimModel be a more appropriate re-name for this event? for developers subscribing to this event, the V2 bit won't have any context... and will seem strange... ?

@bergmania
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcemarc, thanks for suggesting. I have updated the code here 64bc0cf

Please sign in to comment.