Click here to Skip to main content
15,908,111 members
Home / Discussions / C#
   

C#

 
GeneralRe: Class Libraries Pin
Ravi Bhavnani8-Dec-07 9:23
professionalRavi Bhavnani8-Dec-07 9:23 
GeneralRe: Class Libraries Pin
Poolee8-Dec-07 9:28
Poolee8-Dec-07 9:28 
Questionselectively passing different classes to a function - C# Pin
karthikde19808-Dec-07 7:19
karthikde19808-Dec-07 7:19 
GeneralRe: selectively passing different classes to a function - C# Pin
karthikde19808-Dec-07 8:49
karthikde19808-Dec-07 8:49 
GeneralRe: selectively passing different classes to a function - C# Pin
Christian Graus8-Dec-07 9:07
protectorChristian Graus8-Dec-07 9:07 
GeneralRe: selectively passing different classes to a function - C# Pin
Christian Graus8-Dec-07 9:05
protectorChristian Graus8-Dec-07 9:05 
QuestionRe: selectively passing different classes to a function - C# Pin
karthikde19808-Dec-07 10:05
karthikde19808-Dec-07 10:05 
GeneralRe: selectively passing different classes to a function - C# Pin
Christian Graus8-Dec-07 10:36
protectorChristian Graus8-Dec-07 10:36 
karthikde1980 wrote:
How can I write a code in the baseclass that accepts any one of state1, state2 or state3 as arguments?


You can do one of two things

1 - provide three methods that take the three derived objects
2 - use the one method that takes the base, and use the 'as' keyword in the manner I showed you to work out which it is. But again, if you need to do this, then your design is probably broken. So any of the three derived classes could be used as parameters in any of the three derived classes that impliment xyz ? I think you need to work on making your base class work so that it's interface works for all three derived objects, so you don't need to work out which it is.

Christian Graus - Microsoft MVP - C++

"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

GeneralTCP/IP Sockets Pin
half-life8-Dec-07 6:42
half-life8-Dec-07 6:42 
GeneralRe: TCP/IP Sockets Pin
Kristian Sixhøj8-Dec-07 6:45
Kristian Sixhøj8-Dec-07 6:45 
GeneralRe: TCP/IP Sockets Pin
half-life8-Dec-07 6:55
half-life8-Dec-07 6:55 
GeneralRe: TCP/IP Sockets [modified] Pin
Kristian Sixhøj8-Dec-07 7:07
Kristian Sixhøj8-Dec-07 7:07 
GeneralRe: TCP/IP Sockets Pin
half-life8-Dec-07 8:46
half-life8-Dec-07 8:46 
GeneralGetting Data from DataReader Pin
tr_thorn8-Dec-07 2:55
tr_thorn8-Dec-07 2:55 
GeneralRe: Getting Data from DataReader Pin
Ennis Ray Lynch, Jr.8-Dec-07 3:12
Ennis Ray Lynch, Jr.8-Dec-07 3:12 
GeneralRe: Getting Data from DataReader Pin
half-life8-Dec-07 6:38
half-life8-Dec-07 6:38 
GeneralGet Data From Data Reader! Pin
tr_thorn8-Dec-07 2:55
tr_thorn8-Dec-07 2:55 
Generalsolution for primary key Pin
sajid.salim.khan8-Dec-07 2:45
sajid.salim.khan8-Dec-07 2:45 
GeneralRe: solution for primary key Pin
Ennis Ray Lynch, Jr.8-Dec-07 2:51
Ennis Ray Lynch, Jr.8-Dec-07 2:51 
GeneralRe: solution for primary key Pin
Mark Churchill9-Dec-07 3:38
Mark Churchill9-Dec-07 3:38 
GeneralSorting an Array Pin
electriac8-Dec-07 1:37
electriac8-Dec-07 1:37 
GeneralRe: Sorting an Array Pin
Anthony Mushrow8-Dec-07 2:07
professionalAnthony Mushrow8-Dec-07 2:07 
GeneralRe: Sorting an Array Pin
electriac8-Dec-07 2:17
electriac8-Dec-07 2:17 
GeneralRe: Sorting an Array [modified] Pin
Anthony Mushrow8-Dec-07 2:25
professionalAnthony Mushrow8-Dec-07 2:25 
GeneralRe: Sorting an Array Pin
electriac8-Dec-07 2:35
electriac8-Dec-07 2:35 

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.