Skip to content

Commit

Permalink
missing FW2 stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianaisemberg committed Oct 27, 2011
1 parent 8988234 commit ac2b522
Show file tree
Hide file tree
Showing 4 changed files with 1,293 additions and 1,251 deletions.
1 change: 1 addition & 0 deletions CLAP/CLAP.csproj
Expand Up @@ -93,6 +93,7 @@
<Compile Include="ParametersExpressionValidator.cs" />
<Compile Include="Parser.cs" />
<Compile Include="IValidation.cs" />
<Compile Include="ParserBase.cs" />
<Compile Include="ParserRegistration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Serialization.cs" />
Expand Down
25 changes: 25 additions & 0 deletions CLAP/FW2Stuff.cs
Expand Up @@ -106,6 +106,19 @@ public static bool Any<T>(this IEnumerable<T> collection, Func<T, bool> predicat
return false;
}

public static bool All<T>(this IEnumerable<T> collection, Func<T, bool> predicate)
{
foreach (var item in collection)
{
if (!predicate(item))
{
return false;
}
}

return true;
}

public static int Count<T>(this IEnumerable<T> collection)
{
var c = 0;
Expand Down Expand Up @@ -231,6 +244,18 @@ public static bool Contains<TSource>(this IEnumerable<TSource> source, TSource v

return false;
}

public static List<T> ToList<T>(this IEnumerable<T> collection)
{
var list = new List<T>();

foreach (var item in collection)
{
list.Add(item);
}

return list;
}
}

#endregion Enumerable
Expand Down

0 comments on commit ac2b522

Please sign in to comment.