コード例 #1
0
ファイル: Media.cs プロジェクト: jraghu24/Rraghu
        private bool MoveToTrash()
        {
            MoveToTrashEventArgs e = new MoveToTrashEventArgs();

            FireBeforeMoveToTrash(e);

            if (!e.Cancel)
            {
                if (MediaItem != null)
                {
                    ApplicationContext.Current.Services.MediaService.MoveToRecycleBin(MediaItem);
                }
                else
                {
                    var media = ApplicationContext.Current.Services.MediaService.GetById(Id);
                    ApplicationContext.Current.Services.MediaService.MoveToRecycleBin(media);
                }

                //Move((int)RecycleBin.RecycleBinType.Media);

                //TODO: Now that we've moved it to trash, we need to move the actual files so they are no longer accessible
                //from the original URL.

                FireAfterMoveToTrash(e);
            }
            return(!e.Cancel);
        }
コード例 #2
0
ファイル: Media.cs プロジェクト: KerwinMa/justEdit-
 /// <summary>
 /// Fires the after move to trash.
 /// </summary>
 /// <param name="e">The <see cref="umbraco.cms.businesslogic.MoveToTrashEventArgs"/> instance containing the event data.</param>
 protected virtual void FireAfterMoveToTrash(MoveToTrashEventArgs e)
 {
     if (AfterMoveToTrash != null)
     {
         AfterMoveToTrash(this, e);
     }
 }
コード例 #3
0
ファイル: Media.cs プロジェクト: KerwinMa/justEdit-
 /// <summary>
 /// Raises the <see cref="E:BeforeDelete"/> event.
 /// </summary>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected virtual void FireBeforeMoveToTrash(MoveToTrashEventArgs e)
 {
     if (BeforeMoveToTrash != null)
     {
         BeforeMoveToTrash(this, e);
     }
 }
コード例 #4
0
 private static void DocumentAfterMoveToTrash(Document sender, MoveToTrashEventArgs e)
 {
     if (sender.ContentType.Alias.StartsWith(Store.NodeAlias))
     {
         var reg        = new Regex(@"\s*");
         var storeAlias = reg.Replace(sender.Text, "");
         StoreHelper.UnInstallStore(storeAlias);
     }
     ClearCaches(sender);
 }
コード例 #5
0
 /// <summary>On event, after moving document to trash.</summary>
 protected void Document_AfterMoveToTrash(Document sender, MoveToTrashEventArgs e)
 {
     // Validate document have a relation and is trashed.
     if(sender.Relations.Length > 0) {
     foreach(var r in sender.Relations) {
         // Validate document is from "Main Site" sender and relation type.
         if(r.Parent.Id == sender.Id && r.RelType.Alias == "relateDocumentOnCopy") {
             // Get document from relation object.
             var doc = new Document(r.Child.Id);
             // Append log, audit trail.
             Log.Add(LogTypes.Delete, doc.ParentId, String.Format("Document (name:{0} id:{1}) related to document (name:{2} id:{3}) moved to trash.", r.Child.Text, r.Child.Id, sender.Text, sender.Id));
             // Unpublish and move document (that is child related) to trash.
             doc.delete();
         }
     }
     }
 }
コード例 #6
0
ファイル: Media.cs プロジェクト: KerwinMa/justEdit-
        /// <summary>
        /// Used internally to move the node to the recyle bin
        /// </summary>
        /// <returns>Returns true if the move was not cancelled</returns>
        private bool MoveToTrash()
        {
            MoveToTrashEventArgs e = new MoveToTrashEventArgs();

            FireBeforeMoveToTrash(e);

            if (!e.Cancel)
            {
                Move((int)RecycleBin.RecycleBinType.Media);

                //TODO: Now that we've moved it to trash, we need to move the actual files so they are no longer accessible
                //from the original URL.

                FireAfterMoveToTrash(e);
            }
            return(!e.Cancel);
        }
コード例 #7
0
        /// <summary>On event, before moving document to trash.</summary>
        protected void Document_BeforeMoveToTrash(Document sender, MoveToTrashEventArgs e)
        {
            // Future implemetation, ask user for confirmation or give user options.

            throw new NotImplementedException();
        }
コード例 #8
0
ファイル: Document.cs プロジェクト: saciervo/Umbraco-CMS
 /// <summary>
 /// Fires the after move to trash.
 /// </summary>
 /// <param name="e">The <see cref="umbraco.cms.businesslogic.MoveToTrashEventArgs"/> instance containing the event data.</param>
 protected virtual void FireAfterMoveToTrash(MoveToTrashEventArgs e)
 {
     if (AfterMoveToTrash != null)
         AfterMoveToTrash(this, e);
 }
コード例 #9
0
ファイル: Document.cs プロジェクト: saciervo/Umbraco-CMS
 /// <summary>
 /// Raises the <see cref="E:BeforeDelete"/> event.
 /// </summary>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected virtual void FireBeforeMoveToTrash(MoveToTrashEventArgs e)
 {
     if (BeforeMoveToTrash != null)
         BeforeMoveToTrash(this, e);
 }
