static void MediaServiceDeleting(IMediaService sender, DeleteEventArgs<IMedia> e) { foreach (var item in e.DeletedEntities) { library.ClearLibraryCacheForMedia(item.Id); } }
private void ContentServiceOnDeleted(IContentService sender, DeleteEventArgs<IContent> deleteEventArgs) { foreach(var deletedEntity in deleteEventArgs.DeletedEntities) { DeleteEntityIndex(deletedEntity); } }
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 nodeId=@nodeId", SqlHelper.CreateParameter("@nodeId", this.Id)); base.delete(); cache.Cache.ClearCacheItem(string.Format("UmbracoDataTypeDefinition{0}", Id)); FireAfterDelete(e); } }
/// <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(); } }
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); } }
/// <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); } }
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)); }
/// <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(); } }
public void Delete() { DeleteEventArgs e = new DeleteEventArgs(); FireBeforeDelete(e); if (!e.Cancel) { data.Delete(this.Data.Id, IOHelper.MapPath(Settings.CreatedPackagesSettings)); FireAfterDelete(e); } }
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); } }
/// <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)); } } }
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); } }
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 }
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); } } }
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 } }
private void Album_deleted(IContentService sender, DeleteEventArgs<IContent> e) { foreach (IContent node in e.DeletedEntities) { if (node.ContentType.ContentTypeCompositionExists("Album") || node.ContentType.Alias == "Album") { int media_level; if (node.ContentType.Alias == "Usersubalbum" || node.ContentType.Alias == "Subalbum") media_level = 2; else media_level = 1; IMediaService ms = UmbracoContext.Current.Application.Services.MediaService; IMedia media = ms.GetByLevel(media_level).Where(x => x.Name == node.Name).First(x => x.ContentType.Alias == "Folder"); if (media == null) return; ms.Delete(media); } } }
void OnWinDelete(object o, DeleteEventArgs args) { Application.Quit(); }
void HandleDeleteEvent(object sender, DeleteEventArgs args) { SavePreferences(); this.Window.Destroy(); args.RetVal = true; }
private void ImprotFileDialog_DeleteEvent(object o, DeleteEventArgs args) { this.SetResult(EImportFileButtonResult.Skip); }
protected virtual void FireBeforeDelete(DeleteEventArgs e) { _e.FireCancelableEvent(BeforeDelete, this, e); }
protected void OnDeleteEvent(object sender, DeleteEventArgs args) { Gtk.Application.Quit(); args.RetVal = true; }
private void DoDelete(object o, DeleteEventArgs args) { Hide(); }
static void Quit(object sender, DeleteEventArgs args) { Application.Quit(); }
protected virtual void FireBeforeDelete(DeleteEventArgs e) { _events.FireCancelableEvent(BeforeDelete, this, e); }
/// <summary> /// Removes a product variant from the index /// </summary> static void ProductVariantServiceDeleted(IProductVariantService sender, DeleteEventArgs<IProductVariant> e) { e.DeletedEntities.ForEach(DeleteProductVariantFromIndex); }
private void Content_Deleted(IContentService sender, DeleteEventArgs <IContent> e) { ClearCache(); }
protected void OnDeleteEvent(object sender, DeleteEventArgs args) { Log.Debug("OnDeleteEvent"); MainClass.Quit(); args.RetVal = true; }
protected void OnDeleteQuit(object o, DeleteEventArgs e) { Gtk.Application.Quit(); }
private void Window_Close(object sender, DeleteEventArgs args) { End(_emulationContext); }
private static void DeleteCB(System.Object o, DeleteEventArgs args) { Application.Quit(); }
protected void OnDeleteEvent(object sender, DeleteEventArgs a) { Application.Quit(); a.RetVal = true; }
static void StyleSheetAfterDelete(StyleSheet sender, DeleteEventArgs e) { DistributedCache.Instance.RemoveStylesheetCache(sender); }
private void GtkWin_DeleteEvent(object o, DeleteEventArgs args) { result.TrySetResult(false); }
/// <summary> /// Fires when a langauge is deleted /// </summary> /// <param name="sender"></param> /// <param name="e"></param> static void LanguageAfterDelete(global::umbraco.cms.businesslogic.language.Language sender, DeleteEventArgs e) { DistributedCache.Instance.RemoveLanguageCache(sender); }
static void Window_Delete(object obj, DeleteEventArgs args) { Application.Quit(); args.RetVal = true; }
/// <summary> /// Removes cache for template /// </summary> /// <param name="sender"></param> /// <param name="e"></param> static void TemplateAfterDelete(Template sender, DeleteEventArgs e) { DistributedCache.Instance.RemoveTemplateCache(sender.Id); }
protected void OnDeleteEvent(object sender, DeleteEventArgs a) { //SocketClient.GetSocketClient().Close(); Application.Quit(); a.RetVal = true; }
protected override bool OnBeforeDelete(DeleteEventArgs arg) { arg.db.Delete("mms_transferDetail").Where("BillNo", arg.data.GetValue("BillNo")).Execute(); return(base.OnBeforeDelete(arg)); }
protected void OnDeleteEvent(object sender, DeleteEventArgs a) { }
/// <summary> /// Reindexes an invoice based on order deletion /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> public static void OrderServiceDeleted(IOrderService sender, DeleteEventArgs <IOrder> e) { e.DeletedEntities.ForEach(DeleteOrderFromIndex); }
static void MemberBeforeDelete(Member sender, DeleteEventArgs e) { DistributedCache.Instance.RemoveMemberCache(sender.Id); }
/// <summary> /// Clears the virtual content cache. /// </summary> /// <param name="e"> /// The e. /// </param> public override void ClearVirtualCache(DeleteEventArgs <IProduct> e) { base.ClearVirtualCache(e); RemoveFromCache(e.DeletedEntities); }
/// <summary> /// Removes a product variant from the index /// </summary> static void ProductVariantServiceDeleted(IProductVariantService sender, DeleteEventArgs <IProductVariant> e) { e.DeletedEntities.ForEach(DeleteProductVariantFromIndex); }
protected virtual void FireBeforeDelete(DeleteEventArgs e) { if (BeforeDelete != null) BeforeDelete(this, e); }
static void OnDelete(object o, DeleteEventArgs e) { Application.Quit(); }
private void Window_Close(object sender, DeleteEventArgs args) { _screen?.Exit(); End(); }
public override void delete() { DeleteEventArgs e = new DeleteEventArgs(); FireBeforeDelete(e); if (e.Cancel == false) { // check that no document types uses me as a master if (GetAllAsList().Any(dt => dt.MasterContentTypes.Contains(this.Id))) { throw new ArgumentException("Can't delete a Document Type used as a Master Content Type. Please remove all references first!"); } // Remove from cache FlushFromCache(Id); ApplicationContext.Current.Services.ContentTypeService.Delete(_contentType); clearTemplates(); FireAfterDelete(e); } }
public override void WindowCloser(object obj, DeleteEventArgs args) { this.Hide(); }
static void StylesheetPropertyAfterDelete(global::umbraco.cms.businesslogic.web.StylesheetProperty sender, DeleteEventArgs e) { DistributedCache.Instance.RemoveStylesheetPropertyCache(sender); }
public void OnWindowDeleteEvent(object o, DeleteEventArgs args) { Application.Quit(); args.RetVal = true; }
static void DomainAfterDelete(Domain sender, DeleteEventArgs e) { DistributedCache.Instance.RemoveDomainCache(sender); }
protected bool ProcessDelete(HttpListenerContext context) { DeleteEventArgs <ObjectType> eventArgs = new DeleteEventArgs <ObjectType>() { AskedDate = DateTime.Now, AskedUrl = context.Request.Url }; bool result = true; try { if (!context.Request.HasEntityBody) { result = false; } else { string parameters = null; using (System.IO.Stream body = context.Request.InputStream) { using (System.IO.StreamReader reader = new System.IO.StreamReader(body, context.Request.ContentEncoding)) { parameters = reader.ReadToEnd(); } } if (string.IsNullOrWhiteSpace(parameters)) { context.Response.StatusCode = (int)HttpStatusCode.Unauthorized; result = false; } else { ObjectType objFromParameters = JsonSerializer.Deserialize <ObjectType>(parameters); if (objFromParameters == null) { context.Response.StatusCode = (int)HttpStatusCode.Unauthorized; result = false; } else { ObjectType objFromCollection = Item.FirstOrDefault(item => item.GetType().GetProperties().Where(prop => System.Attribute.IsDefined(prop, typeof(PrimaryKeyAttribute))).All(prop => prop.GetValue(item).Equals(prop.GetValue(objFromParameters)))); if (objFromCollection == null) { context.Response.StatusCode = (int)HttpStatusCode.Unauthorized; result = false; } else { eventArgs.Old = objFromCollection; Item.Remove(objFromCollection); } } } } } catch { context.Response.StatusCode = (int)HttpStatusCode.InternalServerError; result = false; } eventArgs.EndDate = DateTime.Now; eventArgs.ResponseHttpStatusCode = (HttpStatusCode)context.Response.StatusCode; OnDeleteAction(eventArgs); PrepareResponse(context); return(result); }
static void PermissionDeleted(UserPermission sender, DeleteEventArgs e) { InvalidateCacheForPermissionsChange(sender); }
protected virtual void OnDeleteAction(DeleteEventArgs <ObjectType> e) { OnDelete?.Invoke(this, e); }
/// <summary> /// Flush macro from cache /// </summary> /// <param name="sender"></param> /// <param name="e"></param> static void MacroAfterDelete(Macro sender, DeleteEventArgs e) { DistributedCache.Instance.RemoveMacroCache(sender); }
private void OnWindowDeleteEvent(object sender, DeleteEventArgs a) { a.RetVal = true; Application.Quit(); }
/// <summary> /// Deletes the current macro /// </summary> public void Delete() { //event DeleteEventArgs e = new DeleteEventArgs(); FireBeforeDelete(e); if (!e.Cancel) { foreach (MacroProperty p in this.Properties) p.Delete(); SqlHelper.ExecuteNonQuery("delete from cmsMacro where id = @id", SqlHelper.CreateParameter("@id", this._id)); FireAfterDelete(e); } }
void on_session_upload_delete_event(object o, DeleteEventArgs args) { SessionUploadWindowBox.session_upload.Hide(); SessionUploadWindowBox = null; }
protected virtual void FireAfterDelete(DeleteEventArgs e) { if (AfterDelete != null) AfterDelete(this, e); }
protected override void on_delete_event(object o, DeleteEventArgs args) { EditReactionTimeWindowBox.edit_event.Hide(); EditReactionTimeWindowBox = null; }