Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        protected bool IsFilePathSet()
        {
            IFileOptionsSet fos = Options as IFileOptionsSet;

            return(fos != null && !String.IsNullOrEmpty(fos.FilePath));
        }
Exemplo n.º 3
0
 public ReaderOptionsTest()
 {
     _options = new FileOptionsSet();
 }