Click here to Skip to main content
15,880,796 members
Home / Discussions / C#
   

C#

 
GeneralRe: Here ya go Pin
Luc Pattyn2-Jul-07 12:55
sitebuilderLuc Pattyn2-Jul-07 12:55 
GeneralRe: Here ya go Pin
ruanr2-Jul-07 20:58
ruanr2-Jul-07 20:58 
AnswerRe: need code for this app in C# Pin
Dave Kreskowiak2-Jul-07 12:53
mveDave Kreskowiak2-Jul-07 12:53 
QuestionHow to call a base class virtual method instead Pin
mschuckmann2-Jul-07 10:45
mschuckmann2-Jul-07 10:45 
AnswerRe: How to call a base class virtual method instead Pin
PIEBALDconsult2-Jul-07 10:54
mvePIEBALDconsult2-Jul-07 10:54 
GeneralRe: How to call a base class virtual method instead Pin
Pete O'Hanlon2-Jul-07 10:58
mvePete O'Hanlon2-Jul-07 10:58 
GeneralRe: How to call a base class virtual method instead Pin
PIEBALDconsult2-Jul-07 11:37
mvePIEBALDconsult2-Jul-07 11:37 
GeneralRe: How to call a base class virtual method instead [modified] Pin
Luc Pattyn2-Jul-07 11:46
sitebuilderLuc Pattyn2-Jul-07 11:46 
Of course ! that's how you can do it, at the expense of some new method names.

Here is my experiment:

class class1 {
    public virtual void print() { basePrint(); }
    public void basePrint() { log("class1"); }
}

class class2 : class1 {
    public override void print() { log("class2"); }
}
class class3 : class2 {
    public override void print() { log("class3"); }
}

public void Test() {
    class3 a=new class3();
    a.print();
    a.basePrint();
    class1 b=new class3();
    b.print();
    b.basePrint();
}


it does print:
class3
class1
class3
class1


at the expense of 1 additional method (basePrint in the base class)
[EDIT: there is absolutely no need for a second method in class2, what was I thinking?]

I still would prefer something that strips the specialization (but without copying data),
so one could write b.base.print(), which would mean print() needs no sibbling.

Smile | :)




-- modified at 17:55 Monday 2nd July, 2007


GeneralRe: How to call a base class virtual method instead Pin
mschuckmann2-Jul-07 11:58
mschuckmann2-Jul-07 11:58 
GeneralRe: How to call a base class virtual method instead Pin
Luc Pattyn2-Jul-07 12:10
sitebuilderLuc Pattyn2-Jul-07 12:10 
GeneralRe: How to call a base class virtual method instead Pin
mschuckmann2-Jul-07 12:14
mschuckmann2-Jul-07 12:14 
GeneralRe: How to call a base class virtual method instead Pin
Weirdoz1210-Nov-09 17:59
Weirdoz1210-Nov-09 17:59 
AnswerRe: How to call a base class virtual method instead Pin
Luc Pattyn2-Jul-07 11:19
sitebuilderLuc Pattyn2-Jul-07 11:19 
GeneralRe: How to call a base class virtual method instead Pin
mschuckmann2-Jul-07 11:44
mschuckmann2-Jul-07 11:44 
GeneralRe: How to call a base class virtual method instead Pin
Luc Pattyn2-Jul-07 11:50
sitebuilderLuc Pattyn2-Jul-07 11:50 
GeneralRe: How to call a base class virtual method instead Pin
PIEBALDconsult2-Jul-07 11:58
mvePIEBALDconsult2-Jul-07 11:58 
GeneralRe: How to call a base class virtual method instead Pin
Luc Pattyn2-Jul-07 12:06
sitebuilderLuc Pattyn2-Jul-07 12:06 
GeneralRe: How to call a base class virtual method instead Pin
PIEBALDconsult2-Jul-07 13:35
mvePIEBALDconsult2-Jul-07 13:35 
GeneralRe: How to call a base class virtual method instead Pin
Luc Pattyn2-Jul-07 13:49
sitebuilderLuc Pattyn2-Jul-07 13:49 
QuestionHow many maximum Threads can be created in CLR Thread pool Pin
Tejashvini2-Jul-07 10:39
Tejashvini2-Jul-07 10:39 
AnswerRe: How many maximum Threads can be created in CLR Thread pool Pin
Pete O'Hanlon2-Jul-07 10:45
mvePete O'Hanlon2-Jul-07 10:45 
AnswerRe: How many maximum Threads can be created in CLR Thread pool Pin
Luc Pattyn2-Jul-07 10:48
sitebuilderLuc Pattyn2-Jul-07 10:48 
QuestionReturn multiple asynch calls synchronously? Pin
matsnas2-Jul-07 10:32
matsnas2-Jul-07 10:32 
AnswerRe: Return multiple asynch calls synchronously? Pin
Not Active2-Jul-07 11:05
mentorNot Active2-Jul-07 11:05 
QuestionSerialization: how to acess from one assembly to another Pin
Saikek2-Jul-07 9:10
Saikek2-Jul-07 9:10 

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.