Click here to Skip to main content
15,914,074 members
Home / Discussions / C#
   

C#

 
GeneralRe: .NET WebBrowser Control and JavaScript Pin
Shameel3-Aug-11 1:47
professionalShameel3-Aug-11 1:47 
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 
Thanks Pete,

I've tried putting constraints on the method but I'm still getting the error, I think I'm doing something fundamentally wrong.

perhaps an example would help
public List<T> getall<T>()where T : employee
{
    type t = typeof(T)
    switch (t.name)
    {
        case "manager":
            List<manager> all = this.GetManagers()
            break;
        default
            List<sales> all = this.getSales()

    }

    return all 
}


This is something along the lines of what I'm trying to do (I haven't tried compiling it but it's the types I have the issue with, not syntax)- Imagine both Sales and managers are of type employee but managers are paid monthly and do not get commission but sales are paid weekly and do get commission, so whilst they have much in common I want to treat them differently.

Hope this makes more sense.
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 
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 

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.