BExplorer.Shell._Plugin_Interfaces.FileSystemListItem.InitializeWithParent C# (CSharp) Method

InitializeWithParent() public method

public InitializeWithParent ( ShellItem parent, IntPtr lvHandle, IntPtr pidl, int index ) : void
parent ShellItem
lvHandle System.IntPtr
pidl System.IntPtr
index int
return void
    public void InitializeWithParent(ShellItem parent, IntPtr lvHandle, IntPtr pidl, int index) {
      Initialize_Helper2(parent, pidl, lvHandle, index);
    }

Usage Example

Example #1
0
        public IEnumerable <IListItemEx> GetContents(Boolean isEnumHidden)
        {
            var folder = this.GetIShellFolder();

            if (folder == null)
            {
                yield return(null);
            }

            HResult navRes;
            var     flags = SHCONTF.FOLDERS | SHCONTF.NONFOLDERS | SHCONTF.CHECKING_FOR_CHILDREN | SHCONTF.ENABLE_ASYNC;

            if (isEnumHidden)
            {
                flags = SHCONTF.FOLDERS | SHCONTF.INCLUDEHIDDEN | SHCONTF.INCLUDESUPERHIDDEN | SHCONTF.NONFOLDERS | SHCONTF.CHECKING_FOR_CHILDREN | SHCONTF.ENABLE_ASYNC;
            }

            var enumId = ShellItem.GetIEnumIDList(folder, flags, out navRes);

            this.NavigationStatus = navRes;
            uint   count;
            IntPtr pidl;

            if (enumId == null)
            {
                yield break;
            }

            var result = enumId.Next(1, out pidl, out count);
            var i      = 0;

            while (result == HResult.S_OK)
            {
                //var sb = new StringBuilder(512);
                //Shell32.SHGetPathFromIDList(pidl, sb);
                //var ext = Path.GetExtension(sb.ToString());
                var fsi = new FileSystemListItem();
                try {
                    fsi.InitializeWithParent(this.PIDL, this.ParentHandle, pidl, i++);
                } catch {
                    continue;
                }
                fsi.IsParentSearchFolder = this.IsSearchFolder;
                yield return(fsi);

                //Shell32.ILFree(pidl);
                result = enumId.Next(1, out pidl, out count);
            }

            if (result != HResult.S_FALSE)
            {
                //Marshal.ThrowExceptionForHR((int)result);
            }

            //parentItem.Dispose();
            yield break;
        }
All Usage Examples Of BExplorer.Shell._Plugin_Interfaces.FileSystemListItem::InitializeWithParent