Format:
Recent snippets matching tags of compare
/// <summary> /// Add in item to a collection if it does not contain the specified element by using a IEqualityComparer<>. /// </summary> /// <typeparam name="T">Type of the items in a collection</typeparam> /// <param name="collection">The collection to add the item</param> /// <param name="item">The item to add to the collection</param> /// <param name="comparer">An equality comparer to compare values.</param> /// <returns>true if the item was added to the collection; otherwise, false.</returns> public static bool Add<T>(this ICollection<T> collection, T item, IEqualityComparer<T> comparer) {
150 Views
no comments
public static void Copy(string sourceDirName, string destDirName, bool excludeSubdirectories) { // Style #1: fluent Guard.MethodArgument("sourceDirName").IsNotNullOrEmpty(sourceDirName); Guard.MethodArgument("destDirName").IsNotNullOrEmpty(destDirName, "The destination directory is required!"); // Style #2: lambdas and expressions Guard.Argument.IsNotNullOrWhiteSpace(()=>sourceDirName); Guard.Argument.IsNotNullOrWhiteSpace(()=>destDirName, "The destination directory is required!");
309 Views
1 comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
