public static string GetTaskNameByFileNameExtension(string extension) { IPreviewImageGenerator provider = null; if (!Providers.TryGetValue(extension.ToLowerInvariant(), out provider)) { throw new ApplicationException(SR.F(SR.UnknownProvider_1, extension)); } return(provider.GetTaskNameByExtension(extension)); }
public static void GeneratePreview(string extension, Stream docStream, IPreviewGenerationContext context) { IPreviewImageGenerator provider = null; if (!Providers.TryGetValue(extension.ToLowerInvariant(), out provider)) { throw new ApplicationException(SR.F(SR.UnknownProvider_1, extension)); } provider.GeneratePreview(docStream, context); }
public void Setup() { _imageGenerator = Substitute.For <IPreviewImageGenerator>(); _fileSystem = Substitute.For <IFileSystem>(); _fileService = Substitute.For <IFile>(); _appManager = Substitute.For <IAppManager>(); _viewModel = new PreviewViewModel(_imageGenerator, _fileSystem, _appManager, MockDevice.Self) { IsPageVisible = true }; _fileSystem.File.Returns(_fileService); }