Click here to Skip to main content
15,899,026 members
Home / Discussions / C#
   

C#

 
AnswerRe: List Comparison Pin
DaveyM6910-Jun-10 5:10
professionalDaveyM6910-Jun-10 5:10 
GeneralRe: List Comparison Pin
Paladin200010-Jun-10 5:28
Paladin200010-Jun-10 5:28 
GeneralRe: List Comparison Pin
Hristo-Bojilov10-Jun-10 5:52
Hristo-Bojilov10-Jun-10 5:52 
AnswerRe: List Comparison Pin
Luc Pattyn10-Jun-10 5:30
sitebuilderLuc Pattyn10-Jun-10 5:30 
GeneralRe: List Comparison Pin
Paladin200010-Jun-10 5:39
Paladin200010-Jun-10 5:39 
GeneralRe: List Comparison Pin
#realJSOP10-Jun-10 6:36
professional#realJSOP10-Jun-10 6:36 
AnswerRe: List Comparison Pin
Paladin200010-Jun-10 5:58
Paladin200010-Jun-10 5:58 
GeneralRe: List Comparison Pin
Paladin200010-Jun-10 6:06
Paladin200010-Jun-10 6:06 
Revision revised... Wink | ;) I realized that I could simply return the comparison, as it is bool.

/// <summary>
/// Compares two lists to ensure that they match without duplication.
/// </summary>
/// <typeparam name="T">Generic Type; string, DateTime, int etc.</typeparam>
/// <param name="List1">First list to compare.</param>
/// <param name="List2">Second list to compare.</param>
/// <returns>
/// True if the collections match and do not contain duplicates (regardless of sequence).
/// False if either list is null, or they do not match.
/// </returns>
private static bool matchList<T>(List<T> List1, List<T> List2)
{
    if (List1 == null || List2 == null)  return false;
    return ((List1.Count == List2.Count) && (List1.Count == List1.Intersect(List2).Count()));
}

GeneralRe: List Comparison Pin
Luc Pattyn10-Jun-10 6:06
sitebuilderLuc Pattyn10-Jun-10 6:06 
AnswerRe: List Comparison Pin
Kevin McFarlane10-Jun-10 10:45
Kevin McFarlane10-Jun-10 10:45 
QuestionGoogle Maps Pin
JohnUSA10-Jun-10 2:53
JohnUSA10-Jun-10 2:53 
AnswerMessage Closed Pin
10-Jun-10 3:06
stancrm10-Jun-10 3:06 
GeneralRe: Google Maps Pin
JohnUSA10-Jun-10 4:45
JohnUSA10-Jun-10 4:45 
AnswerRe: Google Maps Pin
Paladin200010-Jun-10 4:41
Paladin200010-Jun-10 4:41 
GeneralRe: Google Maps Pin
JohnUSA10-Jun-10 4:53
JohnUSA10-Jun-10 4:53 
GeneralRe: Google Maps Pin
Paladin200010-Jun-10 5:20
Paladin200010-Jun-10 5:20 
AnswerRe: Google Maps Pin
Adam R Harris10-Jun-10 4:52
Adam R Harris10-Jun-10 4:52 
QuestionTricky Inheritance Question Pin
Jon Myers10-Jun-10 2:47
Jon Myers10-Jun-10 2:47 
AnswerRe: Tricky Inheritance Question Pin
Andrew Rissing10-Jun-10 4:21
Andrew Rissing10-Jun-10 4:21 
GeneralRe: Tricky Inheritance Question Pin
Jon Myers10-Jun-10 5:40
Jon Myers10-Jun-10 5:40 
GeneralRe: Tricky Inheritance Question Pin
Andrew Rissing10-Jun-10 7:34
Andrew Rissing10-Jun-10 7:34 
QuestionAuto serial software Pin
ostad_mrn10-Jun-10 2:39
ostad_mrn10-Jun-10 2:39 
AnswerRe: Auto serial software Pin
#realJSOP10-Jun-10 2:49
professional#realJSOP10-Jun-10 2:49 
QuestionRe: Auto serial software Pin
ostad_mrn10-Jun-10 3:13
ostad_mrn10-Jun-10 3:13 
AnswerRe: Auto serial software Pin
#realJSOP10-Jun-10 4:26
professional#realJSOP10-Jun-10 4:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.