Click here to Skip to main content
15,890,825 members
Home / Discussions / C#
   

C#

 
AnswerRe: Windows Forms Custom Control Reference Pin
Mike Hankey11-Jan-07 21:15
mveMike Hankey11-Jan-07 21:15 
QuestionInserting a Record in Access database using tableAdapter. Pin
dsovino10-Jan-07 12:16
dsovino10-Jan-07 12:16 
QuestionAny one knows how to access Oracle DB on Unix using C# service application ? Pin
btsrinath10-Jan-07 11:51
btsrinath10-Jan-07 11:51 
AnswerRe: Any one knows how to access Oracle DB on Unix using C# service application ? Pin
ednrgc11-Jan-07 2:39
ednrgc11-Jan-07 2:39 
GeneralRe: Any one knows how to access Oracle DB on Unix using C# service application ? Pin
btsrinath11-Jan-07 5:11
btsrinath11-Jan-07 5:11 
Questionsearching an index with FindIndex() method Pin
Yustme10-Jan-07 10:48
Yustme10-Jan-07 10:48 
AnswerRe: searching an index with FindIndex() method Pin
Stefan Troschuetz10-Jan-07 11:18
Stefan Troschuetz10-Jan-07 11:18 
AnswerRe: searching an index with FindIndex() method Pin
hpjchobbes10-Jan-07 12:50
hpjchobbes10-Jan-07 12:50 
The MSDN information is what I would read to get the information, as well as some sample code, though I do have some trouble understaing it sometimes. From my understanding (still learning) the FindIndex takes a predicate. The predicate is basically a function that accepts a value of whatever type your list contains, does a calculation, and returns true or false.

So let's say I have a List of INTs. If I wanted to search for the first occurance of a number greater than 5, I would create a function like this:

<br />
public bool IsGreaterThan5(int i)<br />
{<br />
if(i > 5)<br />
   return true;<br />
else<br />
   return false;<br />
}<br />


Then, when I want to find the first instance in my INT list that is greater than 5, I do this.

<br />
int FirstOccurance = myIntList.FindIndex(IsGreaterThan5);<br />


There are also other variations of the FindIndex function that you can use:
List.FindIndex(int32, predicate) - Limits the search range from the int32 element to the end of the list
List.FindIndex(int32, int32, predicate) - Limits the search range from int32 to int32.

Hope that helps!
GeneralRe: searching an index with FindIndex() method [modified] Pin
Yustme10-Jan-07 20:49
Yustme10-Jan-07 20:49 
QuestionCapture video Pin
Yevgeny Efter10-Jan-07 9:55
Yevgeny Efter10-Jan-07 9:55 
AnswerRe: Capture video Pin
Christian Graus10-Jan-07 11:32
protectorChristian Graus10-Jan-07 11:32 
AnswerRe: Capture video Pin
Andrei Ungureanu10-Jan-07 21:02
Andrei Ungureanu10-Jan-07 21:02 
GeneralRe: Capture video Pin
Yevgeny Efter11-Jan-07 2:06
Yevgeny Efter11-Jan-07 2:06 
QuestionRead Unstructured PDF FILES In C# Pin
adnanrafiq10-Jan-07 9:34
adnanrafiq10-Jan-07 9:34 
AnswerRe: Read Unstructured PDF FILES In C# Pin
Christian Graus10-Jan-07 11:32
protectorChristian Graus10-Jan-07 11:32 
QuestionMicrosoft JScript runtime error: 'TV_FilePlan_Data' is undefined Pin
Melissa4118310-Jan-07 9:25
Melissa4118310-Jan-07 9:25 
QuestionForms Pin
BlitzPackage10-Jan-07 7:41
BlitzPackage10-Jan-07 7:41 
AnswerRe: Forms Pin
Christian Graus10-Jan-07 7:44
protectorChristian Graus10-Jan-07 7:44 
GeneralRe: Forms Pin
BlitzPackage10-Jan-07 8:11
BlitzPackage10-Jan-07 8:11 
GeneralRe: Forms Pin
ndoran10-Jan-07 8:31
ndoran10-Jan-07 8:31 
GeneralRe: Forms Pin
BlitzPackage10-Jan-07 9:15
BlitzPackage10-Jan-07 9:15 
GeneralRe: Forms Pin
Judah Gabriel Himango10-Jan-07 9:20
sponsorJudah Gabriel Himango10-Jan-07 9:20 
QuestionGet Running Process In Mobile Pin
Tyler4510-Jan-07 7:08
Tyler4510-Jan-07 7:08 
AnswerRe: Get Running Process In Mobile Pin
Tyler4511-Jan-07 3:45
Tyler4511-Jan-07 3:45 
QuestionWhat makes this program print three times?? Pin
...---...10-Jan-07 6:56
...---...10-Jan-07 6:56 

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.