Click here to Skip to main content
15,889,281 members
Home / Discussions / C#
   

C#

 
AnswerRe: MVVM and MVC Pin
Abhinav S27-Sep-13 18:05
Abhinav S27-Sep-13 18:05 
AnswerRe: MVVM and MVC Pin
Mycroft Holmes28-Sep-13 13:32
professionalMycroft Holmes28-Sep-13 13:32 
AnswerRe: MVVM and MVC Pin
Keith Barrow30-Sep-13 1:56
professionalKeith Barrow30-Sep-13 1:56 
QuestionHow to read another application contents in C# Pin
S.S.Cheral27-Sep-13 2:05
S.S.Cheral27-Sep-13 2:05 
AnswerRe: How to read another application contents in C# Pin
Keith Barrow27-Sep-13 2:38
professionalKeith Barrow27-Sep-13 2:38 
AnswerRe: How to read another application contents in C# Pin
Abhinav S27-Sep-13 18:06
Abhinav S27-Sep-13 18:06 
QuestionInheriting abstract class Pin
ankum1626-Sep-13 23:35
ankum1626-Sep-13 23:35 
AnswerRe: Inheriting abstract class Pin
OriginalGriff27-Sep-13 0:44
mveOriginalGriff27-Sep-13 0:44 
We call the base class method from the derived class method for the simple reason that it does some work that the whole base class (and by implication all derived classes) expect to have been done!

For example, if you have an abstract Fruit class, then the Picked method will probably set the abstract class field value "datePicked" to the current date - so that you can use it later in the GetBestBeforeDate method. If your derived class overrides the Picked method, then you must set the "datePicked" field correctly, or future abstract class methods won't work properly. Calling the base class implementation is the easiest and most reliable way to make this work properly.

Why use override? Well, again, it is so that things work correctly!

new hides (or replaces) the base class method, override extends it. What that means is that if you declare a derived Fruit class Apple, and it has the Picked method we talked about:

C#
Apple a = new Apple();
Fruit f = a;
Then we call the Picked method
C#
a.Picked();
f.Picked();
The results differ depending on how Picked was declared in the Apple class:
If Picked was an override method:
The two lines call the same method: Apple.Picked because you extended the method.

If Picked was a new method:
The two lines call different methods: the first calls Apple.Picked, the second calls Fruit.Picked because you replaced it


If you aren't sure of this stuff, then you do need to learn it - look back at your course notes, or read up on MSDN because it is pretty important to know what is going on here! Laugh | :laugh:
The only instant messaging I do involves my middle finger.

GeneralRe: Inheriting abstract class Pin
ankum1627-Sep-13 19:46
ankum1627-Sep-13 19:46 
GeneralRe: Inheriting abstract class Pin
OriginalGriff27-Sep-13 19:58
mveOriginalGriff27-Sep-13 19:58 
AnswerRe: Inheriting abstract class Pin
PIEBALDconsult27-Sep-13 18:36
mvePIEBALDconsult27-Sep-13 18:36 
Generalcopyright symbol Pin
Member 1009175626-Sep-13 23:00
Member 1009175626-Sep-13 23:00 
GeneralRe: copyright symbol Pin
Pete O'Hanlon26-Sep-13 23:08
mvePete O'Hanlon26-Sep-13 23:08 
GeneralRe: copyright symbol Pin
Member 1009175626-Sep-13 23:19
Member 1009175626-Sep-13 23:19 
AnswerRe: copyright symbol Pin
Abhinav S27-Sep-13 22:35
Abhinav S27-Sep-13 22:35 
Questionhow to search a pdf file on web Pin
faiza.butt8926-Sep-13 13:19
faiza.butt8926-Sep-13 13:19 
AnswerRe: how to search a pdf file on web Pin
Abhinav S26-Sep-13 20:01
Abhinav S26-Sep-13 20:01 
GeneralRe: how to search a pdf file on web Pin
faiza.butt8929-Sep-13 13:13
faiza.butt8929-Sep-13 13:13 
AnswerRe: how to search a pdf file on web Pin
Pete O'Hanlon26-Sep-13 20:37
mvePete O'Hanlon26-Sep-13 20:37 
QuestionHow to Set the column of excel as bold while importing from datatable Pin
superselector26-Sep-13 3:37
superselector26-Sep-13 3:37 
AnswerRe: How to Set the column of excel as bold while importing from datatable Pin
Richard MacCutchan26-Sep-13 4:31
mveRichard MacCutchan26-Sep-13 4:31 
AnswerRe: How to Set the column of excel as bold while importing from datatable Pin
Chris Quinn26-Sep-13 5:09
Chris Quinn26-Sep-13 5:09 
GeneralRe: How to Set the column of excel as bold while importing from datatable Pin
superselector26-Sep-13 19:21
superselector26-Sep-13 19:21 
GeneralRe: How to Set the column of excel as bold while importing from datatable Pin
Chris Quinn26-Sep-13 21:41
Chris Quinn26-Sep-13 21:41 
QuestionNeed help with datatable Pin
superselector26-Sep-13 1:23
superselector26-Sep-13 1:23 

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.