コード例 #1
0
 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."),
     });
コード例 #2
0
 protected BrowserItemModel(BrowserModel parent, BrowserTree tree)
 {
     _parent = parent;
     _tree   = tree;
     _name   = tree.Name;
 }