@@ -148,6 +148,11 @@ namespace IDE
148148 StopWatching ( ) ;
149149 }
150150
151+ public virtual void PreDelete ( )
152+ {
153+
154+ }
155+
151156 public void GetFullImportPath ( String outFullPath )
152157 {
153158 if ( mProject . IsSingleFile )
@@ -585,7 +590,7 @@ namespace IDE
585590 AddChildAtIndex ( pos , item ) ;
586591 }
587592
588- public virtual void RemoveChild ( ProjectItem item )
593+ public virtual void RemoveChild ( ProjectItem item , bool isExplicitDelete )
589594 {
590595 var projectFileItem = item as ProjectFileItem ;
591596 if ( projectFileItem ! = null )
@@ -910,6 +915,37 @@ namespace IDE
910915 {
911916 return DarkTheme . sDarkTheme . GetImage ( . ProjectFolder ) ;
912917 }
918+
919+ public void WithProjectItems ( delegate void( ProjectItem ) func)
920+ {
921+ List < int32 > idxStack = scope List< int32 > ( ) ;
922+ List < ProjectFolder > folderStack = scope List< ProjectFolder > ( ) ;
923+
924+ folderStack . Add ( this ) ;
925+ idxStack . Add ( 0 ) ;
926+
927+ while ( folderStack . Count > 0 )
928+ {
929+ int32 curIdx = idxStack [ idxStack . Count - 1 ] ++ ;
930+ ProjectFolder curFolder = folderStack [ folderStack . Count - 1 ] ;
931+ if ( curIdx >= curFolder . mChildItems . Count )
932+ {
933+ folderStack. RemoveAt ( folderStack . Count - 1 ) ;
934+ idxStack. RemoveAt ( idxStack . Count - 1 ) ;
935+ continue ;
936+ }
937+
938+ var projectItem = curFolder. mChildItems [ curIdx ] ;
939+ if ( projectItem is ProjectFolder )
940+ {
941+ folderStack. Add ( ( ProjectFolder ) projectItem ) ;
942+ idxStack. Add ( 0 ) ;
943+ continue ;
944+ }
945+
946+ func( projectItem ) ;
947+ }
948+ }
913949 }
914950
915951 [ Reflect ( . StaticFields | . NonStaticFields | . ApplyToInnerTypes ) ]
@@ -2520,33 +2556,7 @@ namespace IDE
25202556
25212557 public void WithProjectItems( delegate void ( ProjectItem) func)
25222558 {
2523- List< int32> idxStack = scope List< int32> ( ) ;
2524- List< ProjectFolder> folderStack = scope List< ProjectFolder> ( ) ;
2525-
2526- folderStack. Add( mRootFolder) ;
2527- idxStack. Add( 0 ) ;
2528-
2529- while ( folderStack. Count > 0 )
2530- {
2531- int32 curIdx = idxStack[ idxStack. Count - 1 ] ++ ;
2532- ProjectFolder curFolder = folderStack[ folderStack. Count - 1 ] ;
2533- if ( curIdx >= curFolder. mChildItems. Count)
2534- {
2535- folderStack. RemoveAt( folderStack. Count - 1 ) ;
2536- idxStack. RemoveAt( idxStack. Count - 1 ) ;
2537- continue ;
2538- }
2539-
2540- var projectItem = curFolder. mChildItems[ curIdx] ;
2541- if ( projectItem is ProjectFolder)
2542- {
2543- folderStack. Add( ( ProjectFolder) projectItem) ;
2544- idxStack. Add( 0 ) ;
2545- continue ;
2546- }
2547-
2548- func( projectItem) ;
2549- }
2559+ mRootFolder. WithProjectItems( func) ;
25502560 }
25512561
25522562 public VerSpec* GetDependency( String projectName, bool checkRecursively = true)
0 commit comments