示例#1
0
        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));
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }