Click here to Skip to main content
15,884,298 members
Home / Discussions / C#
   

C#

 
GeneralRe: Generics Problems Pin
Kevin Marois7-Sep-12 7:27
professionalKevin Marois7-Sep-12 7:27 
AnswerRe: Generics Problems Pin
Clifford Nelson7-Sep-12 7:42
Clifford Nelson7-Sep-12 7:42 
GeneralRe: Generics Problems Pin
Kevin Marois7-Sep-12 8:02
professionalKevin Marois7-Sep-12 8:02 
GeneralRe: Generics Problems Pin
Ennis Ray Lynch, Jr.7-Sep-12 8:51
Ennis Ray Lynch, Jr.7-Sep-12 8:51 
GeneralRe: Generics Problems Pin
Kevin Marois7-Sep-12 8:55
professionalKevin Marois7-Sep-12 8:55 
GeneralRe: Generics Problems Pin
Ennis Ray Lynch, Jr.7-Sep-12 9:05
Ennis Ray Lynch, Jr.7-Sep-12 9:05 
GeneralRe: Generics Problems Pin
Kevin Marois7-Sep-12 9:09
professionalKevin Marois7-Sep-12 9:09 
GeneralRe: Generics Problems Pin
Ennis Ray Lynch, Jr.7-Sep-12 9:21
Ennis Ray Lynch, Jr.7-Sep-12 9:21 
I wouldn't use it but you can use the wrapper pattern below. It isn't elegant, but is a way to handle what you want without changing the underlying objects using interfaces, which really is probably the best solution.


public class Wrapper{
    private Object mObject;
    public string Name{
        get{
            string result = null;
            if(mObject is SomeTypeIRecognize){
                result = ((SomeTypeIRecognize)mObject).Name;
            }
            return result;
            
        }
    }

    public Wrapper(object o){mObject = o;}

}


Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS.

"And they, since they Were not the one dead, turned to their affairs" -- Robert Frost

GeneralRe: Generics Problems Pin
Kevin Marois7-Sep-12 10:43
professionalKevin Marois7-Sep-12 10:43 
AnswerRe: Generics Problems Pin
Clifford Nelson7-Sep-12 9:31
Clifford Nelson7-Sep-12 9:31 
AnswerRe: Generics Problems Pin
Clifford Nelson7-Sep-12 9:09
Clifford Nelson7-Sep-12 9:09 
AnswerRe: Generics Problems Pin
PIEBALDconsult7-Sep-12 9:12
mvePIEBALDconsult7-Sep-12 9:12 
AnswerRe: Generics Problems Pin
Eddy Vluggen7-Sep-12 9:46
professionalEddy Vluggen7-Sep-12 9:46 
GeneralRe: Generics Problems Pin
Kevin Marois7-Sep-12 10:44
professionalKevin Marois7-Sep-12 10:44 
GeneralRe: Generics Problems Pin
Eddy Vluggen7-Sep-12 10:54
professionalEddy Vluggen7-Sep-12 10:54 
GeneralRe: Generics Problems Pin
Kevin Marois7-Sep-12 10:56
professionalKevin Marois7-Sep-12 10:56 
GeneralRe: Generics Problems Pin
Eddy Vluggen7-Sep-12 11:09
professionalEddy Vluggen7-Sep-12 11:09 
AnswerRe: Generics Problems PinPopular
jschell7-Sep-12 10:39
jschell7-Sep-12 10:39 
GeneralRe: Generics Problems Pin
Kevin Marois7-Sep-12 10:41
professionalKevin Marois7-Sep-12 10:41 
GeneralRe: Generics Problems Pin
jschell8-Sep-12 7:23
jschell8-Sep-12 7:23 
AnswerRe: Generics Problems Pin
dbaseman7-Sep-12 21:20
dbaseman7-Sep-12 21:20 
AnswerRe: Generics Problems Pin
Gerry Schmitz8-Sep-12 20:28
mveGerry Schmitz8-Sep-12 20:28 
Questionhow to change the parent of anUIElement Pin
benzarabel7-Sep-12 5:04
benzarabel7-Sep-12 5:04 
AnswerRe: how to change the parent of anUIElement Pin
Wes Aday7-Sep-12 5:55
professionalWes Aday7-Sep-12 5:55 
AnswerRe: how to change the parent of anUIElement Pin
Clifford Nelson7-Sep-12 7:25
Clifford Nelson7-Sep-12 7:25 

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.