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 1
1
using System ;
2
2
using System . Collections . Generic ;
3
+ using System . Linq ;
3
4
using System . ComponentModel ;
4
5
using System . Windows . Forms ;
5
6
using postgres_database_restore_tool . Helper ;
@@ -60,8 +61,16 @@ private void OnFileOpenClick(object sender, EventArgs e)
60
61
var selected = TargetLocation . ShowDialog ( ) ;
61
62
if ( selected == DialogResult . OK )
62
63
{
63
- MessageBox . Show ( TargetLocation . FileName ) ;
64
+ MessageBox . Show ( TargetLocation . FileName , "File Selected" ) ;
64
65
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
+ }
65
74
}
66
75
}
67
76
You can’t perform that action at this time.
0 commit comments