コード例 #10
0
ファイル: Document.cs プロジェクト: saciervo/Umbraco-CMS
        private bool MoveToTrash()
        {
            MoveToTrashEventArgs e = new MoveToTrashEventArgs();
            FireBeforeMoveToTrash(e);

            if (!e.Cancel)
            {
                umbraco.BusinessLogic.Actions.Action.RunActionHandlers(this, ActionDelete.Instance);
                UnPublish();
                if (Content != null)
                {
                    ApplicationContext.Current.Services.ContentService.MoveToRecycleBin(Content);
                }
                else
                {
                    Content = ApplicationContext.Current.Services.ContentService.GetById(Id);
                    ApplicationContext.Current.Services.ContentService.MoveToRecycleBin(Content);
                }
                FireAfterMoveToTrash(e);
            }
            return !e.Cancel;
        }
コード例 #11
0
 protected virtual void FireBeforeMoveToTrash(MoveToTrashEventArgs e);
コード例 #12
0
 protected void Document_AfterMoveToTrash(Document sender, MoveToTrashEventArgs e)
 {
     ClearCache();
 }
コード例 #13
0
 protected void Document_AfterMoveToTrash(Document sender, MoveToTrashEventArgs e)
 {
     ClearCache();
 }
コード例 #14
0
 protected virtual void FireAfterMoveToTrash(MoveToTrashEventArgs e);
コード例 #15
0
 protected virtual void FireBeforeMoveToTrash(MoveToTrashEventArgs e);
コード例 #16
0
		private static void DocumentAfterMoveToTrash(Document sender, MoveToTrashEventArgs e)
		{
			if (sender.ContentType.Alias.StartsWith(Store.NodeAlias))
			{
				var reg = new Regex(@"\s*");
				var storeAlias = reg.Replace(sender.Text, "");
				StoreHelper.UnInstallStore(storeAlias);
			}
			ClearCaches(sender);
		}
コード例 #17
0
 protected virtual void FireAfterMoveToTrash(MoveToTrashEventArgs e);
コード例 #18
0
ファイル: Document.cs プロジェクト: phaniarveti/Experiments
        private bool MoveToTrash()
        {
            MoveToTrashEventArgs e = new MoveToTrashEventArgs();
            FireBeforeMoveToTrash(e);

            if (!e.Cancel)
            {
                UnPublish();
                if (Content != null)
                {
                    ApplicationContext.Current.Services.ContentService.MoveToRecycleBin(Content);
                }
                else
                {
                    Content = ApplicationContext.Current.Services.ContentService.GetById(Id);
                    ApplicationContext.Current.Services.ContentService.MoveToRecycleBin(Content);
                }
                FireAfterMoveToTrash(e);
            }
            return !e.Cancel;
        }
コード例 #19
0
ファイル: Media.cs プロジェクト: Jeavon/Umbraco-CMS
        private bool MoveToTrash()
        {
            MoveToTrashEventArgs e = new MoveToTrashEventArgs();
            FireBeforeMoveToTrash(e);

            if (!e.Cancel)
            {
                if (MediaItem != null)
                {
                    ApplicationContext.Current.Services.MediaService.MoveToRecycleBin(MediaItem);
                }
                else
                {
                    var media = ApplicationContext.Current.Services.MediaService.GetById(Id);
                    ApplicationContext.Current.Services.MediaService.MoveToRecycleBin(media);
                }

                //Move((int)RecycleBin.RecycleBinType.Media);

                //TODO: Now that we've moved it to trash, we need to move the actual files so they are no longer accessible
                //from the original URL.

                FireAfterMoveToTrash(e);
            }
            return !e.Cancel;           
            
        }
コード例 #20
0
ファイル: Media.cs プロジェクト: elrute/Triphulcas
        /// <summary>
        /// Used internally to move the node to the recyle bin
        /// </summary>
        /// <returns>Returns true if the move was not cancelled</returns>
        private bool MoveToTrash()
        {
            MoveToTrashEventArgs e = new MoveToTrashEventArgs();
            FireBeforeMoveToTrash(e);

            if (!e.Cancel)
            {
                Move((int)RecycleBin.RecycleBinType.Media);

                //TODO: Now that we've moved it to trash, we need to move the actual files so they are no longer accessible
                //from the original URL.

                FireAfterMoveToTrash(e);
            }
            return !e.Cancel;           
            
        }
コード例 #21
0
ファイル: Document.cs プロジェクト: jracabado/justEdit-
        /// <summary>
        /// Used internally to move the node to the recyle bin
        /// </summary>
        /// <returns>Returns true if the move was not cancelled</returns>
        private bool MoveToTrash()
        {
            MoveToTrashEventArgs e = new MoveToTrashEventArgs();
            FireBeforeMoveToTrash(e);

            if (!e.Cancel)
            {
                umbraco.BusinessLogic.Actions.Action.RunActionHandlers(this, ActionDelete.Instance);
                UnPublish();
                Move((int)RecycleBin.RecycleBinType.Content);
                FireAfterMoveToTrash(e);
            }
            return !e.Cancel;
        }