aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing.Net/ImageHelpers.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-11-11 12:33:10 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-11-11 12:33:10 -0500
commit5655787c1ac9ceedbd78c6c853a7cded33a22d49 (patch)
treeefb58d6a215a227f09aa0ce95c97891718d05d6e /Emby.Drawing.Net/ImageHelpers.cs
parent13ec531b142bb95bc599dc8efcc9e204f14e3e03 (diff)
update portable projects
Diffstat (limited to 'Emby.Drawing.Net/ImageHelpers.cs')
-rw-r--r--Emby.Drawing.Net/ImageHelpers.cs43
1 files changed, 43 insertions, 0 deletions
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<string> ProjectPaths(List<string> paths, int count)
+ {
+ if (count <= 0)
+ {
+ throw new ArgumentOutOfRangeException("count");
+ }
+ if (paths.Count == 0)
+ {
+ throw new ArgumentOutOfRangeException("paths");
+ }
+
+ var list = new List<string>();
+
+ AddToList(list, paths, count);
+
+ return list.Take(count).ToList();
+ }
+
+ private static void AddToList(List<string> list, List<string> paths, int count)
+ {
+ while (list.Count < count)
+ {
+ foreach (var path in paths)
+ {
+ list.Add(path);
+
+ if (list.Count >= count)
+ {
+ return;
+ }
+ }
+ }
+ }
+ }
+}