Hello,
Please find attached a suggested patch for mwf-designer, which corrects
improper exception handling when empty fields are provided in the
NewFileDialog dialog box (upon pressing Done).
Guillaume Simard
Index: src/UI/NewFileDialog.cs
===================================================================
--- src/UI/NewFileDialog.cs (revision 108217)
+++ src/UI/NewFileDialog.cs (working copy)
@@ -92,7 +92,8 @@
_namespace = namespaceTextbox.Text;
_class = classTextbox.Text;
_fileName = filenameTextbox.Text;
- if (_templateName == null || _namespace == null || _class == null || _fileName == null) {
+ if (isNotValidEntry (_templateName) || isNotValidEntry (_namespace) ||
+ isNotValidEntry (_class) || isNotValidEntry (_fileName)) {
MessageBox.Show ("Please select a template from the list, specify the class and namespace names and " +
"then choose file name and location.");
} else {
@@ -100,5 +101,12 @@
this.Close();
}
}
+
+ private bool isNotValidEntry(string s)
+ {
+ if (s == null || s == string.Empty)
+ return true;
+ return false;
+ }
}
}
\ No newline at end of file
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list