private void GenerateException (int errorCode)
{
switch (errorCode) {
case Win32ResultCode.FileNotFound:
case Win32ResultCode.InvalidParameter:
throw new ArgumentException ();
case Win32ResultCode.AccessDenied:
throw new SecurityException ();
case Win32ResultCode.NetworkPathNotFound:
throw new IOException ("The network path was not found.");
default:
// unidentified system exception
throw new SystemException ();
}
}