Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
Questionsource code Pin
om_metab16-Feb-11 8:58
om_metab16-Feb-11 8:58 
AnswerRe: source code PinPopular
Not Active16-Feb-11 9:19
mentorNot Active16-Feb-11 9:19 
AnswerRe: source code Pin
PIEBALDconsult16-Feb-11 9:43
mvePIEBALDconsult16-Feb-11 9:43 
AnswerRe: source code Pin
Pete O'Hanlon16-Feb-11 10:17
mvePete O'Hanlon16-Feb-11 10:17 
GeneralRe: source code Pin
om_metab16-Feb-11 10:48
om_metab16-Feb-11 10:48 
GeneralRe: source code Pin
Dave Kreskowiak16-Feb-11 11:17
mveDave Kreskowiak16-Feb-11 11:17 
GeneralRe: source code Pin
Thomas Krojer16-Feb-11 21:18
Thomas Krojer16-Feb-11 21:18 
GeneralRe: source code Pin
Pete O'Hanlon16-Feb-11 22:32
mvePete O'Hanlon16-Feb-11 22:32 
GeneralRe: source code Pin
fjdiewornncalwe25-Feb-11 10:49
professionalfjdiewornncalwe25-Feb-11 10:49 
GeneralRe: source code Pin
Alan Balkany17-Feb-11 9:52
Alan Balkany17-Feb-11 9:52 
GeneralRe: source code Pin
om_metab17-Feb-11 12:32
om_metab17-Feb-11 12:32 
GeneralRe: source code PinPopular
Not Active16-Feb-11 14:47
mentorNot Active16-Feb-11 14:47 
GeneralRe: source code Pin
om_metab17-Feb-11 12:36
om_metab17-Feb-11 12:36 
GeneralRe: source code Pin
Not Active17-Feb-11 13:27
mentorNot Active17-Feb-11 13:27 
Questionabstract, override and the Visual Studio Designer Pin
Dewald15-Feb-11 21:52
Dewald15-Feb-11 21:52 
AnswerRe: abstract, override and the Visual Studio Designer Pin
Luc Pattyn16-Feb-11 0:47
sitebuilderLuc Pattyn16-Feb-11 0:47 
JokeRe: abstract, override and the Visual Studio Designer Pin
Wayne Gaylard16-Feb-11 1:17
professionalWayne Gaylard16-Feb-11 1:17 
GeneralRe: abstract, override and the Visual Studio Designer Pin
Luc Pattyn16-Feb-11 1:57
sitebuilderLuc Pattyn16-Feb-11 1:57 
GeneralRe: abstract, override and the Visual Studio Designer Pin
Dewald16-Feb-11 1:56
Dewald16-Feb-11 1:56 
AnswerRe: abstract, override and the Visual Studio Designer Pin
Luc Pattyn16-Feb-11 2:04
sitebuilderLuc Pattyn16-Feb-11 2:04 
GeneralRe: abstract, override and the Visual Studio Designer Pin
Dewald16-Feb-11 2:37
Dewald16-Feb-11 2:37 
GeneralRe: abstract, override and the Visual Studio Designer Pin
Luc Pattyn16-Feb-11 2:51
sitebuilderLuc Pattyn16-Feb-11 2:51 
Not sure what the problem is.

In the following situation:
interface IMySpecialTabPageFunctionality {
    void Process();
}

class MyTabPage : TabPage, IMySpecialTabPageFunctionality {
    public void Process() {
        ...
    }
}

class MyApplication {
    IMySpecialTabPageFunctionality object1;
    TabPage tabPage2;
    MyTabPage tabPage3;
}

object1 is whatever object that implements all members of IMySpecialTabPageFunctionality; it may or may not be a TabPage, so you can't just call tabpage-specific functions on it.
tabPage2 is a regular tabpage, however you can't call Process() on it.
tabPage3 is a specialized tabpage, offering real tabpage functionality as well as the extra interface functions.

One of those is bound to offer what you want.

BTW: tabPage2 and tabPage3 can be designed with Visual Designer, object1 can't.

Furthermore, if you need multiple specializations with a common interface, this is what I would consider:
interface IMySpecialTabPageFunctionality {
    void Process();
}

class MyTabPage : TabPage, IMySpecialTabPageFunctionality {
    public virtual void Process() {
        ...
    }
}

class MySpecialTabPage1 : MyTabPage  {
    public override void Process() {...}
}

class MySpecialTabPage2 : MyTabPage  {
    public override void Process() {...}
}


Smile | :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

GeneralRe: abstract, override and the Visual Studio Designer Pin
Dewald16-Feb-11 4:05
Dewald16-Feb-11 4:05 
AnswerRe: abstract, override and the Visual Studio Designer Pin
PIEBALDconsult16-Feb-11 1:48
mvePIEBALDconsult16-Feb-11 1:48 
GeneralRe: abstract, override and the Visual Studio Designer Pin
Dewald16-Feb-11 2:02
Dewald16-Feb-11 2:02 

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.