static void ApplicationDeleted(Section sender, System.EventArgs e)
 {
     DistributedCache.Instance.RefreshAllApplicationCache();
 } 
Ejemplo n.º 2
0
 private static void OnDeleted(Section app, EventArgs args)
 {
     if (Deleted != null)
     {
         Deleted(app, args);
     }
 }
Ejemplo n.º 3
0
 private static void OnNew(Section app, EventArgs args)
 {
     if (New != null)
     {
         New(app, args);
     }
 }
Ejemplo n.º 4
0
        /// <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());   
            }            
        }