Click here to Skip to main content
16,017,608 members
Home / Discussions / C#
   

C#

 
GeneralRe: windows double click event Pin
shaz jazz28-Nov-07 8:19
shaz jazz28-Nov-07 8:19 
Questionhow to implement multilevel inheritance in c#? Pin
pekhaleyogesh28-Nov-07 0:16
pekhaleyogesh28-Nov-07 0:16 
AnswerRe: how to implement multilevel inheritance in c#? Pin
Christian Graus28-Nov-07 0:17
protectorChristian Graus28-Nov-07 0:17 
GeneralRe: how to implement multilevel inheritance in c#? Pin
pekhaleyogesh28-Nov-07 0:24
pekhaleyogesh28-Nov-07 0:24 
GeneralRe: how to implement multilevel inheritance in c#? Pin
N a v a n e e t h28-Nov-07 0:36
N a v a n e e t h28-Nov-07 0:36 
GeneralRe: how to implement multilevel inheritance in c#? Pin
Nouman Bhatti28-Nov-07 0:49
Nouman Bhatti28-Nov-07 0:49 
GeneralRe: how to implement multilevel inheritance in c#? Pin
pekhaleyogesh28-Nov-07 0:55
pekhaleyogesh28-Nov-07 0:55 
AnswerRe: how to implement multilevel inheritance in c#? Pin
Pete O'Hanlon28-Nov-07 0:59
mvePete O'Hanlon28-Nov-07 0:59 
If you're not talking about multiple inheritance, then it's a simple matter:
public abstract class ReallyAbstractBase
{
  int _value;
  public ReallyAbstractBase(int value)
  {
    _value = value;
  }
  public int Value
  {
    get { return _value ; }
  }

  public abstract void DoSomething() ;
}

public abstract class MyAbstract : ReallyAbstractBase
{
  protected string _text;
  public MyAbstract(int value) : this(value, string.Empty) {}
  public MyAbstract(int value, string text) : base(value)
  {
    _text = text;
  }
  public virtual void DoSomething()
  {
    throw new Exception("Not implemented");
  }
}

public class ConcreteClass : MyAbstract
{
  public ConcreteClass() : this(0, string.Empty) {}
  public ConcreteClass(int value) : this(value, string.Empty) {}
  public ConcreteClass(string text) : this(0, text) {}
  public ConcreteClass(int value, string text) : base(value, text) {}

  public virtual void DoSomething()
  {
    Console.WriteLine("Do something called");
  }
}
This is the way that lots of classes work in the .NET framework, with each lower level class becoming a more specialised version of the level above.

Deja View - the feeling that you've seen this post before.

My blog | My articles


GeneralRe: how to implement multilevel inheritance in c#? Pin
N a v a n e e t h28-Nov-07 1:21
N a v a n e e t h28-Nov-07 1:21 
GeneralRe: how to implement multilevel inheritance in c#? Pin
Pete O'Hanlon28-Nov-07 1:34
mvePete O'Hanlon28-Nov-07 1:34 
GeneralRe: how to implement multilevel inheritance in c#? Pin
Steve Hansen28-Nov-07 4:24
Steve Hansen28-Nov-07 4:24 
Questionset Transparency of pictureBox.Image. Pin
hdv21228-Nov-07 0:13
hdv21228-Nov-07 0:13 
AnswerRe: set Transparency of pictureBox.Image. Pin
Christian Graus28-Nov-07 0:16
protectorChristian Graus28-Nov-07 0:16 
GeneralRe: set Transparency of pictureBox.Image. Pin
Anthony Mushrow28-Nov-07 2:09
professionalAnthony Mushrow28-Nov-07 2:09 
AnswerRe: set Transparency of pictureBox.Image. Pin
Anthony Mushrow28-Nov-07 2:11
professionalAnthony Mushrow28-Nov-07 2:11 
GeneralRe: set Transparency of pictureBox.Image. Pin
MikeWeber25-Jan-08 11:14
MikeWeber25-Jan-08 11:14 
QuestionThread expection Pin
Scalee28-Nov-07 0:11
Scalee28-Nov-07 0:11 
AnswerRe: Thread expection Pin
Bekjong28-Nov-07 1:17
Bekjong28-Nov-07 1:17 
Questionsave list to excel file Pin
ramyanaidu28-Nov-07 0:03
ramyanaidu28-Nov-07 0:03 
AnswerRe: save list to excel file Pin
Christian Graus28-Nov-07 0:18
protectorChristian Graus28-Nov-07 0:18 
QuestionSetting the class name Pin
I_Need_Help27-Nov-07 23:57
I_Need_Help27-Nov-07 23:57 
QuestionContextMenu on a ToolStripMenuItem Pin
Johan Martensson27-Nov-07 23:46
Johan Martensson27-Nov-07 23:46 
AnswerRe: ContextMenu on a ToolStripMenuItem Pin
Nouman Bhatti28-Nov-07 0:53
Nouman Bhatti28-Nov-07 0:53 
GeneralRe: ContextMenu on a ToolStripMenuItem Pin
Johan Martensson28-Nov-07 19:34
Johan Martensson28-Nov-07 19:34 
QuestionHow to generate excel sheet in aspx page Pin
mrcsn27-Nov-07 23:27
mrcsn27-Nov-07 23:27 

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.