static void ApplicationDeleted(Section sender, System.EventArgs e) { DistributedCache.Instance.RefreshAllApplicationCache(); }
private static void OnDeleted(Section app, EventArgs args) { if (Deleted != null) { Deleted(app, args); } }
private static void OnNew(Section app, EventArgs args) { if (New != null) { New(app, args); } }
/// <summary> /// Deletes the section /// </summary> public void DeleteSection(Section section) { lock (Locker) { //delete the assigned applications ApplicationContext.Current.DatabaseContext.Database.Execute( "delete from umbracoUser2App where app = @appAlias", new { appAlias = section.Alias }); //delete the assigned trees var trees = _applicationTreeService.GetApplicationTrees(section.Alias); foreach (var t in trees) { _applicationTreeService.DeleteTree(t); } LoadXml(doc => { doc.Root.Elements("add").Where(x => x.Attribute("alias") != null && x.Attribute("alias").Value == section.Alias).Remove(); }, true); //raise event OnDeleted(section, new EventArgs()); } }