Click here to Skip to main content
15,886,622 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to return a collection from a method. Pin
Not Active9-Jun-10 6:57
mentorNot Active9-Jun-10 6:57 
GeneralRe: How to return a collection from a method. [modified] Pin
#realJSOP9-Jun-10 7:43
mve#realJSOP9-Jun-10 7:43 
GeneralRe: How to return a collection from a method. Pin
Not Active9-Jun-10 7:47
mentorNot Active9-Jun-10 7:47 
GeneralRe: How to return a collection from a method. Pin
Luc Pattyn9-Jun-10 8:28
sitebuilderLuc Pattyn9-Jun-10 8:28 
GeneralRe: How to return a collection from a method. Pin
DaveyM699-Jun-10 8:59
professionalDaveyM699-Jun-10 8:59 
GeneralRe: How to return a collection from a method. Pin
Luc Pattyn9-Jun-10 9:05
sitebuilderLuc Pattyn9-Jun-10 9:05 
AnswerRe: How to return a collection from a method. Pin
carbon_golem9-Jun-10 7:30
carbon_golem9-Jun-10 7:30 
AnswerRe: How to return a collection from a method. Pin
#realJSOP9-Jun-10 7:47
mve#realJSOP9-Jun-10 7:47 
You can do it that way (and IMHO, if the compiler lets you do it, nobody else has the right to complain, coding style guidelines in force not withstanding), but to ease typing, I create a class derived from the desired collection type:

C#
public class ListOfThings : List<Thing>{}


That way, I can pass/return a ListOfThings object instead of having to type all that crap over and over again.

C#
public ListOfThings GetListOfThings() { get; set; }


I can also add custom methods to the class that perform Thing-specific functionality.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

JokeRe: How to return a collection from a method. Pin
Andrew Rissing9-Jun-10 7:55
Andrew Rissing9-Jun-10 7:55 
GeneralRe: How to return a collection from a method. Pin
#realJSOP9-Jun-10 8:26
mve#realJSOP9-Jun-10 8:26 
AnswerRe: How to return a collection from a method. Pin
dan!sh 9-Jun-10 7:54
professional dan!sh 9-Jun-10 7:54 
AnswerRe: How to return a collection from a method. Pin
srng.net9-Jun-10 20:04
srng.net9-Jun-10 20:04 
QuestionRemoting with XMLSerializable objects Pin
andyknapp9-Jun-10 4:34
andyknapp9-Jun-10 4:34 
AnswerRe: Remoting with XMLSerializable objects Pin
mud779-Jun-10 9:43
mud779-Jun-10 9:43 
QuestionError casting delegate in non-generic class PinPopular
Kalvin @ Work9-Jun-10 4:19
Kalvin @ Work9-Jun-10 4:19 
AnswerRe: Error casting delegate in non-generic class [modified] PinPopular
Dimitri Witkowski9-Jun-10 8:05
Dimitri Witkowski9-Jun-10 8:05 
QuestionLogin dialog on Page loads Pin
Ramkithepower9-Jun-10 3:59
Ramkithepower9-Jun-10 3:59 
QuestionC# datagridview cell focus Pin
jojoba20119-Jun-10 3:09
jojoba20119-Jun-10 3:09 
AnswerRe: C# datagridview cell focus Pin
Henry Minute9-Jun-10 7:17
Henry Minute9-Jun-10 7:17 
QuestionRe: C# datagridview cell focus Pin
jojoba20119-Jun-10 7:48
jojoba20119-Jun-10 7:48 
AnswerRe: C# datagridview cell focus Pin
Henry Minute9-Jun-10 12:57
Henry Minute9-Jun-10 12:57 
AnswerRe: C# datagridview cell focus Pin
Henry Minute10-Jun-10 3:24
Henry Minute10-Jun-10 3:24 
AnswerRe: C# datagridview cell focus Pin
dan!sh 9-Jun-10 7:55
professional dan!sh 9-Jun-10 7:55 
QuestionRe: C# datagridview cell focus Pin
jojoba20119-Jun-10 8:27
jojoba20119-Jun-10 8:27 
GeneralRe: C# datagridview cell focus Pin
Henry Minute9-Jun-10 10:06
Henry Minute9-Jun-10 10:06 

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.