Click here to Skip to main content
15,843,727 members
Home / Discussions / C#
   

C#

 
AnswerRe: Extract ConnectionString from App.Config Pin
PIEBALDconsult12-Apr-12 9:08
mvePIEBALDconsult12-Apr-12 9:08 
AnswerRe: Extract ConnectionString from App.Config Pin
ZurdoDev12-Apr-12 9:56
professionalZurdoDev12-Apr-12 9:56 
GeneralRe: Extract ConnectionString from App.Config Pin
PIEBALDconsult12-Apr-12 13:08
mvePIEBALDconsult12-Apr-12 13:08 
AnswerRe: Extract ConnectionString from App.Config Pin
Bernhard Hiller12-Apr-12 22:06
Bernhard Hiller12-Apr-12 22:06 
QuestionMultiple Inhertance solution Pin
zeeShan anSari12-Apr-12 4:54
zeeShan anSari12-Apr-12 4:54 
AnswerRe: Multiple Inhertance solution Pin
zeeShan anSari12-Apr-12 5:06
zeeShan anSari12-Apr-12 5:06 
GeneralRe: Multiple Inhertance solution Pin
PIEBALDconsult12-Apr-12 5:50
mvePIEBALDconsult12-Apr-12 5:50 
GeneralRe: Multiple Inhertance solution Pin
BobJanova12-Apr-12 6:01
BobJanova12-Apr-12 6:01 
C#/.Net doesn't have multiple inheritance. It has multiple implementation (i.e. a class can implement multiple interfaces), so if the things you want to 'inherit' are simple enough, you can implement an interface and re-implement the methods), or alternatively you can switch from 'multiple is-a' (inheritance, which can't be done) to 'multiple has-a' (composition), which is essentially what you've done here.

You can fake multiple inheritance quite well thus:

class Multi { // : A, B
 private A a;
 private B b;

 Multi(string argForA, int argForB){
  a = new A(argForA);
  b = new B(argForB);
 }

 public static implicit operator A(Multi m) { return m.a; }
 public static implicit operator B(Multi m) { return m.b; }
}


You can use that class as if it were an A or a B in variable assignments, foreach constructs and anywhere where an implicit cast gets used. However, you can't use a reverse cast (i.e. (Multi)(A)m won't work), the reference you get from a cast isn't actually the same object you started with, and putting it in collections would therefore be dodgy.

I don't really recommend you do that, though.
GeneralRe: Multiple Inhertance solution Pin
BobJanova13-Apr-12 0:31
BobJanova13-Apr-12 0:31 
AnswerRe: Multiple Inhertance solution Pin
RobCroll12-Apr-12 15:40
RobCroll12-Apr-12 15:40 
QuestionSetting users access permissions on tabs in C# tabcontrol Pin
Xonel11-Apr-12 23:46
Xonel11-Apr-12 23:46 
AnswerRe: Setting users access permissions on tabs in C# tabcontrol Pin
Mycroft Holmes12-Apr-12 1:05
professionalMycroft Holmes12-Apr-12 1:05 
GeneralRe: Setting users access permissions on tabs in C# tabcontrol Pin
Xonel12-Apr-12 1:22
Xonel12-Apr-12 1:22 
GeneralRe: Setting users access permissions on tabs in C# tabcontrol Pin
Mycroft Holmes12-Apr-12 5:29
professionalMycroft Holmes12-Apr-12 5:29 
NewsRe: Setting users access permissions on tabs in C# tabcontrol Pin
Eddy Vluggen12-Apr-12 2:05
professionalEddy Vluggen12-Apr-12 2:05 
GeneralRe: Setting users access permissions on tabs in C# tabcontrol Pin
Mycroft Holmes12-Apr-12 5:33
professionalMycroft Holmes12-Apr-12 5:33 
AnswerRe: Setting users access permissions on tabs in C# tabcontrol Pin
Eddy Vluggen12-Apr-12 9:54
professionalEddy Vluggen12-Apr-12 9:54 
GeneralRe: Setting users access permissions on tabs in C# tabcontrol Pin
Mycroft Holmes12-Apr-12 13:36
professionalMycroft Holmes12-Apr-12 13:36 
GeneralRe: Setting users access permissions on tabs in C# tabcontrol Pin
Eddy Vluggen13-Apr-12 8:51
professionalEddy Vluggen13-Apr-12 8:51 
Questionweb config for spring frame work Pin
SFORavi11-Apr-12 17:55
SFORavi11-Apr-12 17:55 
QuestionA Question Of Structure Pin
Roger Wright11-Apr-12 10:54
professionalRoger Wright11-Apr-12 10:54 
AnswerRe: A Question Of Structure Pin
Wes Aday11-Apr-12 11:05
professionalWes Aday11-Apr-12 11:05 
GeneralRe: A Question Of Structure Pin
Alan Balkany12-Apr-12 5:34
Alan Balkany12-Apr-12 5:34 
GeneralRe: A Question Of Structure Pin
Jason McBurney12-Apr-12 15:14
Jason McBurney12-Apr-12 15:14 
GeneralRe: A Question Of Structure Pin
Roger Wright12-Apr-12 20:47
professionalRoger Wright12-Apr-12 20:47 

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.