public override void PostCopyItem(TRANSFER_SOURCE_FLAGS dwFlags, IShellItem psiItem, IShellItem psiDestinationFolder, string pszNewName, uint hrCopy, IShellItem psiNewlyCreated) { //if (hrCopy == 0) { // var destination = FileSystemListItem.InitializeWithIShellItem(this._View.LVHandle, psiDestinationFolder); // if (destination.Equals(this._View.CurrentFolder)) { // var theNewItem = FileSystemListItem.InitializeWithIShellItem(this._View.LVHandle, psiNewlyCreated); // Shell32.SHChangeNotify( // theNewItem.IsFolder ? Shell32.HChangeNotifyEventID.SHCNE_MKDIR : Shell32.HChangeNotifyEventID.SHCNE_CREATE, // Shell32.HChangeNotifyFlags.SHCNF_IDLIST | Shell32.HChangeNotifyFlags.SHCNF_FLUSH, theNewItem.PIDL, IntPtr.Zero); // this._View.LargeImageList.SupressThumbnailGeneration(false); // Shell32.SHChangeNotify(Shell32.HChangeNotifyEventID.SHCNE_UPDATEITEM, // Shell32.HChangeNotifyFlags.SHCNF_IDLIST | Shell32.HChangeNotifyFlags.SHCNF_FLUSH, theNewItem.PIDL, IntPtr.Zero); // theNewItem.Dispose(); // } // destination.Dispose(); //} //if (psiItem != null) { // Marshal.FinalReleaseComObject(psiItem); //} //if (psiNewlyCreated != null) { // Marshal.FinalReleaseComObject(psiNewlyCreated); //} //Shell32.SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1); }
internal ShellFileOpEventArgs(TRANSFER_SOURCE_FLAGS flags, IShellItem source, IShellItem folder = null, IShellItem dest = null, string name = null, HRESULT hr = default) { Flags = (TransferFlags)flags; if (source != null) { try { SourceItem = ShellItem.Open(source); } catch {} } if (folder != null) { try { DestFolder = ShellItem.Open(folder); } catch {} } if (dest != null) { try { DestItem = ShellItem.Open(dest); } catch {} } Name = name; Result = hr; }
public override void PostDeleteItem(TRANSFER_SOURCE_FLAGS dwFlags, IShellItem psiItem, uint hrDelete, IShellItem psiNewlyCreated) { //base.PostDeleteItem(dwFlags,psiItem,hrDelete,psiNewlyCreated); //if (hrDelete == 2555912) { // var theNewItem = FileSystemListItem.InitializeWithIShellItem(this._View.LVHandle, psiItem); // if (this._View.CurrentFolder.Equals(theNewItem.Parent)) { // Shell32.SHChangeNotify( // theNewItem.IsFolder ? Shell32.HChangeNotifyEventID.SHCNE_RMDIR : Shell32.HChangeNotifyEventID.SHCNE_DELETE, // Shell32.HChangeNotifyFlags.SHCNF_IDLIST | Shell32.HChangeNotifyFlags.SHCNF_FLUSH, theNewItem.PIDL, IntPtr.Zero); // } // theNewItem.Dispose(); //} //if (psiItem != null) { // Marshal.FinalReleaseComObject(psiItem); //} // if (psiNewlyCreated != null) { // Marshal.FinalReleaseComObject(psiNewlyCreated); // } //Shell32.SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1); }
internal ShellFileNewOpEventArgs(TRANSFER_SOURCE_FLAGS flags, IShellItem source, IShellItem folder, IShellItem dest, string name, HRESULT hr, string templ, uint attr) : base(flags, source, folder, dest, name, hr) { TemplateName = templ; FileAttributes = (System.IO.FileAttributes)attr; }
public virtual void PostDeleteItem(TRANSFER_SOURCE_FLAGS dwFlags, IShellItem psiItem, uint hrDelete, IShellItem psiNewlyCreated) { TraceAction("PostDeleteItem", psiItem, hrDelete); }
public virtual void PostCopyItem(TRANSFER_SOURCE_FLAGS dwFlags, IShellItem psiItem, IShellItem psiDestinationFolder, string pszNewName, uint hrCopy, IShellItem psiNewlyCreated) { TraceAction("PostCopyItem", psiNewlyCreated, hrCopy); }