public void NewItem(string folderName, string name, FileAttributes attrs) { ThrowIfDisposed(); using (ComReleaser <IShellItem> folderItem = CreateShellItem(folderName)) { _fileOperation.NewItem(folderItem.Item, attrs, name, string.Empty, _callbackSink); } }
//public HResult DeleteItems(object punkItems) => throw new NotImplementedException(); public void NewItem(IShellItem psiDestinationFolder, FileAttributes dwFileAttributes, string pszName, string pszTemplateName, FileOperationProgressSink pfopsItem) { if (disposed) { throw new ObjectDisposedException(nameof(FileOperation)); } HResult hr = fileOperation.NewItem(psiDestinationFolder, dwFileAttributes, pszName, pszTemplateName, pfopsItem?.FileOperationProgressSinkInternal); if (!CoreErrorHelper.Succeeded(hr)) { Marshal.ThrowExceptionForHR((int)hr); } }
public void NewItem(string folderName, string name, FileAttributes attrs) { IShellItem folderItem = SafeNativeMethods.CreateShellItem(folderName); fileOperation.NewItem(folderItem, attrs, name, string.Empty, null); }