CustomNamespaceFolderView architecture


Trying to grasp the full picture, so bear with me.

It looks like there is no relation between CustomNamespaceFolderView and the UserControl that displays folder contents. CustomNamespaceFolderView doesn't seem to have any knowledge about the UserControl and cannot delegate folder contents to it for display. In fact, as it currently stands, CustomNamespaceFolderView.CreateShellView() doesn't at all try to update the contents of UserControl.

My suggestion is to force UserControl to expose a function that could take an IEnumIDList and then do whatever it needs to do to display those contents properly. Something like this:
 public abstract class FolderViewUserControl : UserControl
    public abstract void Populate(IShellFolder folder, IEnumIDList lst);
and call this function in CustomNamespaceFolderView.CreateShellView():
   public CustomNamespaceFolderView(FolderViewUserControl customView)
      this.customView = customView;

    internal override IShellView CreateShellView(IShellFolder folder)
      IEnumIDList lst;
      folder.EnumObjects(IntPtr.Zero, SHCONTF.SHCONTF_FOLDERS, out lst);

      customView.Populate(folder, lst);

      return new ShellViewHost(customView);


dwmkerr wrote Jul 25 at 2:57 PM


Please move all discussions to the github site (github.com/dwmkerr/sharpshell). CodePlex is shutting down and I'm trying to retire the CodePlex repo.

Shujee wrote Jul 26 at 4:56 AM