This project is read-only.
1
Vote

CustomNamespaceFolderView architecture

description

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);
    }

comments

dwmkerr wrote Jul 25 at 3:57 PM

Hi,

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 5:56 AM

Moved.