当前位置: 首页>>代码示例>>C#>>正文


C# DeleteEventArgs类代码示例

本文整理汇总了C#中DeleteEventArgs的典型用法代码示例。如果您正苦于以下问题:C# DeleteEventArgs类的具体用法?C# DeleteEventArgs怎么用?C# DeleteEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DeleteEventArgs类属于命名空间,在下文中一共展示了DeleteEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: delete

        public override void delete()
        {
            DeleteEventArgs e = new DeleteEventArgs();
            FireBeforeDelete(e);
            if (!e.Cancel)
            {
                //first clear the prevalues
                PreValues.DeleteByDataTypeDefinition(this.Id);

                //next clear out the property types
                var propTypes = PropertyType.GetByDataTypeDefinition(this.Id);
                foreach (var p in propTypes)
                {
                    p.delete();
                }

                //delete the cmsDataType role, then the umbracoNode
                SqlHelper.ExecuteNonQuery("delete from cmsDataType where [email protected]",
                                          SqlHelper.CreateParameter("@nodeId", this.Id));
                base.delete();

                cache.Cache.ClearCacheItem(string.Format("UmbracoDataTypeDefinition{0}", Id));
                FireAfterDelete(e);
            }
        }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:25,代码来源:DataTypeDefinition.cs

示例2: MediaServiceDeleting

 static void MediaServiceDeleting(IMediaService sender, DeleteEventArgs<IMedia> e)
 {
     foreach (var item in e.DeletedEntities)
     {
         library.ClearLibraryCacheForMedia(item.Id);
     }
 }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:7,代码来源:LibraryCacheRefresher.cs

示例3: MediaService_Deleted

 void MediaService_Deleted(IMediaService sender, DeleteEventArgs<IMedia> e)
 {
     foreach (IMedia entity in e.DeletedEntities.Where(entity => entity.ContentType.Alias == PPC_2010.Data.Constants.SermonAlias))
     {
         ServiceLocator.Instance.Locate<ISermonRepository>().RefreshSermon(entity.Id, true);
     }
 }
开发者ID:shferguson,项目名称:ppc2010,代码行数:7,代码来源:SermonEvents.cs

示例4: ContentServiceOnDeleted

 private void ContentServiceOnDeleted(IContentService sender, DeleteEventArgs<IContent> deleteEventArgs)
 {
     foreach(var deletedEntity in deleteEventArgs.DeletedEntities)
     {
         DeleteEntityIndex(deletedEntity);
     }
 }
开发者ID:alecrt,项目名称:FormEditor,代码行数:7,代码来源:ApplicationEvents.cs

示例5: MediaService_Deleted

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void MediaService_Deleted(IMediaService sender, DeleteEventArgs<IMedia> e)
        {
            if (connection.State != ConnectionState.Open)
            {
                connection.Open();
            }

            foreach (var item in e.DeletedEntities)
            {
                string Resource = item.Name;

                SqlTransaction tran = connection.BeginTransaction();
                var command = new SqlCommand("dbo.[RequestCdnResourceInvalidation]", connection, tran);
                command.CommandType = CommandType.StoredProcedure;

                command.Parameters.Add("@resource", SqlDbType.NVarChar, 256);
                command.Parameters["@resource"].Value = Resource;

                command.Parameters.Add("@ConversationHandle", SqlDbType.UniqueIdentifier);
                command.Parameters["@ConversationHandle"].Direction = ParameterDirection.Output;

                command.ExecuteNonQuery();
                tran.Commit();
            }
        }
开发者ID:JamesGreenAU,项目名称:UmbracoServiceBroker,代码行数:30,代码来源:MediaQueue.cs

示例6: EntityCollectionServiceOnDeleted

 /// <summary>
 /// The entity collection service on deleted.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private void EntityCollectionServiceOnDeleted(IEntityCollectionService sender, DeleteEventArgs<IEntityCollection> e)
 {
     if (!EntityCollectionProviderResolver.HasCurrent) return;
     foreach (var collection in e.DeletedEntities)
     {
         EntityCollectionProviderResolver.Current.RemoveFromCache(collection.Key);
     }
 }
开发者ID:drpeck,项目名称:Merchello,代码行数:17,代码来源:EntityCollectionEvents.cs

示例7: WarehouseCatalogServiceDeleted

        /// <summary>
        /// The warehouse catalog service deleted.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="deleteEventArgs">
        /// The delete event args.
        /// </param>
        /// <remarks>
        /// The repository will delete the ship countries and the ship methods but we need to clean up any stored in memory
        /// </remarks>
        private void WarehouseCatalogServiceDeleted(IWarehouseCatalogService sender, DeleteEventArgs<IWarehouseCatalog> deleteEventArgs)
        {
            var providers = GatewayProviderResolver.Current.GetActivatedProviders<ShippingGatewayProviderBase>();

            foreach (var provider in providers)
            {
                ((ShippingGatewayProviderBase)provider).ResetShipMethods();
            }
        }
