コード例 #1
0
ファイル: ShellThumbnail.cs プロジェクト: pmorton/Log2Console
        /// <summary>
        /// Internal constructor that takes in a parent ShellObject.
        /// </summary>
        /// <param name="shellObject"></param>
        internal ShellThumbnail(ShellObject shellObject)
        {
            if (shellObject == null || shellObject.NativeShellItem == null)
                throw new ArgumentNullException("shellObject");

            shellItemNative = shellObject.NativeShellItem;
        }
コード例 #2
0
        private static string GetParsingName(IShellItem shellItem)
        {
            if (shellItem == null)
                return null;

            string path = null;

            IntPtr pszPath = IntPtr.Zero;
            int hr = shellItem.GetDisplayName(Shell32.SIGDN.SIGDN_DESKTOPABSOLUTEPARSING, out pszPath);

            if (false ==
                    (hr == HRESULT.S_OK ||
                     hr == HRESULT.E_INVALIDARG))
                throw new COMException("GetParsingName", (int)hr);

            if (pszPath != IntPtr.Zero)
            {
                path = Marshal.PtrToStringAuto(pszPath);
                Marshal.FreeCoTaskMem(pszPath);
                pszPath = IntPtr.Zero;
            }

            return path;

        }
コード例 #3
0
        private static void TraceAction(string action, IShellItem item, uint hresult)
        {

            //TraceAction(action, 
            //   item != null ?  Marshal.PtrToStringUni(item.GetDisplayName(WindowsAPI.SIGDN.NORMALDISPLAY)) : null, 
            //   hresult);
        }
コード例 #4
0
 public virtual void PostNewItem(uint dwFlags, 
     IShellItem psiDestinationFolder, string pszNewName,
     string pszTemplateName, uint dwFileAttributes, 
     uint hrNew, IShellItem psiNewItem)
 {
     TraceAction("PostNewItem", psiNewItem, hrNew);
 }
コード例 #5
0
 public virtual void PostCopyItem(
     uint dwFlags, IShellItem psiItem,
     IShellItem psiDestinationFolder, string pszNewName,
     uint hrCopy, IShellItem psiNewlyCreated)
 {
     TraceAction("PostCopyItem", psiNewlyCreated, hrCopy);
 }
コード例 #6
0
 public void PostMoveItem(
     uint dwFlags, IShellItem psiItem, 
     IShellItem psiDestinationFolder,
     string pszNewName, uint hrMove, 
     IShellItem psiNewlyCreated)
 {
     TraceAction("PostMoveItem", psiNewlyCreated, hrMove);
 }
コード例 #7
0
ファイル: ShellHelper.cs プロジェクト: TanyaTPG/Log2Console
        internal static IntPtr PidlFromShellItem(IShellItem nativeShellItem)
        {
            IntPtr shellItem = Marshal.GetComInterfaceForObject(nativeShellItem, typeof(IShellItem));
            IntPtr pidl;

            int retCode = ShellNativeMethods.SHGetIDListFromObject(shellItem, out pidl);

            return (CoreErrorHelper.Succeeded(retCode) ? pidl : IntPtr.Zero);
        }
コード例 #8
0
 private static IShellItem GetShellItemFromFolder(IShellItem shellItem, IShellFolder shellFolder)
 {
     if (shellItem == null && shellFolder == null)
         throw new ArgumentNullException("shellItem, shellFolder", "shellItem and shellFolder cannot both be null");
     if (shellItem != null)
         return shellItem;
     IdList pidl = SHGetIDListFromObject(shellFolder);
     return SHCreateItemFromIDList<IShellItem>(pidl);
 }
コード例 #9
0
 internal ShellFolder(IShellItem shellItem, IShellFolder shellFolder, ShellItemKnownInfo knownInfo)
     : base(GetShellItemFromFolder(shellItem, shellFolder), knownInfo)
 {
     if (shellFolder == null)
     {
         shellFolder = (IShellFolder)shellItem.BindToHandler(null, ShellConsts.BHID_SFObject, typeof(IShellFolder).GUID);
     }
     NativeFolder = shellFolder;
 }
