protected virtual void OnDeleted(DeletedEventArgs e)
        {
            var handler = Deleted;

            if (handler != null)
            {
                handler(this, e);
            }
        }
        /// <summary>
        /// Deletes the item
        /// </summary>
        /// <param name="Session">ORM session variable</param>
        public virtual void Delete(Session Session)
        {
            DeletingEventArgs E = new DeletingEventArgs();

            OnDeleting(E);
            if (!E.Stop)
            {
                Session.Delete((ObjectType)this);
                DeletedEventArgs X = new DeletedEventArgs();
                OnDeleted(X);
            }
        }
        /// <summary>
        /// Deletes the item
        /// </summary>
        public virtual void Delete()
        {
            var E = new DeletingEventArgs();

            OnDeleting(E);
            if (!E.Stop)
            {
                QueryProvider.Delete((ObjectType)this);
                var X = new DeletedEventArgs();
                OnDeleted(X);
            }
        }
        private void OnImageDeleted(object sender, DeletedEventArgs args)
        {
            Canvas imageCanvas = (Canvas)args.UIElement;

            switch (args.DeleteAction)
            {
            case DeleteAction.Deleted:
                if (_imageDictionary.ContainsKey(imageCanvas.Name))
                {
                    _imageDictionary.Remove(imageCanvas.Name);
                }
                break;

            case DeleteAction.DeleteUndone:
                if (!_imageDictionary.ContainsKey(imageCanvas.Name))
                {
                    _imageDictionary.Add(imageCanvas.Name, new InsetImage(imageCanvas));
                }
                break;
            }
        }
 /// <summary>
 /// Called when the item is Deleted
 /// </summary>
 /// <param name="e">DeletedEventArgs item</param>
 protected virtual void OnDeleted(DeletedEventArgs e)
 {
     Utilities.Events.EventHelper.Raise <DeletedEventArgs>(Deleted, this, e);
 }
 /// <summary>
 /// Called when the item is Deleted
 /// </summary>
 /// <param name="e">DeletedEventArgs item</param>
 protected virtual void OnDeleted(DeletedEventArgs e)
 {
     Deleted.Raise(this, e);
 }