gui-cs / TerminalGuiDesigner

Forms Designer for Terminal.Gui (aka gui.cs)
MIT License
423 stars 28 forks source link

TreeView<X> support #267

Open tznind opened 8 months ago

tznind commented 8 months ago

One of the cool things about TreeView is it's ability to support generics e.g.

      TreeView<FileSystemInfo> fileTree = new TreeView<FileSystemInfo>();
      TreeView<GameObject> tree = new TreeView<GameObject>();

I want to tackle this over the holiday period. At first I was worrying about the fact that the T type is arbitrary and likely tied to user code. Then I realized we can just parse the Roslyn code tree to find the names of the T classes and (if it's not a standard Type) declare our own completely empty ones pre compilation (i.e. at Open time)

e.g.

  // Just declare each of the users classes ourselves in memory
  class GameObject
  {

  }