Click here to Skip to main content
15,886,137 members
Home / Discussions / C#
   

C#

 
AnswerRe: Extract ConnectionString from App.Config Pin
PIEBALDconsult12-Apr-12 8:08
mvePIEBALDconsult12-Apr-12 8:08 
AnswerRe: Extract ConnectionString from App.Config Pin
ZurdoDev12-Apr-12 8:56
professionalZurdoDev12-Apr-12 8:56 
GeneralRe: Extract ConnectionString from App.Config Pin
PIEBALDconsult12-Apr-12 12:08
mvePIEBALDconsult12-Apr-12 12:08 
AnswerRe: Extract ConnectionString from App.Config Pin
Bernhard Hiller12-Apr-12 21:06
Bernhard Hiller12-Apr-12 21:06 
QuestionMultiple Inhertance solution Pin
zeeShan anSari12-Apr-12 3:54
zeeShan anSari12-Apr-12 3:54 
AnswerRe: Multiple Inhertance solution Pin
zeeShan anSari12-Apr-12 4:06
zeeShan anSari12-Apr-12 4:06 
GeneralRe: Multiple Inhertance solution Pin
PIEBALDconsult12-Apr-12 4:50
mvePIEBALDconsult12-Apr-12 4:50 
GeneralRe: Multiple Inhertance solution Pin
BobJanova12-Apr-12 5:01
BobJanova12-Apr-12 5: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
BobJanova12-Apr-12 23:31
BobJanova12-Apr-12 23:31 
AnswerRe: Multiple Inhertance solution Pin
RobCroll12-Apr-12 14:40
RobCroll12-Apr-12 14:40 
QuestionSetting users access permissions on tabs in C# tabcontrol Pin
Xonel11-Apr-12 22:46
Xonel11-Apr-12 22:46 
AnswerRe: Setting users access permissions on tabs in C# tabcontrol Pin
Mycroft Holmes12-Apr-12 0:05
professionalMycroft Holmes12-Apr-12 0:05 
GeneralRe: Setting users access permissions on tabs in C# tabcontrol Pin
Xonel12-Apr-12 0:22
Xonel12-Apr-12 0:22 
GeneralRe: Setting users access permissions on tabs in C# tabcontrol Pin
Mycroft Holmes12-Apr-12 4:29
professionalMycroft Holmes12-Apr-12 4:29 
NewsRe: Setting users access permissions on tabs in C# tabcontrol Pin
Eddy Vluggen12-Apr-12 1:05
professionalEddy Vluggen12-Apr-12 1:05 
GeneralRe: Setting users access permissions on tabs in C# tabcontrol Pin
Mycroft Holmes12-Apr-12 4:33
professionalMycroft Holmes12-Apr-12 4:33 
AnswerRe: Setting users access permissions on tabs in C# tabcontrol Pin
Eddy Vluggen12-Apr-12 8:54
professionalEddy Vluggen12-Apr-12 8:54 
GeneralRe: Setting users access permissions on tabs in C# tabcontrol Pin
Mycroft Holmes12-Apr-12 12:36
professionalMycroft Holmes12-Apr-12 12:36 
GeneralRe: Setting users access permissions on tabs in C# tabcontrol Pin
Eddy Vluggen13-Apr-12 7:51
professionalEddy Vluggen13-Apr-12 7:51 
Questionweb config for spring frame work Pin
SFORavi11-Apr-12 16:55
SFORavi11-Apr-12 16:55 
QuestionA Question Of Structure Pin
Roger Wright11-Apr-12 9:54
professionalRoger Wright11-Apr-12 9:54 
AnswerRe: A Question Of Structure Pin
Wes Aday11-Apr-12 10:05
professionalWes Aday11-Apr-12 10:05 
GeneralRe: A Question Of Structure Pin
Alan Balkany12-Apr-12 4:34
Alan Balkany12-Apr-12 4:34 
GeneralRe: A Question Of Structure Pin
Jason McBurney12-Apr-12 14:14
Jason McBurney12-Apr-12 14:14 
GeneralRe: A Question Of Structure Pin
Roger Wright12-Apr-12 19:47
professionalRoger Wright12-Apr-12 19: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.