@@ -13,12 +13,11 @@ public interface ITree
13
13
bool DisplayRootNode { get ; }
14
14
bool IsCheckable { get ; }
15
15
string PathSeparator { get ; }
16
- string PathIgnoreRoot { get ; }
17
16
}
18
17
19
18
public static class TreeLoader
20
19
{
21
- public static void Load ( ITree tree , IEnumerable < ITreeData > data )
20
+ public static void Load ( ITree tree , IEnumerable < ITreeData > treeDatas )
22
21
{
23
22
var collapsedFolders = tree . GetCollapsedFolders ( ) ;
24
23
@@ -33,19 +32,9 @@ public static void Load(ITree tree, IEnumerable<ITreeData> data)
33
32
34
33
var folders = new HashSet < string > ( ) ;
35
34
36
- foreach ( var d in data )
35
+ foreach ( var treeData in treeDatas )
37
36
{
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 ) ;
49
38
for ( int i = 0 ; i < parts . Length ; i ++ )
50
39
{
51
40
var label = parts [ i ] ;
@@ -86,7 +75,7 @@ public static void Load(ITree tree, IEnumerable<ITreeData> data)
86
75
87
76
}
88
77
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 ) ;
90
79
}
91
80
}
92
81
}
0 commit comments