Click here to Skip to main content
15,913,773 members
Home / Discussions / C#
   

C#

 
GeneralRe: Lock question Pin
Steve Messer21-Aug-05 2:43
Steve Messer21-Aug-05 2:43 
GeneralGDI+ Paths and Regions Pin
mpastchenko19-Aug-05 8:39
mpastchenko19-Aug-05 8:39 
GeneralRe: GDI+ Paths and Regions Pin
mpastchenko19-Aug-05 11:37
mpastchenko19-Aug-05 11:37 
GeneralLabel Graph Tick Mark Axis, Mistake Pin
...---...19-Aug-05 7:09
...---...19-Aug-05 7:09 
GeneralRe: Label Graph Tick Mark Axis, Mistake Pin
...---...19-Aug-05 7:13
...---...19-Aug-05 7:13 
GeneralRe: Label Graph Tick Mark Axis, Mistake Pin
Guffa19-Aug-05 7:17
Guffa19-Aug-05 7:17 
QuestionHow2 assign specific class type to generic object type? Pin
Dennis McMahon19-Aug-05 7:08
Dennis McMahon19-Aug-05 7:08 
AnswerRe: How2 assign specific class type to generic object type? Pin
AndrewJMarshall19-Aug-05 7:36
AndrewJMarshall19-Aug-05 7:36 
Dennis,

Your explanation was a little confising, but is this what you're trying to do?
object X;
switch(thang)
{
case a:
X = new X1();
break;
case b:
X = new X2();
break;
case c:
X = new X3();
break;
}
X.Property1 = 13;
X.Method42();
...
If so, put all the properties and methods in X and then have X1, X2 and X3 inherit from X. I assume you'll also have to overload X's methods in X1, X2 and X3. Just because two classes share the same signatures doesn't mean they can be interchanged. It's the interface that matters.

Good luck,
Andrew
GeneralRe: How2 assign specific class type to generic object type? Pin
Dennis McMahon19-Aug-05 8:01
Dennis McMahon19-Aug-05 8:01 
GeneralDataGrid bounded to a DataTable with composite key. Pin
miah alom19-Aug-05 6:55
miah alom19-Aug-05 6:55 
GeneralRe: DataGrid bounded to a DataTable with composite key. Pin
rudy.net19-Aug-05 13:35
rudy.net19-Aug-05 13:35 
GeneralRe: DataGrid bounded to a DataTable with composite key. Pin
miah alom21-Aug-05 6:01
miah alom21-Aug-05 6:01 
QuestionAUTO UPDATE?? Pin
cyrus_thevirus19-Aug-05 5:27
cyrus_thevirus19-Aug-05 5:27 
AnswerRe: AUTO UPDATE?? Pin
Mohamad Al Husseiny19-Aug-05 6:19
Mohamad Al Husseiny19-Aug-05 6:19 
GeneralRe: AUTO UPDATE?? Pin
cyrus_thevirus19-Aug-05 6:41
cyrus_thevirus19-Aug-05 6:41 
GeneralRe: AUTO UPDATE?? Pin
ekynox19-Aug-05 17:01
ekynox19-Aug-05 17:01 
GeneralFile Copy from remote server Pin
NitinR19-Aug-05 5:19
NitinR19-Aug-05 5:19 
GeneralRe: File Copy from remote server Pin
| Muhammad Waqas Butt |19-Aug-05 5:40
professional| Muhammad Waqas Butt |19-Aug-05 5:40 
GeneralGarbage Collection Issue Pin
MarkMokris19-Aug-05 4:43
MarkMokris19-Aug-05 4:43 
GeneralRe: Garbage Collection Issue Pin
Dan Neely19-Aug-05 4:56
Dan Neely19-Aug-05 4:56 
GeneralRe: Garbage Collection Issue Pin
MarkMokris19-Aug-05 6:00
MarkMokris19-Aug-05 6:00 
GeneralRe: Garbage Collection Issue Pin
S. Senthil Kumar19-Aug-05 5:52
S. Senthil Kumar19-Aug-05 5:52 
GeneralRe: Garbage Collection Issue Pin
MarkMokris19-Aug-05 10:19
MarkMokris19-Aug-05 10:19 
Generalstupid question :$ Pin
f_n_d19-Aug-05 4:41
f_n_d19-Aug-05 4:41 
GeneralRe: stupid question :$ Pin
mmikey719-Aug-05 5:00
mmikey719-Aug-05 5:00 

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.