File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
3+ using System . Linq ;
34using System . ComponentModel ;
45using System . Windows . Forms ;
56using postgres_database_restore_tool . Helper ;
@@ -60,8 +61,16 @@ private void OnFileOpenClick(object sender, EventArgs e)
6061 var selected = TargetLocation . ShowDialog ( ) ;
6162 if ( selected == DialogResult . OK )
6263 {
63- MessageBox . Show ( TargetLocation . FileName ) ;
64+ MessageBox . Show ( TargetLocation . FileName , "File Selected" ) ;
6465 SelectedFilelbl . Text = TargetLocation . FileName ;
66+ if ( string . IsNullOrWhiteSpace ( DatabaseElem . Text ) )
67+ {
68+ var fileName = TargetLocation . FileName . Split ( new char [ ] { '/' , '\\ ' } ) . LastOrDefault ( ) ;
69+ if ( fileName . Contains ( "_" ) )
70+ {
71+ DatabaseElem . Text = fileName . Split ( '_' ) . FirstOrDefault ( ) ;
72+ }
73+ }
6574 }
6675 }
6776
You can’t perform that action at this time.
0 commit comments