Click here to Skip to main content
15,922,584 members
Home / Discussions / C#
   

C#

 
AnswerRe: The "Create GUID" tool is disable in my Visual Studio 2005 IDE. Pin
Nissim Salomon8-Dec-08 9:00
Nissim Salomon8-Dec-08 9:00 
GeneralRe: The "Create GUID" tool is disable in my Visual Studio 2005 IDE. Pin
hdv2128-Dec-08 9:08
hdv2128-Dec-08 9:08 
Questionmethod inheretance Pin
Deresen8-Dec-08 6:29
Deresen8-Dec-08 6:29 
AnswerRe: method inheretance Pin
Alan Balkany8-Dec-08 8:11
Alan Balkany8-Dec-08 8:11 
GeneralRe: method inheretance Pin
Deresen8-Dec-08 8:25
Deresen8-Dec-08 8:25 
GeneralRe: method inheretance Pin
Alan Balkany8-Dec-08 8:32
Alan Balkany8-Dec-08 8:32 
GeneralRe: method inheretance Pin
Deresen8-Dec-08 9:14
Deresen8-Dec-08 9:14 
GeneralRe: method inheretance Pin
Alan Balkany8-Dec-08 9:40
Alan Balkany8-Dec-08 9:40 
If you put all the interface functions in a base class, they will automatically be available to all the derived classes.

If this doesn't work for you, you can define a class that implements all the interface functions, and define an instance of this in any class that that implements the interface. Then for each interface function, forward the call to this instance. This avoids having to re-implement the whole functions in each class that implements the interface.

For example:

interface InterfaceX
{
// Lots of interface function definitions...
}


class ImplementationOfInterfaceX : InterfaceX
{
// Implementation of each function...
}


class X : InterfaceX
{
ImplementationOfInterfaceX implX;

public int func1 (int par)
{
return implX.func1 (par); // I.e., a forwarded call instead of a 100-line function.
}

public float func2 (float par)
{
return implX.func2 (par);
}

...
}


Of course this would be much easier if C# allowed multiple inheritance. I'm hoping they will in a future version. It makes some things very easy. It seems to me they left it out because it allows complexity and confusion for some extreme contrived cases that no one in their right mind would do. Not a good justification for leaving it out (in my biased opinion).
GeneralRe: method inheretance Pin
Ben Fair8-Dec-08 10:34
Ben Fair8-Dec-08 10:34 
GeneralRe: method inheretance Pin
Deresen8-Dec-08 10:51
Deresen8-Dec-08 10:51 
QuestionHow to verify existing and Installed components via code Pin
Eitan O8-Dec-08 6:09
Eitan O8-Dec-08 6:09 
QuestionUsing double quotes in a string Pin
compninja258-Dec-08 5:51
compninja258-Dec-08 5:51 
AnswerRe: Using double quotes in a string Pin
J4amieC8-Dec-08 5:57
J4amieC8-Dec-08 5:57 
GeneralRe: Using double quotes in a string Pin
Vikram A Punathambekar8-Dec-08 19:17
Vikram A Punathambekar8-Dec-08 19:17 
AnswerRe: Using double quotes in a string Pin
Deresen8-Dec-08 6:36
Deresen8-Dec-08 6:36 
GeneralRe: Using double quotes in a string Pin
Giorgi Dalakishvili8-Dec-08 7:10
mentorGiorgi Dalakishvili8-Dec-08 7:10 
AnswerRe: Using double quotes in a string Pin
cor28798-Dec-08 7:22
cor28798-Dec-08 7:22 
GeneralRe: Using double quotes in a string Pin
compninja258-Dec-08 8:59
compninja258-Dec-08 8:59 
QuestionIs there any solution to run PowerShell 1.0 in C# remotely? Pin
Julia10058-Dec-08 5:38
Julia10058-Dec-08 5:38 
QuestionDataset.ReadXML Pin
ndroo8828-Dec-08 4:14
ndroo8828-Dec-08 4:14 
AnswerRe: Dataset.ReadXML Pin
ndroo8829-Dec-08 2:21
ndroo8829-Dec-08 2:21 
Questioneach button click starting a new thread Pin
lane0p28-Dec-08 4:11
lane0p28-Dec-08 4:11 
GeneralRe: each button click starting a new thread Pin
Pr@teek B@h!8-Dec-08 5:49
Pr@teek B@h!8-Dec-08 5:49 
GeneralRe: each button click starting a new thread Pin
lane0p28-Dec-08 7:35
lane0p28-Dec-08 7:35 
GeneralRe: each button click starting a new thread Pin
User 66588-Dec-08 7:56
User 66588-Dec-08 7:56 

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.