btnOK_Click
(
object sender,
System.EventArgs e
)
{
AssertValid();
if ( !DoDataExchange(true) )
{
return;
}
this.Cursor = Cursors.WaitCursor;
Exception oExpectedException = null;
try
{
OpenUcinetFile();
}
catch (IOException oIOException)
{
oExpectedException = oIOException;
}
catch (UnauthorizedAccessException oUnauthorizedAccessException)
{
oExpectedException = oUnauthorizedAccessException;
}
catch (FormatException oFormatException)
{
oExpectedException = oFormatException;
}
catch (Exception oUnexpectedException)
{
ErrorUtil.OnException(oUnexpectedException);
return;
}
finally
{
this.Cursor = Cursors.Default;
}
if (oExpectedException != null)
{
String sMessage =
"The file could not be opened. Details:\n\n"
+ oExpectedException.Message;
if (oExpectedException is FormatException)
{
sMessage +=
"\n\nThis does not appear to be a UCINET full matrix DL"
+ " file. "
+ FormatMessage
;
}
this.ShowWarning(sMessage);
return;
}
DialogResult = DialogResult.OK;
this.Close();
}