本文整理汇总了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);
}
}
示例2: MediaServiceDeleting
static void MediaServiceDeleting(IMediaService sender, DeleteEventArgs<IMedia> e)
{
foreach (var item in e.DeletedEntities)
{
library.ClearLibraryCacheForMedia(item.Id);
}
}
示例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);
}
}
示例4: ContentServiceOnDeleted
private void ContentServiceOnDeleted(IContentService sender, DeleteEventArgs<IContent> deleteEventArgs)
{
foreach(var deletedEntity in deleteEventArgs.DeletedEntities)
{
DeleteEntityIndex(deletedEntity);
}
}
示例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();
}
}
示例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);
}
}
示例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();
}
}
示例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));
}
示例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);
}
}
示例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);
}
}
示例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));
}
}
}
示例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);
}
}
示例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
}
示例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);
}
}
}
示例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
}
}