internal static BrowserItemModel CreateBrowserItemModel(BrowserModel parent, BrowserTree tree) { return(tree.Type switch { BrowserEntryType.Directory => new BrowserFolderItemModel(parent, tree), BrowserEntryType.RegularFile => new BrowserFileItemModel(parent, tree), _ => throw new IndexOutOfRangeException("Type not in enum."), });
protected BrowserItemModel(BrowserModel parent, BrowserTree tree) { _parent = parent; _tree = tree; _name = tree.Name; }