Пример #1
0
        public bool CanHandle(string path)
        {
            if (Directory.Exists(path))
            {
                return(false);
            }

            switch (Path.GetExtension(path).ToLower())
            {
            // Word
            case ".doc":
            case ".docx":
            case ".docm":
            // Excel
            case ".xls":
            case ".xlsx":
            case ".xlsm":
            case ".xlsb":
            // Visio Viewer will not quit after preview, which cause serious memory issue
            //case ".vsd":
            //case ".vsdx":
            // PowerPoint
            case ".ppt":
            case ".pptx":
            // OpenDocument
            case ".odt":
            case ".ods":
            case ".odp":
                return(PreviewHandlerHost.GetPreviewHandlerGUID(path) != Guid.Empty);
            }

            return(false);
        }
Пример #2
0
        public bool CanHandle(string path)
        {
            if (Directory.Exists(path))
            {
                return(false);
            }

            if (Extensions.Any(path.ToLower().EndsWith))
            {
                return(PreviewHandlerHost.GetPreviewHandlerGUID(path) != Guid.Empty);
            }

            return(false);
        }