Click here to Skip to main content
15,888,089 members
Home / Discussions / C#
   

C#

 
GeneralTo generate a pop up from windows service.. Pin
ag466776-Mar-08 21:40
ag466776-Mar-08 21:40 
GeneralRe: To generate a pop up from windows service.. Pin
Leyu6-Mar-08 21:57
Leyu6-Mar-08 21:57 
GeneralRe: To generate a pop up from windows service.. Pin
ag466776-Mar-08 22:13
ag466776-Mar-08 22:13 
GeneralRe: To generate a pop up from windows service.. Pin
Laddie6-Mar-08 22:14
Laddie6-Mar-08 22:14 
Questionfind function of List Pin
Sonia Gupta6-Mar-08 21:37
Sonia Gupta6-Mar-08 21:37 
GeneralRe: find function of List Pin
Christian Graus6-Mar-08 22:00
protectorChristian Graus6-Mar-08 22:00 
GeneralRe: find function of List Pin
Sonia Gupta6-Mar-08 22:03
Sonia Gupta6-Mar-08 22:03 
GeneralRe: find function of List Pin
Christian Graus6-Mar-08 22:08
protectorChristian Graus6-Mar-08 22:08 
I guessed that, it's just that, like always, you're guessing how the code should look instead of doing research, and making posts that don't give half way enough information to help people to help you.

public class person
{
public string name;
public int age;

public person(string nam , int ag)
{
this.age = ag;
this.name = nam;
}
}

public class Program
{
public static void Main(string[] args)
{
List<person> obj = new List<person>();
obj.Add(new person("abc",22));
obj.Add(new person("ggbc1",12));
obj.Add(new person("ccc2",10));
obj.Add(new person("cabc3",12));
obj.Add(new person("bbbc4", 6));

Predicate<person> exists = delegate(person p1)
{
return p1.age == 12;
};


person p = obj.Find(exists);
}
}
}


Note that find will only return one object, you can use FindAll to get a list back.

Christian Graus - Microsoft MVP - C++

"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

GeneralRe: find function of List Pin
darkelv7-Mar-08 3:20
darkelv7-Mar-08 3:20 
GeneralRe: find function of List Pin
Pete O'Hanlon6-Mar-08 22:04
mvePete O'Hanlon6-Mar-08 22:04 
GeneralRe: find function of List Pin
Sonia Gupta6-Mar-08 22:06
Sonia Gupta6-Mar-08 22:06 
GeneralRe: find function of List Pin
Pete O'Hanlon6-Mar-08 22:08
mvePete O'Hanlon6-Mar-08 22:08 
GeneralRe: find function of List Pin
Pete O'Hanlon6-Mar-08 22:10
mvePete O'Hanlon6-Mar-08 22:10 
QuestionRe: find function of List Pin
Sonia Gupta6-Mar-08 22:15
Sonia Gupta6-Mar-08 22:15 
GeneralRe: find function of List Pin
Christian Graus6-Mar-08 22:17
protectorChristian Graus6-Mar-08 22:17 
GeneralRe: find function of List Pin
Sonia Gupta6-Mar-08 22:21
Sonia Gupta6-Mar-08 22:21 
GeneralRe: find function of List Pin
Christian Graus6-Mar-08 22:24
protectorChristian Graus6-Mar-08 22:24 
GeneralRe: find function of List Pin
Pete O'Hanlon6-Mar-08 23:26
mvePete O'Hanlon6-Mar-08 23:26 
GeneralRe: find function of List Pin
Christian Graus6-Mar-08 22:16
protectorChristian Graus6-Mar-08 22:16 
GeneralRe: find function of List Pin
Pete O'Hanlon6-Mar-08 23:24
mvePete O'Hanlon6-Mar-08 23:24 
GeneralRe: find function of List Pin
J4amieC7-Mar-08 0:18
J4amieC7-Mar-08 0:18 
GeneralRe: find function of List Pin
Christian Graus6-Mar-08 22:09
protectorChristian Graus6-Mar-08 22:09 
GeneralRe: find function of List Pin
Sonia Gupta6-Mar-08 22:30
Sonia Gupta6-Mar-08 22:30 
GeneralRe: find function of List Pin
Laddie6-Mar-08 22:38
Laddie6-Mar-08 22:38 
GeneralOpen MSI Database Pin
ptr2void6-Mar-08 20:25
ptr2void6-Mar-08 20:25 

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.