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

C#

 
QuestionOnTextChanged event [modified] Pin
vanikanc2-Aug-11 8:24
vanikanc2-Aug-11 8:24 
AnswerRe: OnTextChanged event Pin
Paladin20002-Aug-11 11:01
Paladin20002-Aug-11 11:01 
GeneralRe: OnTextChanged event Pin
vanikanc3-Aug-11 2:17
vanikanc3-Aug-11 2:17 
GeneralRe: OnTextChanged event Pin
Paladin20003-Aug-11 3:31
Paladin20003-Aug-11 3:31 
QuestionSetting different properties based on T in method that returns List<T> Pin
Paul E Davies2-Aug-11 3:54
Paul E Davies2-Aug-11 3:54 
AnswerRe: Setting different properties based on T in method that returns List Pin
Pete O'Hanlon2-Aug-11 4:02
mvePete O'Hanlon2-Aug-11 4:02 
GeneralRe: Setting different properties based on T in method that returns List Pin
Paul E Davies2-Aug-11 4:23
Paul E Davies2-Aug-11 4:23 
GeneralRe: Setting different properties based on T in method that returns List Pin
Pete O'Hanlon2-Aug-11 4:45
mvePete O'Hanlon2-Aug-11 4:45 
You're starting to get there, but you need to cast to the appropriate list type as in:
C#
public List<T> GetAll<T>() where T : Employee
 {
     List<T> all = new List<T>();
     if (typeof(T) == typeof(Manager))
         all = GetManagers() as List<T>;
     else
         all = GetSales() as List<T>;
     return all;
 }

Forgive your enemies - it messes with their heads


My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


GeneralRe: Setting different properties based on T in method that returns List Pin
Paul E Davies2-Aug-11 4:54
Paul E Davies2-Aug-11 4:54 
GeneralRe: Setting different properties based on T in method that returns List Pin
Pete O'Hanlon2-Aug-11 4:57
mvePete O'Hanlon2-Aug-11 4:57 
GeneralRe: Setting different properties based on T in method that returns List Pin
dasblinkenlight2-Aug-11 5:02
dasblinkenlight2-Aug-11 5:02 
GeneralRe: Setting different properties based on T in method that returns List Pin
BobJanova2-Aug-11 5:14
BobJanova2-Aug-11 5:14 
GeneralRe: Setting different properties based on T in method that returns List Pin
Paul E Davies2-Aug-11 5:16
Paul E Davies2-Aug-11 5:16 
GeneralRe: Setting different properties based on T in method that returns List Pin
dasblinkenlight2-Aug-11 5:58
dasblinkenlight2-Aug-11 5:58 
GeneralRe: Setting different properties based on T in method that returns List Pin
BobJanova2-Aug-11 6:20
BobJanova2-Aug-11 6:20 
GeneralRe: Setting different properties based on T in method that returns List Pin
PIEBALDconsult2-Aug-11 5:14
mvePIEBALDconsult2-Aug-11 5:14 
QuestionHow to fix Remoting error? Pin
meeram3952-Aug-11 1:25
meeram3952-Aug-11 1:25 
Questionarchitecture Pin
AndyInUK2-Aug-11 0:18
AndyInUK2-Aug-11 0:18 
AnswerRe: architecture Pin
Łukasz Nowakowski2-Aug-11 1:04
Łukasz Nowakowski2-Aug-11 1:04 
GeneralRe: architecture Pin
AndyInUK2-Aug-11 1:55
AndyInUK2-Aug-11 1:55 
AnswerRe: architecture Pin
Not Active2-Aug-11 2:07
mentorNot Active2-Aug-11 2:07 
AnswerRe: architecture [modified] Pin
PIEBALDconsult2-Aug-11 2:50
mvePIEBALDconsult2-Aug-11 2:50 
AnswerRe: architecture Pin
V.2-Aug-11 3:48
professionalV.2-Aug-11 3:48 
AnswerRe: architecture Pin
Dan Mos2-Aug-11 4:01
Dan Mos2-Aug-11 4:01 
Questionmissing resources Pin
lukeer2-Aug-11 0:17
lukeer2-Aug-11 0:17 

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.