Click here to Skip to main content
       

C#

 
QuestionAssistence required with this spacific Program [modified] PinmemberCihangir Giray Han4-Oct-12 22:01 
AnswerRe: Assistence required with this spacific Program PinmvpRichard MacCutchan4-Oct-12 23:04 
AnswerRe: Assistence required with this spacific Program PinmemberV.5-Oct-12 0:41 
QuestionHow to configure post-build events for setup/deployment projects in Visual Studio PinmemberTridip Bhattacharjee4-Oct-12 21:25 
AnswerRe: How to configure post-build events for setup/deployment projects in Visual Studio PinmvpRichard MacCutchan4-Oct-12 21:50 
GeneralRe: How to configure post-build events for setup/deployment projects in Visual Studio PinmemberTridip Bhattacharjee6-Oct-12 7:07 
GeneralRe: How to configure post-build events for setup/deployment projects in Visual Studio PinmvpRichard MacCutchan6-Oct-12 7:18 
QuestionBasic Polymorphism Problem PinmemberAmbiguousName4-Oct-12 18:54 
AnswerRe: Basic Polymorphism Problem PinmentorDaveyM694-Oct-12 20:29 
AnswerRe: Basic Polymorphism Problem PinmemberAmbiguousName4-Oct-12 20:56 
GeneralRe: Basic Polymorphism Problem PinmentorDaveyM694-Oct-12 21:35 
AnswerRe: Basic Polymorphism Problem PinmemberAmbiguousName4-Oct-12 21:45 
GeneralRe: Basic Polymorphism Problem PinmentorDaveyM694-Oct-12 22:18 
AnswerRe: Basic Polymorphism Problem PinmemberBobJanova5-Oct-12 0:52 
What are you expecting?
 
using System;
 
public class BaseLayer1
{
  public virtual void Function()
  { Console.WriteLine("BL1"); }
}
 
public class ChildLayer1 : BaseLayer1
{
  
  BaseLayer2 base2 = new BaseLayer2();
 
  public override void Function()
  {
    Console.WriteLine("CL1"); 
    base2.Function(); // Reaches Here. should go to base class in layer2 as well.
  }
}
 
public class BaseLayer2
{
  public virtual void Function()
  {Console.WriteLine("BL2");}
}
 
public class Child1Layer2 : BaseLayer2		         // Child of BaseLayer2
{
  public override void Function()
  {Console.WriteLine("C1L2");}
}
 
public class Child2Layer2 : Child1Layer2		// Child of Child1Layer2
{
  public override void Function()
  {Console.WriteLine("C2L2");}
}
 
class Starter {
 public static void Main(){
  new ChildLayer1().Function();
 }
}
 
Run this: you get
CL1
BL2
What do you think it should be? That is what you are calling: ChildLayer1 which calls BaseLayer2.
GeneralRe: Basic Polymorphism Problem PinmentorDaveyM695-Oct-12 1:19 
GeneralRe: Basic Polymorphism Problem PinmemberBobJanova5-Oct-12 3:04 
QuestionC# linq group by Pinmemberrachel_m4-Oct-12 17:43 
AnswerRe: C# linq group by PinmvpOriginalGriff4-Oct-12 23:19 
GeneralRe: C# linq group by Pinmemberrachel_m5-Oct-12 2:48 
GeneralRe: C# linq group by PinmvpOriginalGriff5-Oct-12 3:29 
QuestionCrystal Reports : Database Login Prompt Issue PinmemberQuam Chang4-Oct-12 16:36 
AnswerRe: Crystal Reports : Database Login Prompt Issue PinmemberAmbiguousName4-Oct-12 20:00 
QuestionAggregate data into 5 min interval PinmemberMember 94707244-Oct-12 11:59 
QuestionC# linq Pinmemberrachel_m4-Oct-12 9:36 
AnswerRe: C# linq PinmemberCollin Jasnoch4-Oct-12 10:00 
Question.exe Reference Problem - maybe Pinmemberdirsow4-Oct-12 7:52 
AnswerRe: .exe Reference Problem - maybe PinmemberEddy Vluggen4-Oct-12 9:01 
GeneralRe: .exe Reference Problem - maybe Pinmemberdirsow4-Oct-12 9:27 
GeneralRe: .exe Reference Problem - maybe PinmemberEddy Vluggen4-Oct-12 9:34 
GeneralRe: .exe Reference Problem - maybe Pinmemberdirsow4-Oct-12 9:41 
AnswerRe: .exe Reference Problem - maybe PinmemberBernhard Hiller4-Oct-12 21:00 
Questionhow to setting Four tier application in my application? Pinmembersomasundarapandian4-Oct-12 4:28 
AnswerRe: how to setting Four tier application in my application? PinmvpDave Kreskowiak4-Oct-12 6:45 
QuestionRe: how to setting Four tier application in my application? PinmemberEddy Vluggen4-Oct-12 9:02 
AnswerRe: how to setting Four tier application in my application? PinmvpOriginalGriff4-Oct-12 9:34 
Questionsqldatabaseconnectivity PinmemberMember 94545634-Oct-12 4:05 
AnswerRe: sqldatabaseconnectivity PinmemberRavi Bhavnani4-Oct-12 4:31 
AnswerRe: sqldatabaseconnectivity PinmvpRichard MacCutchan4-Oct-12 4:32 
AnswerRe: sqldatabaseconnectivity Pinmemberpalakshamb4-Oct-12 23:28 
QuestionCan an Attribute class find out, to which class it is actually attached? PinmemberAndy4114-Oct-12 2:42 
AnswerRe: Can an Attribute class find out, to which class it is actually attached? PinmvpDave Kreskowiak4-Oct-12 6:56 
GeneralRe: Can an Attribute class find out, to which class it is actually attached? PinmemberAndy4114-Oct-12 20:05 
AnswerRe: Can an Attribute class find out, to which class it is actually attached? PinmemberBobJanova5-Oct-12 1:15 
GeneralRe: Can an Attribute class find out, to which class it is actually attached? PinmemberAndy4116-Oct-12 2:25 
QuestionReturning Object From HashTable PinmemberAmbiguousName4-Oct-12 1:10 
AnswerRe: Returning Object From HashTable PinmemberSmart Arab4-Oct-12 1:54 
AnswerRe: Returning Object From HashTable PinmemberMember 94836444-Oct-12 1:59 
AnswerRe: Returning Object From HashTable PinmvpManfred R. Bihy4-Oct-12 2:22 
AnswerRe: Returning Object From HashTable PinmemberBernhard Hiller4-Oct-12 21:05 
Questionbusiness process management [modified] Pinmembersag4prog4-Oct-12 1:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.141015.1 | Last Updated 22 Oct 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid