Click here to Skip to main content
15,922,894 members
Home / Discussions / C#
   

C#

 
GeneralRe: Unit Testing of web page loading Pin
ednrgc5-Feb-07 8:46
ednrgc5-Feb-07 8:46 
AnswerRe: Unit Testing of web page loading Pin
Judah Gabriel Himango5-Feb-07 9:46
sponsorJudah Gabriel Himango5-Feb-07 9:46 
AnswerRe: Unit Testing of web page loading Pin
VirtualVoid.NET6-Feb-07 3:33
VirtualVoid.NET6-Feb-07 3:33 
QuestionHow do I compare 2 List objects? Pin
baronics5-Feb-07 7:55
baronics5-Feb-07 7:55 
AnswerRe: How do I compare 2 List objects? Pin
Guffa5-Feb-07 8:32
Guffa5-Feb-07 8:32 
GeneralRe: How do I compare 2 List objects? Pin
baronics5-Feb-07 8:41
baronics5-Feb-07 8:41 
GeneralRe: How do I compare 2 List objects? Pin
Guffa5-Feb-07 9:48
Guffa5-Feb-07 9:48 
GeneralRe: How do I compare 2 List objects? Pin
baronics5-Feb-07 10:31
baronics5-Feb-07 10:31 
here's my final:

private void diff2()
{
List<string> aList = new List<string>();
aList.Add("a");
aList.Add("d");

List<string> bList = new List<string>();
bList.Add("z");
bList.Add("a");

CompareLists(aList, bList,
delegate(string a) { Console.WriteLine(a + " only in list a"); },
delegate(string b) { Console.WriteLine(b + " only in list b"); },
delegate(string c) { Console.WriteLine(c + " in both"); }
);
}

delegate void InList(string inputValue);

private void CompareLists(List<string> al, List<string> bl, InList onlyA, InList onlyB, InList both)
{
int a = 0;
int b = 0;
al.Sort();
bl.Sort();

while ((a < al.Count) && (b < bl.Count))
{
int cp = al[a].CompareTo(bl[b]);
if (cp < 0)
onlyA(al[a++]);
else if (cp > 0)
onlyB(bl[b++]);
else
{
++a;
both(bl[b++]);
}
}

while (a < al.Count)
onlyA(al[a++]);

while (b < bl.Count)
onlyB(bl[b++]);
}

GeneralRe: How do I compare 2 List objects? Pin
Luc Pattyn5-Feb-07 11:16
sitebuilderLuc Pattyn5-Feb-07 11:16 
QuestionHow do you bring the PC out of Standby programmatically? Pin
dschaberg5-Feb-07 7:39
dschaberg5-Feb-07 7:39 
QuestionIenumrator movenext Pin
123456uio5-Feb-07 6:46
123456uio5-Feb-07 6:46 
AnswerRe: Ienumrator movenext Pin
Ravi Bhavnani5-Feb-07 7:07
professionalRavi Bhavnani5-Feb-07 7:07 
QuestionPaint in C# Pin
Keldyn5-Feb-07 6:33
Keldyn5-Feb-07 6:33 
AnswerRe: Paint in C# Pin
led mike5-Feb-07 7:11
led mike5-Feb-07 7:11 
AnswerRe: Paint in C# Pin
Ravi Bhavnani5-Feb-07 7:12
professionalRavi Bhavnani5-Feb-07 7:12 
GeneralRe: Paint in C# Pin
Keldyn5-Feb-07 7:21
Keldyn5-Feb-07 7:21 
AnswerRe: Paint in C# Pin
Jon Sagara5-Feb-07 7:28
Jon Sagara5-Feb-07 7:28 
AnswerRe: Paint in C# Pin
DavidNohejl5-Feb-07 7:28
DavidNohejl5-Feb-07 7:28 
QuestionListView.ItemCheck event Pin
zaboboa5-Feb-07 5:59
zaboboa5-Feb-07 5:59 
AnswerRe: ListView.ItemCheck event Pin
Ravi Bhavnani5-Feb-07 7:15
professionalRavi Bhavnani5-Feb-07 7:15 
Questionworking with large xml files Pin
cellardoor07165-Feb-07 5:29
cellardoor07165-Feb-07 5:29 
AnswerWhat is your requirement? Pin
Ennis Ray Lynch, Jr.5-Feb-07 5:58
Ennis Ray Lynch, Jr.5-Feb-07 5:58 
GeneralRe: What is your requirement? Pin
eggie55-Feb-07 6:56
eggie55-Feb-07 6:56 
AnswerRe: working with large xml files Pin
eggie55-Feb-07 6:47
eggie55-Feb-07 6:47 
GeneralRe: working with large xml files Pin
cellardoor07165-Feb-07 6:51
cellardoor07165-Feb-07 6:51 

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.