int IShellFolder2.MapColumnToSCID(uint iColumn, out PROPERTYKEY pscid)
 {
     //  Use the ShellFolderImpl to handle the details.
     return ((IShellFolder2)shellFolderImpl).MapColumnToSCID(iColumn, out pscid);
 }
 int IShellFolder2.GetDetailsEx(IntPtr pidl, PROPERTYKEY pscid, out object pv)
 {
     //  Use the ShellFolderImpl to handle the details.
     return ((IShellFolder2)shellFolderImpl).GetDetailsEx(pidl, pscid, out pv);
 }
Пример #3
0
        int IShellFolder2.MapColumnToSCID(uint iColumn, out PROPERTYKEY pscid)
        {
            //  Get the detail columns.
            var columns = ((DefaultNamespaceFolderView)lazyFolderView.Value).Columns;

            //  If we've been asked for a column we don't have, return failure.
            if (iColumn >= columns.Count)
            {
                pscid = new PROPERTYKEY();
                return WinError.E_FAIL;
            }

            //  Get the column property id.
            pscid = columns[(int)iColumn].PropertyKey.CreateShellPropertyKey();

            //  We've mapped the column.
            return WinError.S_OK;
        }
Пример #4
0
 private string GetItemColumnValue(IntPtr pidl, PROPERTYKEY propertyKey)
 {
     //  Get the value for the property key.
     var item = GetChildItem(PidlManager.PidlToIdlist(pidl));
     var column = ((DefaultNamespaceFolderView)lazyFolderView.Value).Columns.FirstOrDefault(c =>
     {
         var key = c.PropertyKey.CreateShellPropertyKey();
         return key.fmtid == propertyKey.fmtid && key.pid == propertyKey.pid;
     });
     var detail = ((DefaultNamespaceFolderView)lazyFolderView.Value).GetItemDetail(item, column);
     return detail.ToString();
 }
Пример #5
0
        int IShellFolder2.GetDetailsEx(IntPtr pidl, PROPERTYKEY pkey, out object pv)
        {
            //  If we have no pidl, we cannot get details.
            if (pidl == IntPtr.Zero)
            {
                pv = null;
                return WinError.E_INVALIDARG;
            }

            // todo If the item is not a folder and the property key is PKEY_PropList_PreviewDetails
            //  we need to return a string like:
            //  "prop:Microsoft.SDKSample.AreaSize;Microsoft.SDKSample.NumberOfSides;Microsoft.SDKSample.DirectoryLevel");
            //  to indicate what to show in the details pane.

            /*
            if (!pfIsFolder && IsEqualPropertyKey(*pkey, PKEY_PropList_PreviewDetails))
        {
            // This proplist indicates what properties are shown in the details pane at the bottom of the explorer browser.
            pv->vt = VT_BSTR;
            pv->bstrVal = SysAllocString(L"prop:Microsoft.SDKSample.AreaSize;Microsoft.SDKSample.NumberOfSides;Microsoft.SDKSample.DirectoryLevel");
            hr = pv->bstrVal ? S_OK : E_OUTOFMEMORY;
        }*/

            //  Get the detail todo rename
            pv = GetItemColumnValue(pidl, pkey);

            //  We're done.
            return WinError.S_OK;
        }