static void MediaServiceDeleting(IMediaService sender, DeleteEventArgs<IMedia> e)
 {
     foreach (var item in e.DeletedEntities)
     {
         library.ClearLibraryCacheForMedia(item.Id);
     }
 }
예제 #2
0
 private void ContentServiceOnDeleted(IContentService sender, DeleteEventArgs<IContent> deleteEventArgs)
 {
     foreach(var deletedEntity in deleteEventArgs.DeletedEntities)
     {
         DeleteEntityIndex(deletedEntity);
     }
 }
예제 #3
0
        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();
            }
        }
예제 #5
0
 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);
     }
 }
예제 #6
0
 /// <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
0
        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));
        }
예제 #8
0
        /// <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();
            }
        }
예제 #9
0
        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);
     }
 }
예제 #11
0
 /// <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
0
        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
 }
예제 #14
0
파일: Events.cs 프로젝트: Interon/uMaster
    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
            }
        }
예제 #16
0
        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);
            }
              }
        }
예제 #17
0
 void OnWinDelete(object o, DeleteEventArgs args)
 {
     Application.Quit();
 }
예제 #18
0
 void HandleDeleteEvent(object sender, DeleteEventArgs args)
 {
     SavePreferences();
     this.Window.Destroy();
     args.RetVal = true;
 }
예제 #19
0
 private void ImprotFileDialog_DeleteEvent(object o, DeleteEventArgs args)
 {
     this.SetResult(EImportFileButtonResult.Skip);
 }
예제 #20
0
 protected virtual void FireBeforeDelete(DeleteEventArgs e)
 {
     _e.FireCancelableEvent(BeforeDelete, this, e);
 }
예제 #21
0
 protected void OnDeleteEvent(object sender, DeleteEventArgs args)
 {
     Gtk.Application.Quit();
     args.RetVal = true;
 }
예제 #22
0
 private void DoDelete(object o, DeleteEventArgs args)
 {
     Hide();
 }
예제 #23
0
 static void Quit(object sender, DeleteEventArgs args)
 {
     Application.Quit();
 }
예제 #24
0
파일: Topic.cs 프로젝트: ventil8/OurUmbraco
 protected virtual void FireBeforeDelete(DeleteEventArgs e)
 {
     _events.FireCancelableEvent(BeforeDelete, this, e);
 }
예제 #25
0
 /// <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();
 }
예제 #27
0
 protected void OnDeleteEvent(object sender, DeleteEventArgs args)
 {
     Log.Debug("OnDeleteEvent");
     MainClass.Quit();
     args.RetVal = true;
 }
예제 #28
0
 protected void OnDeleteQuit(object o, DeleteEventArgs e)
 {
     Gtk.Application.Quit();
 }
예제 #29
0
 private void Window_Close(object sender, DeleteEventArgs args)
 {
     End(_emulationContext);
 }
예제 #30
0
 private static void DeleteCB(System.Object o, DeleteEventArgs args)
 {
     Application.Quit();
 }
예제 #31
0
 protected void OnDeleteEvent(object sender, DeleteEventArgs a)
 {
     Application.Quit();
     a.RetVal = true;
 }
 static void StyleSheetAfterDelete(StyleSheet sender, DeleteEventArgs e)
 {
     DistributedCache.Instance.RemoveStylesheetCache(sender);
 } 
예제 #33
0
 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);
 }
예제 #37
0
 protected void OnDeleteEvent(object sender, DeleteEventArgs a)
 {
     //SocketClient.GetSocketClient().Close();
     Application.Quit();
     a.RetVal = true;
 }
예제 #38
0
 protected override bool OnBeforeDelete(DeleteEventArgs arg)
 {
     arg.db.Delete("mms_transferDetail").Where("BillNo", arg.data.GetValue("BillNo")).Execute();
     return(base.OnBeforeDelete(arg));
 }
예제 #39
0
 protected void OnDeleteEvent(object sender, DeleteEventArgs a)
 {
 }
예제 #40
0
 /// <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);
 }
예제 #42
0
        /// <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);
        }
예제 #43
0
 /// <summary>
 /// Removes a product variant from the index
 /// </summary>
 static void ProductVariantServiceDeleted(IProductVariantService sender, DeleteEventArgs <IProductVariant> e)
 {
     e.DeletedEntities.ForEach(DeleteProductVariantFromIndex);
 }
예제 #44
0
파일: Macro.cs 프로젝트: elrute/Triphulcas
 protected virtual void FireBeforeDelete(DeleteEventArgs e) {
     if (BeforeDelete != null)
         BeforeDelete(this, e);
 }
예제 #45
0
 static void OnDelete(object o, DeleteEventArgs e)
 {
     Application.Quit();
 }
예제 #46
0
 private void Window_Close(object sender, DeleteEventArgs args)
 {
     _screen?.Exit();
     End();
 }
예제 #47
0
        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);
            }
        }
예제 #48
0
 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);
 }
예제 #52
0
        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);
 }
예제 #54
0
 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);
 }
예제 #56
0
 private void OnWindowDeleteEvent(object sender, DeleteEventArgs a)
 {
     a.RetVal = true;
     Application.Quit();
 }
예제 #57
0
파일: Macro.cs 프로젝트: elrute/Triphulcas
		/// <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);
            }
        }
예제 #58
0
 void on_session_upload_delete_event(object o, DeleteEventArgs args)
 {
     SessionUploadWindowBox.session_upload.Hide();
     SessionUploadWindowBox = null;
 }
예제 #59
0
파일: Macro.cs 프로젝트: elrute/Triphulcas
 protected virtual void FireAfterDelete(DeleteEventArgs e) {
     if (AfterDelete != null)
         AfterDelete(this, e);
 }
예제 #60
0
 protected override void on_delete_event(object o, DeleteEventArgs args)
 {
     EditReactionTimeWindowBox.edit_event.Hide();
     EditReactionTimeWindowBox = null;
 }