private void ValidateParameters()
{
if (this.DebugInfoFile != String.Empty)
{
CheckFilePath(this.DebugInfoFile);
}
if (this.AttachDBFilename != String.Empty)
{
if(!File.Exists(this.AttachDBFilename))
{
throw new IOException("The requested database file to attach:\n\"" + this.AttachDBFilename + "\"\ncannot be found or is inaccessible.");
}
}
if (this.BatchTerminator == String.Empty)
{
throw new ArgumentException("The batch terminator cannot be an empty\nstring or all white-space characters.");
}
if (this.InputFiles.Count > 0 && this.Query != String.Empty)
{
throw new ArgumentException("The -i and -Q switches are mutually exclusive.\nPlease specify only one of those.");
}
if (this.InputFiles.Count == 0 && this.Query == String.Empty)
{
throw new ArgumentException("No query has been specified.\nPlease use the -Q switch to pass in a query batch\nor specify one or more files using the -i switch.");
}
if (this.InputFiles.Count > 0)
{
FileInfo _TempFile;
bool _AllFilesEmpty = true;
foreach (string _File in this.InputFiles)
{
_TempFile = new FileInfo(_File);
if (_TempFile.Length > 0)
{
_AllFilesEmpty = false;
break;
}
}
if (_AllFilesEmpty)
{
throw new ArgumentException("All of the input files specified are empty.\nPlease specify one or more non-empty files,\nor use the -Q switch to specify a query.");
}
}
if (this.OutputFile != String.Empty)
{
CheckFilePath(this.OutputFile);
}
if (this._CheckForExistingOutputFile && this.OutputFile != String.Empty)
{
CheckForExistingOutputFile(this.OutputFile);
}
return;
}