public ContentData Create(string path)
 {
     if (!_filePathConverter.Convertable(path))
     {
         throw new ArgumentException();
     }
     if (_imageFilePathConverter.Convertable(path))
     {
         Uri uri = Convert(path, _imageFilePathConverter);
         ImageContentData result = _contentDataFactory.Create(ContentType.Image) as ImageContentData;
         result.Path = uri.LocalPath;
         return(result);
     }
     else if (_pdfPathConverter.Convertable(path))
     {
         Uri            uri    = Convert(path, _pdfPathConverter);
         PdfContentData result = _contentDataFactory.Create(ContentType.PDF) as PdfContentData;
         result.Path = uri.LocalPath;
         return(result);
     }
     else
     {
         Uri uri = Convert(path, _unknownFilePathConverter);
         UnknownFileContentData result = _contentDataFactory.Create(ContentType.File) as UnknownFileContentData;
         result.Path = uri.LocalPath;
         return(result);
     }
 }
Esempio n. 2
0
        public void Create(ContentType type)
        {
            ContentData content = _contentDataFactory.Create(type);

            Create(content);
        }