コード例 #10
0
        /// <summary>
        /// Internal constructor that takes in a parent ShellObject.
        /// </summary>
        /// <param name="shellObject"></param>
        internal ShellThumbnail(ShellObject shellObject)
        {
            if (shellObject == null || shellObject.NativeShellItem == null)
            {
                throw new ArgumentNullException(nameof(shellObject));
            }

            shellItemNative = shellObject.NativeShellItem;
        }
コード例 #11
0
ファイル: ShellItemArray.cs プロジェクト: GodLesZ/svn-dump
		public HResult GetItemAt(uint dwIndex, out IShellItem ppsi) {
			int index = (int)dwIndex;

			if (index < shellItemsList.Count) {
				ppsi = shellItemsList[index];
				return HResult.Ok;
			} else {
				ppsi = null;
				return HResult.Fail;
			}
		}
コード例 #12
0
		public HResult GetParent(out IShellItem ppsi) {
			IntPtr pidl = Shell32.ILClone(Pidl);
			if (Shell32.ILRemoveLastID(pidl)) {
				ppsi = new ShellItemImpl(pidl, true);
				return HResult.S_OK;
			}
			else {
				ppsi = null;
				return HResult.MK_E_NOOBJECT;
			}
		}
コード例 #13
0
ファイル: ShellItemArray.cs プロジェクト: pmorton/Log2Console
        public HRESULT GetItemAt(uint dwIndex, out IShellItem ppsi)
        {
            int index = (int)dwIndex;

            if (index < shellItemsList.Count)
            {
                ppsi = shellItemsList[index];
                return HRESULT.S_OK;
            }
            else
            {
                ppsi = null;
                return HRESULT.E_FAIL;
            }
        }
コード例 #14
0
		void IShellItemArray.GetItemAt(uint dwIndex, out IShellItem ppsi)
		{
			int index = (int)dwIndex;

			if (index < shellItemsList.Count)
			{
				ppsi = shellItemsList[index];
				//return HResult.S_OK;
			}
			else
			{
				ppsi = null;
				//return HResult.S_FALSE;
			}
		}
コード例 #15
0
		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);
		}
コード例 #16
0
ファイル: ShellHelper.cs プロジェクト: GodLesZ/svn-dump
		internal static string GetParsingName(IShellItem shellItem) {
			if (shellItem == null) { return null; }

			string path = null;

			IntPtr pszPath = IntPtr.Zero;
			HResult hr = shellItem.GetDisplayName(ShellNativeMethods.ShellItemDesignNameOptions.DesktopAbsoluteParsing, out pszPath);

			if (hr != HResult.Ok && hr != HResult.InvalidArguments) {
				throw new ShellException(LocalizedMessages.ShellHelperGetParsingNameFailed, hr);
			}

			if (pszPath != IntPtr.Zero) {
				path = Marshal.PtrToStringAuto(pszPath);
				Marshal.FreeCoTaskMem(pszPath);
				pszPath = IntPtr.Zero;
			}

			return path;

		}
コード例 #17
0
		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);
		}
コード例 #18
0
 public virtual void PostDeleteItem(
     uint dwFlags, IShellItem psiItem,
     uint hrDelete, IShellItem psiNewlyCreated)
 {
     TraceAction("PostDeleteItem", psiItem, hrDelete);
 }
コード例 #19
0
ファイル: Shell32.cs プロジェクト: tevfikoguz/SapCleaner
 public static extern void SHCreateItemFromParsingName(
     [In][MarshalAs(UnmanagedType.LPWStr)] string pszPath,
     [In] IntPtr pbc,
     [In][MarshalAs(UnmanagedType.LPStruct)] Guid riid,
     [Out][MarshalAs(UnmanagedType.Interface, IidParameterIndex = 2)] out IShellItem ppv);
コード例 #20
0
        private void printProperties(IShellItem shellItem)
        {
            string s = string.Join(";\n", shellItem.GetAllProperties().Select(x => x.Key + "=" + x.Value).ToArray());

            Console.WriteLine(s);
        }
コード例 #21
0
 /// <summary>Adds a folder to the library.</summary>
 /// <param name="location">An IShellItem object that represents the folder to be added to the library.</param>
 void AddFolder([In, MarshalAs(UnmanagedType.Interface)] IShellItem location);
