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

C#

 
AnswerRe: Shortcut classes in another project Pin
Shameel4-Oct-11 23:44
professionalShameel4-Oct-11 23:44 
GeneralRe: Shortcut classes in another project Pin
mehrdadc485-Oct-11 0:02
mehrdadc485-Oct-11 0:02 
GeneralRe: Shortcut classes in another project Pin
Pete O'Hanlon5-Oct-11 0:11
mvePete O'Hanlon5-Oct-11 0:11 
GeneralRe: Shortcut classes in another project Pin
Shameel5-Oct-11 0:25
professionalShameel5-Oct-11 0:25 
GeneralRe: Shortcut classes in another project Pin
Pete O'Hanlon5-Oct-11 0:28
mvePete O'Hanlon5-Oct-11 0:28 
GeneralRe: Shortcut classes in another project Pin
Super Lloyd5-Oct-11 2:51
Super Lloyd5-Oct-11 2:51 
GeneralRe: Shortcut classes in another project Pin
Pete O'Hanlon5-Oct-11 3:00
mvePete O'Hanlon5-Oct-11 3:00 
QuestionClass inheritance, forcing new classes to implement certain functions Pin
ExoticmE4-Oct-11 9:07
ExoticmE4-Oct-11 9:07 
Ok so i'm messing around with a few things, specifically interfaces.

Say I have a class 'Cat' with its base as 'Animal' Animal has a method in it like so
public virtual void Walk()
{
    // Do walking stuff
}


So Cat would override it with:
public override void Walk()
{
    // Do cat specific walking stuff
}


Simple right?

Here's my question though, is there a way to force cat to override the base Walk() method? So if another developer added a Dog class they would be forced to implement their own Walk method (even if it was just base.Walk()) ?

So interfaces kind of solves this, this is what i've tried

Cat : Animal : Interface
Animal has to implement the Walk method, but Cat doesn't

Cat : Animal, Interface
Cat has to implement the Walk method, but if the developer doesn't add or forgets the ',Interface' then it will 'break' it.

can someone give me some pointer as to go about this ?

Thanks.
AnswerRe: Class inheritance, forcing new classes to implement certain functions Pin
harold aptroot4-Oct-11 9:14
harold aptroot4-Oct-11 9:14 
GeneralRe: Class inheritance, forcing new classes to implement certain functions Pin
ExoticmE4-Oct-11 9:30
ExoticmE4-Oct-11 9:30 
GeneralRe: Class inheritance, forcing new classes to implement certain functions Pin
harold aptroot4-Oct-11 9:48
harold aptroot4-Oct-11 9:48 
AnswerMessage Removed Pin
4-Oct-11 9:27
professionalN_tro_P4-Oct-11 9:27 
GeneralRe: Class inheritance, forcing new classes to implement certain functions Pin
dan!sh 4-Oct-11 9:32
professional dan!sh 4-Oct-11 9:32 
GeneralRe: Class inheritance, forcing new classes to implement certain functions Pin
ExoticmE4-Oct-11 9:52
ExoticmE4-Oct-11 9:52 
AnswerRe: Class inheritance, forcing new classes to implement certain functions Pin
Ian Shlasko4-Oct-11 9:45
Ian Shlasko4-Oct-11 9:45 
AnswerRe: Class inheritance, forcing new classes to implement certain functions Pin
Pete O'Hanlon4-Oct-11 10:19
mvePete O'Hanlon4-Oct-11 10:19 
AnswerRe: Class inheritance, forcing new classes to implement certain functions Pin
jschell4-Oct-11 10:53
jschell4-Oct-11 10:53 
AnswerRe: Class inheritance, forcing new classes to implement certain functions Pin
Eddy Vluggen4-Oct-11 12:43
professionalEddy Vluggen4-Oct-11 12:43 
GeneralRe: Class inheritance, forcing new classes to implement certain functions Pin
ExoticmE4-Oct-11 16:38
ExoticmE4-Oct-11 16:38 
AnswerRe: Class inheritance, forcing new classes to implement certain functions Pin
BobJanova4-Oct-11 22:43
BobJanova4-Oct-11 22:43 
QuestionC# and SQL Server - Display Breakdown By Type Pin
Matt U.4-Oct-11 9:01
Matt U.4-Oct-11 9:01 
AnswerRe: C# and SQL Server - Display Breakdown By Type Pin
dan!sh 4-Oct-11 9:29
professional dan!sh 4-Oct-11 9:29 
GeneralRe: C# and SQL Server - Display Breakdown By Type Pin
Matt U.4-Oct-11 9:43
Matt U.4-Oct-11 9:43 
GeneralRe: C# and SQL Server - Display Breakdown By Type Pin
dan!sh 4-Oct-11 10:32
professional dan!sh 4-Oct-11 10:32 
AnswerRe: C# and SQL Server - Display Breakdown By Type Pin
BobJanova4-Oct-11 22:45
BobJanova4-Oct-11 22:45 

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.