Click here to Skip to main content
15,913,941 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to send Images in notification in Android using C#! Pin
Ravi Bhavnani25-Jul-16 5:40
professionalRavi Bhavnani25-Jul-16 5:40 
Questionx86 and x64 in one project Pin
po_saa21-Jul-16 21:33
po_saa21-Jul-16 21:33 
AnswerRe: x86 and x64 in one project Pin
Rob Philpott21-Jul-16 21:46
Rob Philpott21-Jul-16 21:46 
GeneralRe: x86 and x64 in one project Pin
po_saa21-Jul-16 22:15
po_saa21-Jul-16 22:15 
AnswerRe: x86 and x64 in one project Pin
Richard MacCutchan21-Jul-16 21:52
mveRichard MacCutchan21-Jul-16 21:52 
GeneralRe: x86 and x64 in one project Pin
po_saa21-Jul-16 22:11
po_saa21-Jul-16 22:11 
GeneralRe: x86 and x64 in one project Pin
Richard MacCutchan21-Jul-16 22:21
mveRichard MacCutchan21-Jul-16 22:21 
AnswerRe: x86 and x64 in one project Pin
Pete O'Hanlon21-Jul-16 22:05
mvePete O'Hanlon21-Jul-16 22:05 
GeneralRe: x86 and x64 in one project Pin
po_saa21-Jul-16 22:13
po_saa21-Jul-16 22:13 
GeneralRe: x86 and x64 in one project Pin
OriginalGriff21-Jul-16 22:32
mveOriginalGriff21-Jul-16 22:32 
GeneralRe: x86 and x64 in one project Pin
po_saa21-Jul-16 23:19
po_saa21-Jul-16 23:19 
GeneralRe: x86 and x64 in one project Pin
OriginalGriff21-Jul-16 23:36
mveOriginalGriff21-Jul-16 23:36 
GeneralRe: x86 and x64 in one project Pin
po_saa22-Jul-16 0:12
po_saa22-Jul-16 0:12 
GeneralRe: x86 and x64 in one project Pin
Rob Philpott21-Jul-16 23:48
Rob Philpott21-Jul-16 23:48 
GeneralRe: x86 and x64 in one project Pin
po_saa22-Jul-16 0:19
po_saa22-Jul-16 0:19 
QuestionInheritance Pin
sunsher20-Jul-16 15:11
sunsher20-Jul-16 15:11 
GeneralRe: Inheritance Pin
PIEBALDconsult20-Jul-16 16:47
mvePIEBALDconsult20-Jul-16 16:47 
AnswerRe: Inheritance Pin
BillWoodruff20-Jul-16 18:03
professionalBillWoodruff20-Jul-16 18:03 
AnswerRe: Inheritance Pin
Rob Philpott20-Jul-16 20:01
Rob Philpott20-Jul-16 20:01 
AnswerRe: Inheritance Pin
OriginalGriff20-Jul-16 20:20
mveOriginalGriff20-Jul-16 20:20 
Yes - that is exactly what inheritance and method overriding is all about!
C#
public class A : B
    {
    public void DoIt()
        {
        Console.WriteLine("A:DoIt");
        InB();
        }
    public override void Inner()
        {
        base.Inner();
        Console.WriteLine("A:Inner");
        }
    }
public class B
    {
    public void InB()
        {
        Console.WriteLine("B:InB");
        Inner();
        }
    public virtual void Inner()
        {
        Console.WriteLine("B:Innner");
        }
    }

Then when you create an instance:
C#
A a = new A();
a.DoIt();
You get:
A:DoIt
B:InB
B:Innner
A:Inner

Because B.Inner is marked as virtual it can be overridden in derived classed - as it is in A - and the system will look for the most "appropriate" version to call. Because a is declared as an instance of the A class, it calls the A version of the method.
If you declared a as a B instead but assigned it an A (which is perfectly fine as every A is a "superset" of B):
B b = new A();
b.Inner();

You can't call the DoIt method (because B doesn't contain a definition for DoIt), but you will still get:
B:Innner
A:Inner
Becuase the value inside the variable b is still an instance of the A class so the system calls the "latest" version.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: Inheritance Pin
sunsher27-Jul-16 12:48
sunsher27-Jul-16 12:48 
GeneralRe: Inheritance Pin
OriginalGriff27-Jul-16 19:20
mveOriginalGriff27-Jul-16 19:20 
Questionhow i can use Kinect to record skeleton tracking Pin
Member 1252528120-Jul-16 4:12
Member 1252528120-Jul-16 4:12 
AnswerRe: how i can use Kinect to record skeleton tracking Pin
Dave Kreskowiak20-Jul-16 8:14
mveDave Kreskowiak20-Jul-16 8:14 
QuestionInconsistent synchronization Pin
Bernhard Hiller19-Jul-16 22:29
Bernhard Hiller19-Jul-16 22:29 

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.