From eaa7c6ec4038678df103dff6f4afb20735b03541 Mon Sep 17 00:00:00 2001 From: James South Date: Tue, 1 Jul 2014 17:55:06 +0100 Subject: [PATCH] Adding missed files Former-commit-id: b0d6ff1d22691f4944b6408816c14ecbe8d16856 --- .../Extensions/DirectoryInfoExtensions.cs | 56 +++++++++++++++++++ .../images/output/120430.gif.REMOVED.git-id | 1 + .../images/output/4.sm.webp | 3 + .../images/output/Tl4Yb.gif.REMOVED.git-id | 1 + .../images/output/nLpfllv.gif.REMOVED.git-id | 1 + .../images/output/test.webp | 3 + 6 files changed, 65 insertions(+) create mode 100644 src/ImageProcessor.Web/NET45/Extensions/DirectoryInfoExtensions.cs create mode 100644 src/ImageProcessorConsole/images/output/120430.gif.REMOVED.git-id create mode 100644 src/ImageProcessorConsole/images/output/4.sm.webp create mode 100644 src/ImageProcessorConsole/images/output/Tl4Yb.gif.REMOVED.git-id create mode 100644 src/ImageProcessorConsole/images/output/nLpfllv.gif.REMOVED.git-id create mode 100644 src/ImageProcessorConsole/images/output/test.webp diff --git a/src/ImageProcessor.Web/NET45/Extensions/DirectoryInfoExtensions.cs b/src/ImageProcessor.Web/NET45/Extensions/DirectoryInfoExtensions.cs new file mode 100644 index 000000000..2ec477257 --- /dev/null +++ b/src/ImageProcessor.Web/NET45/Extensions/DirectoryInfoExtensions.cs @@ -0,0 +1,56 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright (c) James South. +// Licensed under the Apache License, Version 2.0. +// +// +// Provides extension methods to the type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace ImageProcessor.Web.Extensions +{ + using System.Collections.Generic; + using System.IO; + using System.Linq; + + /// + /// Provides extension methods to the type. + /// + public static class DirectoryInfoExtensions + { + /// + /// Returns an enumerable collection of directory information that matches a specified search pattern and search subdirectory option. + /// Will return an empty enumerable on exception. Quick and dirty but does what I need just now. + /// + /// + /// The that this method extends. + /// + /// + /// The search string to match against the names of directories. This parameter can contain a combination of valid literal path + /// and wildcard (* and ?) characters (see Remarks), but doesn't support regular expressions. The default pattern is "*", which returns all files. + /// + /// + /// One of the enumeration values that specifies whether the search operation should include only + /// the current directory or all subdirectories. The default value is TopDirectoryOnly. + /// + /// + /// An enumerable collection of directories that matches searchPattern and searchOption. + /// + public static IEnumerable SafeEnumerateDirectories(this DirectoryInfo directoryInfo, string searchPattern = "*", SearchOption searchOption = SearchOption.TopDirectoryOnly) + { + IEnumerable directories; + + try + { + directories = directoryInfo.EnumerateDirectories(searchPattern, searchOption); + } + catch + { + return Enumerable.Empty(); + } + + return directories; + } + } +} diff --git a/src/ImageProcessorConsole/images/output/120430.gif.REMOVED.git-id b/src/ImageProcessorConsole/images/output/120430.gif.REMOVED.git-id new file mode 100644 index 000000000..71ce555c1 --- /dev/null +++ b/src/ImageProcessorConsole/images/output/120430.gif.REMOVED.git-id @@ -0,0 +1 @@ +30ec5c05548fd350f9b7c699715848b9fbfb8ca9 \ No newline at end of file diff --git a/src/ImageProcessorConsole/images/output/4.sm.webp b/src/ImageProcessorConsole/images/output/4.sm.webp new file mode 100644 index 000000000..1cce96a6c --- /dev/null +++ b/src/ImageProcessorConsole/images/output/4.sm.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc9ccd29734ed06d2916389cc363955924f4bbb200fea91c113ae2b9334eca1f +size 12162 diff --git a/src/ImageProcessorConsole/images/output/Tl4Yb.gif.REMOVED.git-id b/src/ImageProcessorConsole/images/output/Tl4Yb.gif.REMOVED.git-id new file mode 100644 index 000000000..6515d65a0 --- /dev/null +++ b/src/ImageProcessorConsole/images/output/Tl4Yb.gif.REMOVED.git-id @@ -0,0 +1 @@ +fdc62fc2d056ab885eb9e8fd12b9155ee86d7c43 \ No newline at end of file diff --git a/src/ImageProcessorConsole/images/output/nLpfllv.gif.REMOVED.git-id b/src/ImageProcessorConsole/images/output/nLpfllv.gif.REMOVED.git-id new file mode 100644 index 000000000..c07be0b0f --- /dev/null +++ b/src/ImageProcessorConsole/images/output/nLpfllv.gif.REMOVED.git-id @@ -0,0 +1 @@ +77cce70db3722920d60f4b17a45a5e390a09838a \ No newline at end of file diff --git a/src/ImageProcessorConsole/images/output/test.webp b/src/ImageProcessorConsole/images/output/test.webp new file mode 100644 index 000000000..4534523db --- /dev/null +++ b/src/ImageProcessorConsole/images/output/test.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b41b4fe144f9d3eaee706b516021efc7abc598f17655d9592866963bfa62f3ad +size 5590