@@ -13,12 +13,11 @@ public interface ITree
1313 bool DisplayRootNode { get ; }
1414 bool IsCheckable { get ; }
1515 string PathSeparator { get ; }
16- string PathIgnoreRoot { get ; }
1716 }
1817
1918 public static class TreeLoader
2019 {
21- public static void Load ( ITree tree , IEnumerable < ITreeData > data )
20+ public static void Load ( ITree tree , IEnumerable < ITreeData > treeDatas )
2221 {
2322 var collapsedFolders = tree . GetCollapsedFolders ( ) ;
2423
@@ -33,19 +32,9 @@ public static void Load(ITree tree, IEnumerable<ITreeData> data)
3332
3433 var folders = new HashSet < string > ( ) ;
3534
36- foreach ( var d in data )
35+ foreach ( var treeData in treeDatas )
3736 {
38- var path = d . Path ;
39- if ( tree . PathIgnoreRoot != null )
40- {
41- var indexOf = path . IndexOf ( tree . PathIgnoreRoot ) ;
42- if ( indexOf != - 1 )
43- {
44- path = path . Substring ( indexOf + tree . PathIgnoreRoot . Length ) ;
45- }
46- }
47-
48- var parts = path . Split ( new [ ] { tree . PathSeparator } , StringSplitOptions . None ) ;
37+ var parts = treeData . Path . Split ( new [ ] { tree . PathSeparator } , StringSplitOptions . None ) ;
4938 for ( int i = 0 ; i < parts . Length ; i ++ )
5039 {
5140 var label = parts [ i ] ;
@@ -86,7 +75,7 @@ public static void Load(ITree tree, IEnumerable<ITreeData> data)
8675
8776 }
8877
89- tree . AddNode ( fullPath : d . FullPath , path : nodePath , label : label , level : i + displayRootLevel , isFolder : isFolder , isActive : d . IsActive , isHidden : nodeIsHidden , isCollapsed : nodeIsCollapsed ) ;
78+ tree . AddNode ( fullPath : treeData . FullPath , path : nodePath , label : label , level : i + displayRootLevel , isFolder : isFolder , isActive : treeData . IsActive , isHidden : nodeIsHidden , isCollapsed : nodeIsCollapsed ) ;
9079 }
9180 }
9281 }
0 commit comments