コード例 #1
0
ファイル: ItemNotifier.cs プロジェクト: JohnsonYuan/n2cms
        /// <summary>Notify subscribers that an item is to be saved.</summary>
        /// <param name="itemToBeSaved">The item that is to be saved.</param>
        /// <returns>True if the item was modified.</returns>
        public bool NotifySaving(ContentItem itemToBeSaved)
        {
            if (ItemSaving == null)
                return false;

            var args = new NotifiableItemEventArgs(itemToBeSaved);
            ItemSaving(this, args);
            return args.WasModified;
        }
コード例 #2
0
ファイル: ItemNotifier.cs プロジェクト: JohnsonYuan/n2cms
        /// <summary>Notify subscribers that an item was loaded or created.</summary>
        /// <param name="newlyCreatedItem">The item that was loaded or created.</param>
        /// <returns>True if the item was modified.</returns>
        public bool NotifiyCreated(ContentItem newlyCreatedItem)
        {
            if (ItemCreated == null)
                return false;

            NotifiableItemEventArgs args = new NotifiableItemEventArgs(newlyCreatedItem);
            ItemCreated(this, args);
            return args.WasModified;
        }
コード例 #3
0
        /// <summary>Notify subscribers that an item is to be saved.</summary>
        /// <param name="itemToBeSaved">The item that is to be saved.</param>
        /// <returns>True if the item was modified.</returns>
        public bool NotifySaving(ContentItem itemToBeSaved)
        {
            if (ItemSaving == null)
            {
                return(false);
            }

            var args = new NotifiableItemEventArgs(itemToBeSaved);

            ItemSaving(this, args);
            return(args.WasModified);
        }
コード例 #4
0
        /// <summary>Notify subscribers that an item was loaded or created.</summary>
        /// <param name="newlyCreatedItem">The item that was loaded or created.</param>
        /// <returns>True if the item was modified.</returns>
        public bool NotifiyCreated(ContentItem newlyCreatedItem)
        {
            if (ItemCreated == null)
            {
                return(false);
            }

            NotifiableItemEventArgs args = new NotifiableItemEventArgs(newlyCreatedItem);

            ItemCreated(this, args);
            return(args.WasModified);
        }
コード例 #5
0
 void notifier_ItemCreated(object sender, NotifiableItemEventArgs e)
 {
     e.WasModified = FilfilDependencies(e.AffectedItem);
 }
コード例 #6
0
 void notifier_ItemCreated(object sender, NotifiableItemEventArgs e)
 {
     e.WasModified = FilfilDependencies(e.AffectedItem);
 }