diff options
-rw-r--r-- | Source/WrtSettings/MainForm.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/WrtSettings/MainForm.cs b/Source/WrtSettings/MainForm.cs index c2ce51c..5a3c29f 100644 --- a/Source/WrtSettings/MainForm.cs +++ b/Source/WrtSettings/MainForm.cs @@ -122,7 +122,14 @@ namespace WrtSettings { private void Form_DragDrop(object sender, DragEventArgs e) {
var fileName = GetFileName(e.Data);
if (fileName != null) {
- //TODO: Open file
+ if (!HasSavedModifications()) { return; }
+
+ try {
+ this.Document = new Nvram(fileName, NvramFormat.All);
+ this.Recent.Push(fileName);
+ } catch (FormatException ex) {
+ Medo.MessageBox.ShowError(this, "Cannot open file!\n\n" + ex.Message);
+ }
}
}
|