개정판 2007ecaa
thumbnail을 별도의 프로세스에서 download 하도록 수정
Change-Id: Ica8432a3fbe5e44d92412ec91290097deddeee71
KCOM/Extensions/LinqExtension.cs | ||
---|---|---|
23 | 23 |
else |
24 | 24 |
return source; |
25 | 25 |
} |
26 |
|
|
27 |
public static bool TryItem<TSource>(this IEnumerable<TSource> source, bool condition, Func<TSource, int, bool> predicate, out TSource item) |
|
28 |
{ |
|
29 |
bool result = false; |
|
30 |
item = default(TSource); |
|
31 |
|
|
32 |
if (condition) |
|
33 |
{ |
|
34 |
var selectItem = source.Where(predicate); |
|
35 |
|
|
36 |
if (selectItem.Count() > 0) |
|
37 |
{ |
|
38 |
item = selectItem.First(); |
|
39 |
result = true; |
|
40 |
} |
|
41 |
} |
|
42 |
|
|
43 |
return result; |
|
44 |
} |
|
45 |
|
|
46 |
/// <summary> |
|
47 |
/// |
|
48 |
/// </summary> |
|
49 |
/// <typeparam name="TSource"></typeparam> |
|
50 |
/// <param name="source"></param> |
|
51 |
/// <param name="item"></param> |
|
52 |
/// <returns></returns> |
|
53 |
public static bool TryFrist<TSource>(this List<TSource> source,bool RemoveSource, out TSource item) |
|
54 |
{ |
|
55 |
bool result = false; |
|
56 |
item = default(TSource); |
|
57 |
|
|
58 |
if (source.Count() > 0) |
|
59 |
{ |
|
60 |
var selectItem = source.First(); |
|
61 |
|
|
62 |
item = selectItem; |
|
63 |
|
|
64 |
if (RemoveSource) |
|
65 |
{ |
|
66 |
source.Remove(selectItem); |
|
67 |
} |
|
68 |
|
|
69 |
result = true; |
|
70 |
} |
|
71 |
|
|
72 |
return result; |
|
73 |
} |
|
26 | 74 |
} |
27 | 75 |
} |
내보내기 Unified diff