Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
AnswerRe: my previous button is working as a next button Pin
Luc Pattyn26-Jun-07 4:24
sitebuilderLuc Pattyn26-Jun-07 4:24 
QuestionExists() method of System.Collections.Generic.List Pin
lossy26-Jun-07 3:28
lossy26-Jun-07 3:28 
AnswerRe: Exists() method of System.Collections.Generic.List Pin
Giorgi Dalakishvili26-Jun-07 3:38
mentorGiorgi Dalakishvili26-Jun-07 3:38 
GeneralRe: Exists() method of System.Collections.Generic.List Pin
lossy26-Jun-07 3:48
lossy26-Jun-07 3:48 
AnswerRe: Exists() method of System.Collections.Generic.List Pin
Colin Angus Mackay26-Jun-07 3:41
Colin Angus Mackay26-Jun-07 3:41 
GeneralRe: Exists() method of System.Collections.Generic.List Pin
lossy26-Jun-07 3:52
lossy26-Jun-07 3:52 
GeneralRe: Exists() method of System.Collections.Generic.List Pin
Colin Angus Mackay26-Jun-07 4:02
Colin Angus Mackay26-Jun-07 4:02 
AnswerRe: Exists() method of System.Collections.Generic.List Pin
Nissim Salomon26-Jun-07 4:50
Nissim Salomon26-Jun-07 4:50 
Hi
The following code declare the predicate match method in the employee class.
in order to check if employee instance exists within the list, just construct new employee class with the relevant parameters (i used id as key) and call the Exists method



class Program
{
class Employee
{
private long m_id;

public Employee(long id)
{
m_id = id;
}

public bool IsMatch(Employee employee)
{
return (m_id == employee.m_id);
}
};


static void Main(string[] args)
{
List<employee> employees = new List<employee>();

employees.Add(new Employee(1));
employees.Add(new Employee(2));
employees.Add(new Employee(3));
employees.Add(new Employee(4));
employees.Add(new Employee(5));

Console.WriteLine(employees.Exists(new Employee(3).IsMatch) != null);



}
}
GeneralRe: Exists() method of System.Collections.Generic.List Pin
lossy26-Jun-07 6:53
lossy26-Jun-07 6:53 
QuestionCreating object stops execution of entire function Pin
__DanC__26-Jun-07 3:01
__DanC__26-Jun-07 3:01 
AnswerRe: Creating object stops execution of entire function Pin
I.explore.code26-Jun-07 3:47
I.explore.code26-Jun-07 3:47 
GeneralRe: Creating object stops execution of entire function Pin
__DanC__26-Jun-07 3:53
__DanC__26-Jun-07 3:53 
GeneralRe: Creating object stops execution of entire function Pin
Luc Pattyn26-Jun-07 4:34
sitebuilderLuc Pattyn26-Jun-07 4:34 
GeneralRe: Creating object stops execution of entire function Pin
__DanC__26-Jun-07 4:46
__DanC__26-Jun-07 4:46 
GeneralRe: Creating object stops execution of entire function Pin
Nissim Salomon26-Jun-07 4:59
Nissim Salomon26-Jun-07 4:59 
GeneralRe: Creating object stops execution of entire function Pin
__DanC__26-Jun-07 5:01
__DanC__26-Jun-07 5:01 
GeneralRe: Creating object stops execution of entire function Pin
Nissim Salomon26-Jun-07 5:15
Nissim Salomon26-Jun-07 5:15 
GeneralRe: Creating object stops execution of entire function Pin
__DanC__26-Jun-07 5:16
__DanC__26-Jun-07 5:16 
GeneralRe: Creating object stops execution of entire function Pin
Nissim Salomon26-Jun-07 5:21
Nissim Salomon26-Jun-07 5:21 
GeneralRe: Creating object stops execution of entire function Pin
__DanC__26-Jun-07 5:25
__DanC__26-Jun-07 5:25 
GeneralRe: Creating object stops execution of entire function Pin
Nissim Salomon26-Jun-07 5:46
Nissim Salomon26-Jun-07 5:46 
GeneralRe: Creating object stops execution of entire function Pin
Hesham Yassin26-Jun-07 7:46
Hesham Yassin26-Jun-07 7:46 
GeneralRe: Creating object stops execution of entire function Pin
Luc Pattyn26-Jun-07 5:33
sitebuilderLuc Pattyn26-Jun-07 5:33 
GeneralRe: Creating object stops execution of entire function Pin
__DanC__26-Jun-07 5:37
__DanC__26-Jun-07 5:37 
GeneralRe: Creating object stops execution of entire function Pin
Luc Pattyn26-Jun-07 5:49
sitebuilderLuc Pattyn26-Jun-07 5:49 

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.