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

C#

 
QuestionValidate textbox (characters) Pin
Member 991209121-May-13 7:55
Member 991209121-May-13 7:55 
AnswerRe: Validate textbox (characters) Pin
Richard MacCutchan21-May-13 21:10
mveRichard MacCutchan21-May-13 21:10 
QuestionTrick to Access derived class method from base Pin
dinesh.17krishnan21-May-13 1:42
dinesh.17krishnan21-May-13 1:42 
AnswerRe: Trick to Access derived class method from base Pin
OriginalGriff21-May-13 1:57
mveOriginalGriff21-May-13 1:57 
AnswerRe: Trick to Access derived class method from base Pin
Keith Barrow21-May-13 3:59
professionalKeith Barrow21-May-13 3:59 
AnswerRe: Trick to Access derived class method from base Pin
Keld Ølykke21-May-13 5:36
Keld Ølykke21-May-13 5:36 
AnswerRe: Trick to Access derived class method from base Pin
Dave Kreskowiak21-May-13 6:05
mveDave Kreskowiak21-May-13 6:05 
AnswerRe: Trick to Access derived class method from base Pin
Bernhard Hiller21-May-13 20:48
Bernhard Hiller21-May-13 20:48 
Public methods? Or private/internal/protected?
Similar to Keld's suggestion you can do:
C#
public abstract class MyBase
{
    public virtual void DoSomeThing()
    {
        DoStep1();
        DoStep2();
    }
    protected abstract void DoStep1();
    protected abstract void DoStep2();
}

public class Derived : MyBase
{
    override void DoStep1()
    {
        //some code here
    }
    override void DoStep2()
    {
        //some code here
        SomeOtherMethod();
    }
    private void SomeOtherMethod()
    {
        //some code here
    }

}

When you call the DoSomeThing() method of the "base" class, the DoStep1(), DoStep2(), and SomeOtherMethod() functions of Derived are called.
Well, actually, you do not call DoSomeThing() of MyBase, but DoSomeThing() of Derived, which was inherited from MyBase.
See also: Template Method[^]
AnswerRe: Trick to Access derived class method from base Pin
dinesh.17krishnan21-May-13 22:12
dinesh.17krishnan21-May-13 22:12 
GeneralRe: Trick to Access derived class method from base Pin
Keld Ølykke22-May-13 19:35
Keld Ølykke22-May-13 19:35 
AnswerRe: Trick to Access derived class method from base Pin
Ravi Bhavnani22-May-13 4:59
professionalRavi Bhavnani22-May-13 4:59 
Questionhow to save voice from modem as a wav file whic can be accessed by speech sdk for processing Pin
samweps21-May-13 1:16
samweps21-May-13 1:16 
AnswerRe: how to save voice from modem as a wav file whic can be accessed by speech sdk for processing Pin
Richard MacCutchan21-May-13 2:55
mveRichard MacCutchan21-May-13 2:55 
QuestionAnother tcp / net question.. Pin
Member 986287220-May-13 23:49
Member 986287220-May-13 23:49 
AnswerRe: Another tcp / net question.. Pin
Eddy Vluggen21-May-13 3:02
professionalEddy Vluggen21-May-13 3:02 
QuestionGenerics in C# Pin
srikumarrampa20-May-13 23:37
srikumarrampa20-May-13 23:37 
AnswerRe: Generics in C# Pin
Abhinav S21-May-13 1:08
Abhinav S21-May-13 1:08 
GeneralRe: Generics in C# Pin
srikumarrampa21-May-13 18:04
srikumarrampa21-May-13 18:04 
AnswerRe: Generics in C# Pin
Alan N22-May-13 4:21
Alan N22-May-13 4:21 
GeneralRe: Generics in C# Pin
srikumarrampa22-May-13 19:37
srikumarrampa22-May-13 19:37 
AnswerRe: Generics in C# Pin
BillWoodruff23-May-13 2:23
professionalBillWoodruff23-May-13 2:23 
QuestionPassing Cursor Coordinates as Parameters Pin
ASPnoob20-May-13 21:52
ASPnoob20-May-13 21:52 
AnswerRe: Passing Cursor Coordinates as Parameters Pin
Pete O'Hanlon20-May-13 22:01
mvePete O'Hanlon20-May-13 22:01 
GeneralRe: Passing Cursor Coordinates as Parameters Pin
ASPnoob20-May-13 22:05
ASPnoob20-May-13 22:05 
AnswerRe: Passing Cursor Coordinates as Parameters Pin
OriginalGriff20-May-13 22:52
mveOriginalGriff20-May-13 22:52 

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.