コード例 #22
0
 internal static extern int SHCreateShellItem(
     IntPtr pidlParent,
     [In, MarshalAs(UnmanagedType.Interface)] IShellFolder psfParent,
     IntPtr pidl,
     [MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi
     );
コード例 #23
0
ファイル: ShellProvider.cs プロジェクト: terrajobst/maui
 public static string GetPathFromShellItem(IShellItem item)
 {
     return(item.GetDisplayName(SIGDN.DESKTOPABSOLUTEPARSING));
 }
コード例 #24
0
ファイル: CommonFileDialog.cs プロジェクト: ssickles/archive
 public void OnOverwrite(IFileDialog pfd, IShellItem psi, out NativeMethods.FDE_OVERWRITE_RESPONSE pResponse)
 {
     // TODO: Implement overwrite notification support
     pResponse = NativeMethods.FDE_OVERWRITE_RESPONSE.FDEOR_ACCEPT;
 }
コード例 #25
0
 public virtual void PreRenameItem(uint dwFlags, 
     IShellItem psiItem, string pszNewName)
 {
     TraceAction("PreRenameItem", psiItem, 0);
 }
コード例 #26
0
 public static extern HRESULT SHCreateShellItem(IntPtr pidlParent, IntPtr psfParent, IntPtr pidl, out IShellItem ppsi);
コード例 #27
0
 public void OnShareViolation(IFileDialog pfd, IShellItem psi, out FDE_SHAREVIOLATION_RESPONSE pResponse)
 {
     pResponse = FDE_SHAREVIOLATION_RESPONSE.FDESVR_ACCEPT;
 }
コード例 #28
0
ファイル: FolderPicker.cs プロジェクト: TezaSoe/LogEdit
 private static extern int SHCreateItemFromParsingName([MarshalAs(UnmanagedType.LPWStr)] string pszPath, IBindCtx pbc, [MarshalAs(UnmanagedType.LPStruct)] Guid riid, out IShellItem ppv);
コード例 #29
0
        private static ImageData LoadThumbnail(string path, DateTime dtLastWriteTime, out Size sizeRaw, out Size sizeActual, out string toolTipText, out bool fCached)
        {
            sizeRaw     = sizeActual = Size.Empty;
            toolTipText = null;
            fCached     = false;
            IntPtr              zero     = IntPtr.Zero;
            IShellItem          ppsi     = null;
            ISharedBitmap       ppvThumb = null;
            LocalThumbnailCache o        = null;

            try {
                zero = PInvoke.ILCreateFromPath(path);
                if ((zero != IntPtr.Zero) && (PInvoke.SHCreateShellItem(IntPtr.Zero, null, zero, out ppsi) == 0))
                {
                    o = new LocalThumbnailCache();
                    IThumbnailCache cache2                = (IThumbnailCache)o;
                    uint            flags                 = 0;
                    uint            pOutFlags             = 0;
                    WTS_THUMBNAILID pThumbnailID          = new WTS_THUMBNAILID();
                    uint            cxyRequestedThumbSize = (uint)Math.Min(0x400, Math.Min(QTUtility.PreviewMaxWidth, QTUtility.PreviewMaxHeight));
                    if (cache2.GetThumbnail(ppsi, cxyRequestedThumbSize, flags, out ppvThumb, ref pOutFlags, ref pThumbnailID) == 0)
                    {
                        IntPtr ptr2;
                        if ((pOutFlags & 2) == 2)
                        {
                            fCached = true;
                        }
                        if (ppvThumb.Detach(out ptr2) == 0)
                        {
                            Bitmap bmp  = Image.FromHbitmap(ptr2);
                            Size   size = bmp.Size;
                            sizeRaw = sizeActual = size;
                            ImageData data = new ImageData(bmp, null, path, dtLastWriteTime, size, size);
                            data.Thumbnail = true;
                            try {
                                toolTipText = data.TooltipText = ShellMethods.GetShellInfoTipText(zero, false);
                            }
                            catch {
                            }
                            return(data);
                        }
                    }
                }
            }
            catch (Exception exception) {
                QTUtility2.MakeErrorLog(exception, null);
            }
            finally {
                if (zero != IntPtr.Zero)
                {
                    PInvoke.CoTaskMemFree(zero);
                }
                if (ppsi != null)
                {
                    Marshal.ReleaseComObject(ppsi);
                }
                if (ppvThumb != null)
                {
                    Marshal.ReleaseComObject(ppvThumb);
                }
                if (o != null)
                {
                    Marshal.ReleaseComObject(o);
                }
            }
            return(null);
        }
コード例 #30
0
 public virtual void PreNewItem(uint dwFlags,
                                IShellItem psiDestinationFolder, string pszNewName)
 {
     TraceAction("PreNewItem", pszNewName, 0);
 }
コード例 #31
0
 private static extern int SHCreateShellItem(IntPtr pidlParent, IntPtr psfParent, IntPtr pidl, out IShellItem ppsi);
コード例 #32
0
 public virtual void PostRenameItem(uint dwFlags,
                                    IShellItem psiItem, string pszNewName,
                                    uint hrRename, IShellItem psiNewlyCreated)
 {
     TraceAction("PostRenameItem", psiNewlyCreated, hrRename);
 }
コード例 #33
0
 internal static extern int SHCreateItemFromParsingName(
     [MarshalAs(UnmanagedType.LPWStr)] string path,
     // The following parameter is not used - binding context.
     IntPtr pbc,
     ref Guid riid,
     [MarshalAs(UnmanagedType.Interface)] out IShellItem shellItem);
コード例 #34
0
 public virtual void PostDeleteItem(
     uint dwFlags, IShellItem psiItem, 
     uint hrDelete, IShellItem psiNewlyCreated)
 {
     TraceAction("PostDeleteItem", psiItem, hrDelete);
 }
コード例 #35
0
 internal static extern int SHShowManageLibraryUI(
     [In, MarshalAs(UnmanagedType.Interface)] IShellItem library,
     [In] IntPtr hwndOwner,
     [In] string title,
     [In] string instruction,
     [In] LibraryManageDialogOptions lmdOptions);
コード例 #36
0
 private static extern int SHCreateShellItem(IntPtr pidlParent, IntPtr psfParent, IntPtr pidl, out IShellItem ppsi);
コード例 #37
0
 /// <summary>Initializes a new instance of the <see cref="ShellFolder"/> class.</summary>
 internal ShellFolder(IShellItem iShellItem) : base(iShellItem) => iShellFolder = GetInstance();
コード例 #38
0
 internal string GetFileNameFromShellItem(IShellItem item)
 {
     string filename;
     item.GetDisplayName(NativeMethods.SIGDN.DESKTOPABSOLUTEPARSING, out filename);
     return filename;
 }
コード例 #39
0
 internal static extern int SHCreateItemFromParsingName([MarshalAs(UnmanagedType.LPWStr)] string pszPath, IntPtr pbc, ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out IShellItem ppv);
コード例 #40
0
 public void OnShareViolation(IFileDialog pfd, IShellItem psi, out NativeMethods.RESPONSE pResponse)
 {
     // Do nothing: we will ignore share violations, and don't register
     // for them, so this method should never be called
     pResponse = NativeMethods.RESPONSE.ACCEPT;
 }
コード例 #41
0
ファイル: ShellItem.cs プロジェクト: LGM-AdrianHum/GongShell
 /// <summary>
 ///     Initializes a new instance of the <see cref="ShellItem" /> class.
 /// </summary>
 /// <param name="comInterface">
 ///     An <see cref="IShellItem" /> representing the folder.
 /// </param>
 public ShellItem(IShellItem comInterface)
 {
     ComInterface = comInterface;
 }
コード例 #42
0
 public virtual void PreRenameItem(uint dwFlags,
                                   IShellItem psiItem, string pszNewName)
 {
     TraceAction("PreRenameItem", psiItem, 0);
 }
コード例 #43
0
 void IIconNativeApi.SHCreateItemFromParsingName(string pszPath, IntPtr pbc, Guid riid, out IShellItem ppv)
 {
     SHCreateItemFromParsingName(pszPath, pbc, riid, out ppv);
 }
コード例 #44
0
ファイル: ShellItem.cs プロジェクト: poizan42/PSShellProvider
 internal ShellItem(IdList pidl, ShellItemKnownInfo knownInfo)
 {
     nativeItem = SHCreateItemFromIDList <IShellItem>(pidl);
     Init(knownInfo);
 }
コード例 #45
0
 public void OnOverwrite(IFileDialog pfd, IShellItem psi, out FDE_OVERWRITE_RESPONSE pResponse)
 {
     pResponse = FDE_OVERWRITE_RESPONSE.FDEOR_DEFAULT;
 }
コード例 #46
0
 public virtual void PreDeleteItem(
     uint dwFlags, IShellItem psiItem)
 {
     TraceAction("PreDeleteItem", psiItem, 0);
 }
コード例 #47
0
 internal ShellItemArray(IShellItem[] shellItems)
 {
     shellItemsList.AddRange(shellItems);
 }
コード例 #48
0
 public static extern int SHCreateShellItem(IntPtr pidlParent, Interop.QTTabBar.IShellFolder psfParent, IntPtr pidl, out IShellItem ppsi);
コード例 #49
0
 public virtual void PostRenameItem(uint dwFlags, 
     IShellItem psiItem, string pszNewName, 
     uint hrRename, IShellItem psiNewlyCreated)
 {
     TraceAction("PostRenameItem", psiNewlyCreated, hrRename);
 }
コード例 #50
0
 /// <summary>Initializes a new instance of the <see cref="ShellLibrary"/> class.</summary>
 /// <param name="iItem">The i item.</param>
 /// <param name="readOnly">if set to <c>true</c> [read only].</param>
 internal ShellLibrary(IShellItem iItem, bool readOnly = false) : base(iItem)
 {
     lib = new IShellLibrary();
     lib.LoadLibraryFromItem(iItem, readOnly ? STGM.STGM_READ : STGM.STGM_READWRITE);
 }
コード例 #51
0
 public virtual void PreDeleteItem(
     uint dwFlags, IShellItem psiItem)
 {
     TraceAction("PreDeleteItem", psiItem, 0);
 }
コード例 #52
0
        /// <summary>
        /// Creates a ShellObject given a native IShellItem interface
        /// </summary>
        /// <param name="nativeShellItem"></param>
        /// <returns>A newly constructed ShellObject object</returns>
        public static ShellObject Create(IShellItem nativeShellItem)
        {
            // Sanity check
            Debug.Assert(nativeShellItem != null, "nativeShellItem should not be null");

            // Need to make sure we're running on Vista or higher
            if (!CoreHelpers.RunningOnVista)
            {
                throw new PlatformNotSupportedException(LocalizedMessages.ShellObjectFactoryPlatformNotSupported);
            }

            // A lot of APIs need IShellItem2, so just keep a copy of it here
            IShellItem2 nativeShellItem2 = nativeShellItem as IShellItem2;

            // Get the System.ItemType property
            string itemType = ShellHelper.GetItemType(nativeShellItem2);

            if (!string.IsNullOrEmpty(itemType))
            {
                itemType = itemType.ToUpperInvariant();
            }

            // Get some IShellItem attributes
            ShellNativeMethods.ShellFileGetAttributesOptions sfgao;
            nativeShellItem2.GetAttributes(ShellNativeMethods.ShellFileGetAttributesOptions.FileSystem | ShellNativeMethods.ShellFileGetAttributesOptions.Folder, out sfgao);

            // Is this item a FileSystem item?
            bool isFileSystem = (sfgao & ShellNativeMethods.ShellFileGetAttributesOptions.FileSystem) != 0;

            // Is this item a Folder?
            bool isFolder = (sfgao & ShellNativeMethods.ShellFileGetAttributesOptions.Folder) != 0;

            // Shell Library
            ShellLibrary shellLibrary = null;

            // Create the right type of ShellObject based on the above information

            // 1. First check if this is a Shell Link
            if (itemType == ".lnk")
            {
                return(new ShellLink(nativeShellItem2));
            }
            // 2. Check if this is a container or a single item (entity)
            else if (isFolder)
            {
                // 3. If this is a folder, check for types: Shell Library, Shell Folder or Search Container
                if (itemType == ".library-ms" && (shellLibrary = ShellLibrary.FromShellItem(nativeShellItem2, true)) != null)
                {
                    return(shellLibrary); // we already created this above while checking for Library
                }
                else if (itemType == ".searchconnector-ms")
                {
                    return(new ShellSearchConnector(nativeShellItem2));
                }
                else if (itemType == ".search-ms")
                {
                    return(new ShellSavedSearchCollection(nativeShellItem2));
                }

                // 4. It's a ShellFolder
                if (isFileSystem)
                {
                    // 5. Is it a (File-System / Non-Virtual) Known Folder
                    if (!IsVirtualKnownFolder(nativeShellItem2))
                    { //needs to check if it is a known folder and not virtual
                        FileSystemKnownFolder kf = new FileSystemKnownFolder(nativeShellItem2);
                        return(kf);
                    }

                    return(new ShellFileSystemFolder(nativeShellItem2));
                }

                // 5. Is it a (Non File-System / Virtual) Known Folder
                if (IsVirtualKnownFolder(nativeShellItem2))
                { //needs to check if known folder is virtual
                    NonFileSystemKnownFolder kf = new NonFileSystemKnownFolder(nativeShellItem2);
                    return(kf);
                }

                return(new ShellNonFileSystemFolder(nativeShellItem2));
            }

            // 6. If this is an entity (single item), check if its filesystem or not
            if (isFileSystem)
            {
                return(new ShellFile(nativeShellItem2));
            }

            return(new ShellNonFileSystemItem(nativeShellItem2));
        }
コード例 #53
0
 public virtual void PreNewItem(uint dwFlags, 
     IShellItem psiDestinationFolder, string pszNewName)
 {
     TraceAction("PreNewItem", pszNewName, 0);
 }
コード例 #54
0
 public void OnShareViolation(IFileDialog pfd, IShellItem psi, out NativeMethods.FDE_SHAREVIOLATION_RESPONSE pResponse)
 {
     // Do nothing: we will ignore share violations, and don't register
     // for them, so this method should never be called
     pResponse = NativeMethods.FDE_SHAREVIOLATION_RESPONSE.FDESVR_ACCEPT;
 }
コード例 #55
0
ファイル: ShellProvider.cs プロジェクト: JianwenSun/cc
 public static string GetPathFromShellItem(IShellItem item)
 {
     return item.GetDisplayName(SIGDN.DESKTOPABSOLUTEPARSING);
 }
コード例 #56
0
 public void OnOverwrite(IFileDialog pfd, IShellItem psi, out NativeMethods.FDE_OVERWRITE_RESPONSE pResponse)
 {
     // TODO: Implement overwrite notification support
     pResponse = NativeMethods.FDE_OVERWRITE_RESPONSE.FDEOR_ACCEPT;
 }
コード例 #57
0
 public HRESULT OnFolderChanging(IFileDialog pfd, IShellItem psiFolder)
 {
     return HRESULT.S_OK;
 }
コード例 #58
0
ファイル: ShellLibrary2.cs プロジェクト: zhuxb711/Files
 /// <summary>Initializes a new instance of the <see cref="ShellLibrary"/> class.</summary>
 /// <param name="iItem">The i item.</param>
 /// <param name="readOnly">if set to <c>true</c> [read only].</param>
 public ShellLibrary2(IShellItem iItem, bool readOnly = false)
 {
     lib = new IShellLibrary();
     lib.LoadLibraryFromItem(iItem, readOnly ? STGM.STGM_READ : STGM.STGM_READWRITE);
     Init(iItem);
 }
コード例 #59
0
 public void OnOverwrite(IFileDialog pfd, IShellItem psi, out NativeMethods.RESPONSE pResponse)
 {
     pResponse = NativeMethods.RESPONSE.ACCEPT;
 }
コード例 #60
0
ファイル: ShellItem.cs プロジェクト: poizan42/PSShellProvider
 internal ShellItem(IShellItem nativeItem, ShellItemKnownInfo knownInfo)
 {
     this.nativeItem = nativeItem;
     Init(knownInfo);
 }