From 5655787c1ac9ceedbd78c6c853a7cded33a22d49 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 11 Nov 2016 12:33:10 -0500 Subject: update portable projects --- Emby.Drawing.Net/ImageHelpers.cs | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Emby.Drawing.Net/ImageHelpers.cs (limited to 'Emby.Drawing.Net/ImageHelpers.cs') diff --git a/Emby.Drawing.Net/ImageHelpers.cs b/Emby.Drawing.Net/ImageHelpers.cs new file mode 100644 index 000000000..1afc47cd0 --- /dev/null +++ b/Emby.Drawing.Net/ImageHelpers.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Emby.Drawing.Net +{ + internal static class ImageHelpers + { + internal static List ProjectPaths(List paths, int count) + { + if (count <= 0) + { + throw new ArgumentOutOfRangeException("count"); + } + if (paths.Count == 0) + { + throw new ArgumentOutOfRangeException("paths"); + } + + var list = new List(); + + AddToList(list, paths, count); + + return list.Take(count).ToList(); + } + + private static void AddToList(List list, List paths, int count) + { + while (list.Count < count) + { + foreach (var path in paths) + { + list.Add(path); + + if (list.Count >= count) + { + return; + } + } + } + } + } +} -- cgit v1.2.3