Click here to Skip to main content
15,891,769 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to call base class implementation method ? Pin
Ian Shlasko2-Sep-10 2:51
Ian Shlasko2-Sep-10 2:51 
GeneralRe: How to call base class implementation method ? Pin
Yanshof2-Sep-10 2:54
Yanshof2-Sep-10 2:54 
GeneralRe: How to call base class implementation method ? Pin
johannesnestler2-Sep-10 3:05
johannesnestler2-Sep-10 3:05 
GeneralRe: How to call base class implementation method ? Pin
Pete O'Hanlon2-Sep-10 3:35
mvePete O'Hanlon2-Sep-10 3:35 
AnswerRe: How to call base class implementation method ? Pin
Ennis Ray Lynch, Jr.2-Sep-10 2:54
Ennis Ray Lynch, Jr.2-Sep-10 2:54 
AnswerRe: How to call base class implementation method ? Pin
johannesnestler2-Sep-10 3:03
johannesnestler2-Sep-10 3:03 
AnswerRe: How to call base class implementation method ? Pin
PIEBALDconsult2-Sep-10 3:22
mvePIEBALDconsult2-Sep-10 3:22 
AnswerRe: How to call base class implementation method ? Pin
Paul Michalik2-Sep-10 21:44
Paul Michalik2-Sep-10 21:44 
class A {
 public virtual void M(bool pDoBaseCall) {}
}

class B : A {
 public override void M(bool pDoBaseCall) {
  if (pDoBaseCall) {
   base.M(pDoBaseCall);
  } else {
   // B stuff
  }
 }
}

class C : A {
 public override void M(bool pDoBaseCall) {
  if (pDoBaseCall) {
   base.M(pDoBaseCall);
  } else {
   // C stuff
  }
 }
}

//...call like

C c = new C();
c.M(true);
// or
c.M(false);
// depending on what you want


You can achieve a finer level of control with an enum instead of a bool, or even dynamic code which determines depth of inheritance on run time... But this design hurts many good practices and principles, I recommend going back to drawing board and try again...
QuestionClose iframe in Div Pin
SatyaKeerthi151-Sep-10 23:41
SatyaKeerthi151-Sep-10 23:41 
AnswerRe: Close iframe in Div Pin
DaveyM692-Sep-10 0:01
professionalDaveyM692-Sep-10 0:01 
Questionhow to scale or zoomx and zoomy? Pin
zhiyuan161-Sep-10 23:27
zhiyuan161-Sep-10 23:27 
AnswerRe: how to scale or zoomx and zoomy? Pin
Blue_Boy1-Sep-10 23:33
Blue_Boy1-Sep-10 23:33 
AnswerRe: how to scale or zoomx and zoomy? Pin
phil.o2-Sep-10 0:33
professionalphil.o2-Sep-10 0:33 
QuestionAbout constructors and initial values for member fields Pin
Dewald1-Sep-10 23:21
Dewald1-Sep-10 23:21 
AnswerRe: About constructors and initial values for member fields Pin
phil.o2-Sep-10 0:21
professionalphil.o2-Sep-10 0:21 
AnswerRe: About constructors and initial values for member fields Pin
Eddy Vluggen2-Sep-10 0:32
professionalEddy Vluggen2-Sep-10 0:32 
AnswerRe: About constructors and initial values for member fields Pin
DaveyM692-Sep-10 0:51
professionalDaveyM692-Sep-10 0:51 
AnswerRe: About constructors and initial values for member fields Pin
PIEBALDconsult2-Sep-10 3:29
mvePIEBALDconsult2-Sep-10 3:29 
AnswerRe: About constructors and initial values for member fields Pin
harold aptroot2-Sep-10 4:10
harold aptroot2-Sep-10 4:10 
Questionhow to pass a handler to another form Pin
zhiyuan161-Sep-10 21:57
zhiyuan161-Sep-10 21:57 
AnswerRe: how to pass a handler to another form Pin
phil.o1-Sep-10 22:06
professionalphil.o1-Sep-10 22:06 
AnswerRe: how to pass a handler to another form Pin
Blue_Boy1-Sep-10 22:08
Blue_Boy1-Sep-10 22:08 
AnswerRe: how to pass a handler to another form Pin
Richard MacCutchan1-Sep-10 22:14
mveRichard MacCutchan1-Sep-10 22:14 
GeneralRe: how to pass a handler to another form Pin
zhiyuan161-Sep-10 22:40
zhiyuan161-Sep-10 22:40 
GeneralRe: how to pass a handler to another form Pin
Blue_Boy1-Sep-10 22:59
Blue_Boy1-Sep-10 22:59 

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.