开发者ID:kedde,项目名称:Merchello,代码行数:21,代码来源:GatewayEvents.cs

示例8: Member_AfterDelete

        private void Member_AfterDelete(Member sender, DeleteEventArgs e)
        {
            var nodeId = sender.Id.ToString();

            //ensure that only the providers are flagged to listen execute
            ExamineManager.Instance.DeleteFromIndex(nodeId,
                ExamineManager.Instance.IndexProviderCollection.OfType<BaseUmbracoIndexer>()
                    .Where(x => x.EnableDefaultEventHandler));
        }
开发者ID:Xamarui,项目名称:Examine,代码行数:9,代码来源:UmbracoEventManager.cs

示例9: Delete

        public void Delete() {
            DeleteEventArgs e = new DeleteEventArgs();
            FireBeforeDelete(e);

            if (!e.Cancel) {
                data.Delete(this.Data.Id, IOHelper.MapPath(Settings.CreatedPackagesSettings));
                FireAfterDelete(e);
            }
        }
开发者ID:saciervo,项目名称:Umbraco-CMS,代码行数:9,代码来源:CreatedPackage.cs

示例10: ContentService_Deleting

 private void ContentService_Deleting(IContentService sender, DeleteEventArgs<IContent> e)
 {
     foreach (var entity in e.DeletedEntities)
     {
         string documentType = entity.ContentType.Alias;
         var mapping = MapProvider.Mappings.SingleOrDefault(n => n.DocumentType == documentType);
         if (mapping != null)
             DeleteDocument(mapping, sender, entity);
     }
 }
开发者ID:MindfireTechnology,项目名称:UmbracoDBSync,代码行数:10,代码来源:OneWayDataSync.cs

示例11: ContentServiceOnDeleted

 /// <summary>
 /// Called when user empties the recycle bin, or an item in the recycle bin is permanently deleted
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="deleteEventArgs"></param>
 private void ContentServiceOnDeleted(IContentService sender, DeleteEventArgs<IContent> deleteEventArgs)
 {
    if (!deleteEventArgs.DeletedEntities.Any()) return;
    foreach (var entity in deleteEventArgs.DeletedEntities)
    {
       DbProvider.RemoveMediaTrack(entity.Id);
       if (_verbose)
       {
          LogHelper.Info<MediaTrackerHandler>(string.Format("All tracking for the page '{0}' was removed because the page was moved to the recycle bin.", entity.Name));
       }
    }
 }
开发者ID:Gavlar50,项目名称:MediaTracker,代码行数:17,代码来源:MediaTrackerHandler.cs

示例12: delete

        public override void delete()
        {
            DeleteEventArgs e = new DeleteEventArgs();
            FireBeforeDelete(e);
            if (!e.Cancel) {
                // delete member specific data!
                SqlHelper.ExecuteNonQuery("Delete from cmsMember2MemberGroup where memberGroup = @id",
                    SqlHelper.CreateParameter("@id", Id));

                // Delete all content and cmsnode specific data!
                base.delete();
                FireAfterDelete(e);
            }
        }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:14,代码来源:MemberGroup.cs

示例13: Document_BeforeDelete

 void Document_BeforeDelete(Document doc, DeleteEventArgs e)
 {
     #if !DEBUG
     try
     #endif
     {
         UrlTrackerRepository.DeleteUrlTrackerEntriesByNodeId(doc.Id);
     }
     #if !DEBUG
     catch (Exception ex)
     {
         ex.LogException(doc.Id);
     }
     #endif
 }
开发者ID:neehouse,项目名称:UrlTracker,代码行数:15,代码来源:UrlTrackerApplicationBase.cs

示例14: MemberService_Deleting

    void MemberService_Deleting(IMemberService sender, DeleteEventArgs<IMember> e)
    {
        foreach (var m in e.DeletedEntities)
        {
           var member = ApplicationContext.Current.Services.ContentService.GetById(int.Parse(m.GetValue("lists").ToString()));
           foreach(var lists in member.Children())
           {
               foreach(var list in lists.Children())
               {
                 //  e.MediaFilesToDelete.Add(c.GetValue("image").ToString());
                   ApplicationContext.Current.Services.ContentService.Delete(list);

               }
               ApplicationContext.Current.Services.ContentService.Delete(lists);
           }
        }
    }
开发者ID:Interon,项目名称:uMaster,代码行数:17,代码来源:Events.cs

示例15: ContentService_Deleting

        void ContentService_Deleting(IContentService sender, DeleteEventArgs<IContent> e)
        {
            foreach (IContent content in e.DeletedEntities)
            {
#if !DEBUG
                try
#endif
                {
                    UrlTrackerRepository.DeleteUrlTrackerEntriesByNodeId(content.Id);
                }
#if !DEBUG
                catch (Exception ex)
                {
                    ex.LogException();
                }
#endif
            }
        }
开发者ID:sheryever,项目名称:UrlTracker,代码行数:18,代码来源:UrlTrackerApplicationEventHandler.cs


注:本文中的DeleteEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。