Skip to content

Instantly share code, notes, and snippets.

private void IocRegistration(ApplicationContext applicationContext)
{
var container = new ServiceContainer();
container.RegisterControllers(typeof (UmbracoApplication).Assembly);
container.RegisterApiControllers(typeof (UmbracoApplication).Assembly);
container.RegisterControllers(typeof (Umbraco.Forms.Web.Trees.DataSourceTreeController).Assembly);
container.RegisterApiControllers(typeof (Umbraco.Forms.Web.Trees.DataSourceTreeController).Assembly);
container.RegisterControllers(typeof (Diplo.TraceLogViewer.Controllers.TraceLogTreeController).Assembly);
container.RegisterApiControllers(typeof (Diplo.TraceLogViewer.Controllers.TraceLogTreeController).Assembly);
container.RegisterControllers(typeof(Merchello.Web.Mvc.MerchelloRenderMvcController).Assembly);
@clausjensen
clausjensen / DisableUmbracoNotifications.cs
Last active February 10, 2018 02:59
Disabling Umbraco notifications handler by reflection
public class MyUmbracoApplication : UmbracoApplication
{
protected override void OnApplicationStarted(object sender, EventArgs e)
{
base.OnApplicationStarted(sender, e);
// Make sure this is run after the base.OnApplicationStarted!
// The NotificationsHandler in Core is hooked up as a ApplicationEventHandler so we
// can't put this in a handler since we can't control the execution order.
DisableNotificationsHandler();
}
public class VortoDataResolver : PropertyDataResolverProvider
{
/// <summary>
/// Alias of the editor this resolver should trigger on.
/// </summary>
public override string EditorAlias
{
get { return "Our.Umbraco.Vorto"; }
}
DELETE FROM umbracoUser2NodeNotify WHERE umbracoUser2NodeNotify.nodeId IN (SELECT TB1.nodeId FROM umbracoUser2NodeNotify as TB1 INNER JOIN umbracoNode as TB2 ON TB1.nodeId = TB2.id WHERE TB2.trashed = '1' AND TB2.nodeObjectType = 'c66ba18e-eaf3-4cff-8a22-41b16d66a972')
DELETE FROM umbracoUser2NodePermission WHERE umbracoUser2NodePermission.nodeId IN (SELECT TB1.nodeId FROM umbracoUser2NodePermission as TB1 INNER JOIN umbracoNode as TB2 ON TB1.nodeId = TB2.id WHERE TB2.trashed = '1' AND TB2.nodeObjectType = 'c66ba18e-eaf3-4cff-8a22-41b16d66a972')
DELETE FROM umbracoAccessRule WHERE umbracoAccessRule.accessId IN (
SELECT TB1.id FROM umbracoAccess as TB1
INNER JOIN umbracoNode as TB2 ON TB1.nodeId = TB2.id
WHERE TB2.trashed = '1' AND TB2.nodeObjectType = 'c66ba18e-eaf3-4cff-8a22-41b16d66a972')
DELETE FROM umbracoAccess WHERE umbracoAccess.nodeId IN (SELECT TB1.nodeId FROM umbracoAccess as TB1 INNER JOIN umbracoNode as TB2 ON TB1.nodeId = TB2.id WHERE TB
"knoptype": "[{\"key\":\"1156\",\"label\":\"<span class=\\\"knoptype\\\">\\r\\n \\r\\n <a class=\\\"btn\\\" style=\\\"background: rgb(31,156,196); color: #fff; position: relative\\\">\\r\\n <span style=\\\"position: relative; display: inline-block; padding-right: 25px;\\\">Linktekst<span style=\\\"position: absolute; background: rgba(0,0,0,.3);\\r\\n top: 0; right: -20px; bottom: 0; width: 29px; margin: -3px -3px -3px 0; z-index: 10;\\\"></span></span>&nbsp;&nbsp;<i class=\\\"fa fa-angle-right\\\"></i>\\r\\n </a>\\r\\n\\r\\n </span>\"}]"
<%@ WebHandler Language="C#" Class="Code" %>
using System;
using System.Web;
using Umbraco.Web;
public class Code : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{