Ejemplo n.º 1
0
        /// <summary>
        /// The 'On Item Copied' Event Handler: Called when an Item (File or Folder) Is Copied from the Source to Destination
        /// </summary>
        /// <param name="e">The 'Item Copied' Event Arguments.</param>
        protected virtual void OnItemCopied(ItemCopiedEventArgs e)
        {
            ItemCopiedEventHandler Handler = ItemCopied;

            if (Handler != null)
            {
                foreach (ItemCopiedEventHandler Caster in Handler.GetInvocationList())
                {
                    ISynchronizeInvoke SyncInvoke = Caster.Target as ISynchronizeInvoke;
                    try
                    {
                        if (SyncInvoke != null && SyncInvoke.InvokeRequired)
                        {
                            SyncInvoke.Invoke(Handler, new object[] { this, e });
                        }
                        else
                        {
                            Caster(this, e);
                        }
                    }
                    catch
                    { }
                }
            }
        }
 private void ItemCopiedNotification(object sender, ItemCopiedEventArgs args)
 {
     Assert.ArgumentNotNull(sender, "sender");
     Assert.ArgumentNotNull(args, "args");
     Item folder = this.ContentEditorDataContext.GetFolder();
     if (Settings.ContentEditor.ClassicFrameEventPropagation || ((folder != null) && ((folder.ID == args.Copy.ID) || (folder.ID == args.Copy.ParentID))))
     {
         SheerResponse.Eval("scContent.postMessage(\"" + ("notification:itemcopied(source=" + GetUri(args.Source) + ",copy=" + GetUri(args.Copy) + ")") + "\")");
     }
 }