protected string GetValidFilePath() { IFileOptionsSet fos = Options as IFileOptionsSet; if (fos == null) { throw new InvalidOperationException("Options != IFileOptionsSet"); } string filePath = fos.FilePath; if (String.IsNullOrEmpty(filePath)) { throw new InvalidOperationException("Не задано имя файла"); } if (!File.Exists(filePath)) { throw new FileNotFoundException(filePath); } return(filePath); }
protected bool IsFilePathSet() { IFileOptionsSet fos = Options as IFileOptionsSet; return(fos != null && !String.IsNullOrEmpty(fos.FilePath)); }
public ReaderOptionsTest() { _options = new FileOptionsSet(); }