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

C#

 
QuestionGenerics argument detect a class type Pin
Simon_Whale25-Mar-14 6:10
Simon_Whale25-Mar-14 6:10 
AnswerRe: Generics argument detect a class type Pin
OriginalGriff25-Mar-14 6:16
mveOriginalGriff25-Mar-14 6:16 
GeneralRe: Generics argument detect a class type Pin
Simon_Whale25-Mar-14 6:22
Simon_Whale25-Mar-14 6:22 
GeneralRe: Generics argument detect a class type Pin
OriginalGriff25-Mar-14 6:31
mveOriginalGriff25-Mar-14 6:31 
AnswerRe: Generics argument detect a class type PinPopular
Pete O'Hanlon25-Mar-14 7:47
mvePete O'Hanlon25-Mar-14 7:47 
GeneralRe: Generics argument detect a class type Pin
Simon_Whale25-Mar-14 9:44
Simon_Whale25-Mar-14 9:44 
GeneralRe: Generics argument detect a class type Pin
Pete O'Hanlon25-Mar-14 20:56
mvePete O'Hanlon25-Mar-14 20:56 
AnswerRe: Generics argument detect a class type Pin
Dave Kreskowiak25-Mar-14 9:07
mveDave Kreskowiak25-Mar-14 9:07 
The problem that I see in what you're doing is that you're checking for the passed in type at run-time. The whole point behind Generics is that you treat the T as a template at compile-time, preventing you from writing invalid code before you even compile it.

Pete's solution takes care of that little problem by limiting what types can be passed in as you're writing the code.

GeneralRe: Generics argument detect a class type Pin
Simon_Whale25-Mar-14 10:12
Simon_Whale25-Mar-14 10:12 
QuestionHow can i set itextSharp PdfPTable column width Pin
devenv.exe25-Mar-14 1:11
professionaldevenv.exe25-Mar-14 1:11 
QuestionLoading SubFolders to DataGrid View - Please assist Pin
Mohan Subramani24-Mar-14 22:27
Mohan Subramani24-Mar-14 22:27 
AnswerRe: Loading SubFolders to DataGrid View - Please assist Pin
Pete O'Hanlon24-Mar-14 22:31
mvePete O'Hanlon24-Mar-14 22:31 
GeneralRe: Loading SubFolders to DataGrid View - Please assist Pin
Mohan Subramani25-Mar-14 0:34
Mohan Subramani25-Mar-14 0:34 
AnswerRe: Loading SubFolders to DataGrid View - Please assist Pin
Simon_Whale25-Mar-14 0:10
Simon_Whale25-Mar-14 0:10 
QuestionWhere Is the Current Free Download Of Visual C# ? Pin
C-P-User-324-Mar-14 3:09
C-P-User-324-Mar-14 3:09 
AnswerRe: Where Is the Current Free Download Of Visual C# ? Pin
Pete O'Hanlon24-Mar-14 3:16
mvePete O'Hanlon24-Mar-14 3:16 
GeneralRe: Where Is the Current Free Download Of Visual C# ? Pin
C-P-User-324-Mar-14 3:18
C-P-User-324-Mar-14 3:18 
GeneralRe: Where Is the Current Free Download Of Visual C# ? Pin
Pete O'Hanlon24-Mar-14 3:22
mvePete O'Hanlon24-Mar-14 3:22 
GeneralRe: Where Is the Current Free Download Of Visual C# ? Pin
C-P-User-324-Mar-14 3:29
C-P-User-324-Mar-14 3:29 
GeneralRe: Where Is the Current Free Download Of Visual C# ? Pin
Pete O'Hanlon24-Mar-14 7:37
mvePete O'Hanlon24-Mar-14 7:37 
AnswerRe: Where Is the Current Free Download Of Visual C# ? Pin
Kenneth Haugland24-Mar-14 3:16
mvaKenneth Haugland24-Mar-14 3:16 
GeneralRe: Where Is the Current Free Download Of Visual C# ? Pin
C-P-User-324-Mar-14 3:20
C-P-User-324-Mar-14 3:20 
QuestionRe: Where Is the Current Free Download Of Visual C# ? Pin
Kenneth Haugland24-Mar-14 3:25
mvaKenneth Haugland24-Mar-14 3:25 
AnswerRe: Where Is the Current Free Download Of Visual C# ? Pin
C-P-User-324-Mar-14 3:30
C-P-User-324-Mar-14 3:30 
AnswerRe: Where Is the Current Free Download Of Visual C# ? Pin
BobJanova24-Mar-14 3:56
BobJanova24-Mar-14 3: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.