@@ -64,7 +64,7 @@ public class FileManagerCli : BaseInteractiveTui<FileSystemInfo>, IInteractiveTu
64
64
/// <summary>
65
65
/// File manager bindings
66
66
/// </summary>
67
- public override List < InteractiveTuiBinding > Bindings { get ; set ; } =
67
+ public override InteractiveTuiBinding [ ] Bindings { get ; } =
68
68
[
69
69
new ( "Open" , ConsoleKey . Enter , default , ( info , _ ) => Open ( ( FileSystemInfo ) info ) ) ,
70
70
new ( "Copy" , ConsoleKey . F1 , default , ( info , _ ) => CopyFileOrDir ( ( FileSystemInfo ) info ) ) ,
@@ -134,24 +134,21 @@ public override IEnumerable<FileSystemInfo> SecondaryDataSource
134
134
public override bool AcceptsEmptyData => true ;
135
135
136
136
/// <inheritdoc/>
137
- public override void RenderStatus ( FileSystemInfo item )
137
+ public override string GetStatusFromItem ( FileSystemInfo item )
138
138
{
139
139
// Check to see if we're given the file system info
140
140
if ( item is null )
141
- {
142
- InteractiveTuiStatus . Status = Translate . DoTranslation ( "No info." ) ;
143
- return ;
144
- }
141
+ return Translate . DoTranslation ( "No info." ) ;
145
142
146
143
// Now, populate the info to the status
147
144
try
148
145
{
149
146
bool infoIsDirectory = Checking . FolderExists ( item . FullName ) ;
150
- InteractiveTuiStatus . Status = $ "[{ ( infoIsDirectory ? "/" : "*" ) } ] { item . Name } ";
147
+ return $ "[{ ( infoIsDirectory ? "/" : "*" ) } ] { item . Name } ";
151
148
}
152
149
catch ( Exception ex )
153
150
{
154
- InteractiveTuiStatus . Status = ex . Message ;
151
+ return ex . Message ;
155
152
}
156
153
}
157
154
@@ -190,15 +187,14 @@ private static void Open(FileSystemInfo currentFileSystemInfo)
190
187
if ( InteractiveTuiStatus . CurrentPane == 2 )
191
188
{
192
189
( ( FileManagerCli ) Instance ) . secondPanePath = Filesystem . NeutralizePath ( currentFileSystemInfo . FullName . ToString ( ) + "/" ) ;
193
- InteractiveTuiStatus . SecondPaneCurrentSelection = 1 ;
194
190
( ( FileManagerCli ) Instance ) . refreshSecondPaneListing = true ;
195
191
}
196
192
else
197
193
{
198
194
( ( FileManagerCli ) Instance ) . firstPanePath = Filesystem . NeutralizePath ( currentFileSystemInfo . FullName . ToString ( ) + "/" ) ;
199
- InteractiveTuiStatus . FirstPaneCurrentSelection = 1 ;
200
195
( ( FileManagerCli ) Instance ) . refreshFirstPaneListing = true ;
201
196
}
197
+ InteractiveTuiTools . SelectionMovement ( Instance , 1 ) ;
202
198
}
203
199
}
204
200
catch ( Exception ex )
@@ -215,15 +211,14 @@ private static void GoUp()
215
211
if ( InteractiveTuiStatus . CurrentPane == 2 )
216
212
{
217
213
( ( FileManagerCli ) Instance ) . secondPanePath = Filesystem . NeutralizePath ( ( ( FileManagerCli ) Instance ) . secondPanePath + "/.." ) ;
218
- InteractiveTuiStatus . SecondPaneCurrentSelection = 1 ;
219
214
( ( FileManagerCli ) Instance ) . refreshSecondPaneListing = true ;
220
215
}
221
216
else
222
217
{
223
218
( ( FileManagerCli ) Instance ) . firstPanePath = Filesystem . NeutralizePath ( ( ( FileManagerCli ) Instance ) . firstPanePath + "/.." ) ;
224
- InteractiveTuiStatus . FirstPaneCurrentSelection = 1 ;
225
219
( ( FileManagerCli ) Instance ) . refreshFirstPaneListing = true ;
226
220
}
221
+ InteractiveTuiTools . SelectionMovement ( Instance , 1 ) ;
227
222
}
228
223
229
224
private static void PrintFileSystemInfo ( FileSystemInfo currentFileSystemInfo )
@@ -371,7 +366,7 @@ private static void GoTo()
371
366
path = Filesystem . NeutralizePath ( path , ( ( FileManagerCli ) Instance ) . firstPanePath ) ;
372
367
if ( Checking . FolderExists ( path ) )
373
368
{
374
- InteractiveTuiStatus . FirstPaneCurrentSelection = 1 ;
369
+ InteractiveTuiTools . SelectionMovement ( Instance , 1 ) ;
375
370
( ( FileManagerCli ) Instance ) . firstPanePath = path ;
376
371
( ( FileManagerCli ) Instance ) . refreshFirstPaneListing = true ;
377
372
}
0 commit comments