Пример #1
0
        public HResult GetParent(out IShellItem ppsi)
        {
            var pidl = Shell32.ILClone(Pidl);

            if (Shell32.ILRemoveLastID(pidl))
            {
                ppsi = new ShellItemImpl(pidl, true);
                return(HResult.S_OK);
            }
            ppsi = null;
            return(HResult.MK_E_NOOBJECT);
        }
Пример #2
0
 public HResult GetParent(out IShellItem ppsi)
 {
     IntPtr pidl = Shell32.ILClone(m_Pidl);
     if (Shell32.ILRemoveLastID(pidl))
     {
         ppsi = new ShellItemImpl(pidl, true);
         return HResult.S_OK;
     }
     else
     {
         ppsi = null;
         return HResult.MK_E_NOOBJECT;
     }
 }
Пример #3
0
 static IShellItem CreateItemWithParent(ShellItem parent, IntPtr pidl)
 {
     if (RunningVista)
     {
         return(Shell32.SHCreateItemWithParent(IntPtr.Zero,
                                               parent.GetIShellFolder(), pidl, typeof(IShellItem).GUID));
     }
     else
     {
         Interop.VistaBridge.ShellItemImpl impl =
             (Interop.VistaBridge.ShellItemImpl)parent.ComInterface;
         return(new Interop.VistaBridge.ShellItemImpl(
                    Shell32.ILCombine(impl.Pidl, pidl), true));
     }
 }
Пример #4
0
        public int Compare(IShellItem psi, SICHINT hint)
        {
            ShellItemImpl other       = (ShellItemImpl)psi;
            ShellItemImpl myParent    = GetParent();
            ShellItemImpl theirParent = other.GetParent();

            if (Shell32.ILIsEqual(myParent.m_Pidl, theirParent.m_Pidl))
            {
                return(myParent.GetIShellFolder().CompareIDs((SHCIDS)hint,
                                                             Shell32.ILFindLastID(m_Pidl),
                                                             Shell32.ILFindLastID(other.m_Pidl)));
            }
            else
            {
                return(1);
            }
        }