Exemplo n.º 1
0
 protected virtual void FireAfterRemoveProtection(Document doc, RemoveProtectionEventArgs e)
 {
     if (AfterRemoveProtection != null)
     {
         AfterRemoveProtection(doc, e);
     }
 }
Exemplo n.º 2
0
 protected virtual void FireBeforeRemoveProtection(Document doc, RemoveProtectionEventArgs e)
 {
     if (BeforeRemoveProtection != null)
     {
         BeforeRemoveProtection(doc, e);
     }
 }
Exemplo n.º 3
0
        public static void RemoveProtection(int DocumentId)
        {
            XmlElement x = (XmlElement)getPage(DocumentId);

            if (x != null)
            {
                //event
                RemoveProtectionEventArgs e = new RemoveProtectionEventArgs();
                new Access().FireBeforeRemoveProtection(new Document(DocumentId), e);

                if (!e.Cancel)
                {
                    x.ParentNode.RemoveChild(x);
                    save();
                    clearCheckPages();

                    new Access().FireAfterRemoveProtection(new Document(DocumentId), e);
                }
            }
        }
Exemplo n.º 4
0
        public static void RemoveProtection(int DocumentId)
        {
            //event
            var doc = new Document(DocumentId);
            var e   = new RemoveProtectionEventArgs();

            new Access().FireBeforeRemoveProtection(doc, e);

            if (e.Cancel)
            {
                return;
            }

            var entry = ApplicationContext.Current.Services.PublicAccessService.GetEntryForContent(doc.ContentEntity);

            if (entry != null)
            {
                ApplicationContext.Current.Services.PublicAccessService.Delete(entry);
            }

            Save();

            new Access().FireAfterRemoveProtection(doc, e);
        }
		void Access_AfterRemoveProtection(global::umbraco.cms.businesslogic.web.Document sender, RemoveProtectionEventArgs e)
		{
			((UmbracoSiteMapProvider)System.Web.SiteMap.Provider).UpdateNode(new NodeFactory.Node(sender.Id));
		}
Exemplo n.º 6
0
		protected virtual void FireAfterRemoveProtection(Document doc, RemoveProtectionEventArgs e) {
			if (AfterRemoveProtection != null)
				AfterRemoveProtection(doc, e);
		}
Exemplo n.º 7
0
		protected virtual void FireBeforeRemoveProtection(Document doc, RemoveProtectionEventArgs e) {
			if (BeforeRemoveProtection != null)
				BeforeRemoveProtection(doc, e);
		}
Exemplo n.º 8
0
		public static void RemoveProtection(int DocumentId) 
		{
			XmlElement x = (XmlElement) getPage(DocumentId);
			if (x != null) 
			{
				//event
				RemoveProtectionEventArgs e = new RemoveProtectionEventArgs();
				new Access().FireBeforeRemoveProtection(new Document(DocumentId), e);

				if (!e.Cancel) {

					x.ParentNode.RemoveChild(x);
					save();
					clearCheckPages();

					new Access().FireAfterRemoveProtection(new Document(DocumentId), e);
				}

			}
		}
Exemplo n.º 9
0
 void Access_AfterRemoveProtection(global::umbraco.cms.businesslogic.web.Document sender, RemoveProtectionEventArgs e)
 {
     ((UmbracoSiteMapProvider)System.Web.SiteMap.Provider).UpdateNode(new NodeFactory.Node(sender.Id));
 }