Click here to Skip to main content
15,905,028 members
Home / Discussions / C#
   

C#

 
QuestionHow to truncate a value and display it to a grid [modified] Pin
Burn E5-Jul-06 12:25
Burn E5-Jul-06 12:25 
QuestionVirtual shared folder Pin
Bossek5-Jul-06 12:15
Bossek5-Jul-06 12:15 
QuestionHow to create a game trainer in C# ? Pin
bunnyEATINGrabbit5-Jul-06 12:01
bunnyEATINGrabbit5-Jul-06 12:01 
AnswerRe: How to create a game trainer in C# ? Pin
Dustin Metzgar5-Jul-06 12:16
Dustin Metzgar5-Jul-06 12:16 
GeneralRe: How to create a game trainer in C# ? Pin
bunnyEATINGrabbit6-Jul-06 4:09
bunnyEATINGrabbit6-Jul-06 4:09 
QuestionInheritance Question Pin
MartinSmith5-Jul-06 11:41
MartinSmith5-Jul-06 11:41 
AnswerRe: Inheritance Question Pin
Dustin Metzgar5-Jul-06 12:20
Dustin Metzgar5-Jul-06 12:20 
AnswerRe: Inheritance Question Pin
Guffa5-Jul-06 12:23
Guffa5-Jul-06 12:23 
A, B:
If the method that you put in the base class doesn't fully implement what the method should do, you shouldn't implement it at all. Make it abstract, and put the code in a protected method that the derived classes can use to implement the abstract method.

C:
You can't force anything about how an overridden method is implemented. If you want some code to always be called from the method, let the derived class implement another method instead, that is used by that method:

Base class:

public void Foo() {<br />
   FooTask();<br />
   SomeOtherCode();<br />
}<br />
<br />
protected abstract void FooTask();


Derived class:

protected override void FooTask() {<br />
   SpecificImplementation();<br />
}



---
b { font-weight: normal; }

Questionconverting a Image to a byte[] Pin
(Steven Hicks)n+15-Jul-06 11:01
(Steven Hicks)n+15-Jul-06 11:01 
AnswerRe: converting a Image to a byte[] Pin
Bluebamboo5-Jul-06 11:29
Bluebamboo5-Jul-06 11:29 
GeneralRe: converting a Image to a byte[] Pin
(Steven Hicks)n+15-Jul-06 13:36
(Steven Hicks)n+15-Jul-06 13:36 
AnswerRe: converting a Image to a byte[] Pin
Jon Sagara5-Jul-06 11:36
Jon Sagara5-Jul-06 11:36 
AnswerRe: converting a Image to a byte[] Pin
Ravi Bhavnani5-Jul-06 13:26
professionalRavi Bhavnani5-Jul-06 13:26 
AnswerRe: converting a Image to a byte[] [Solved] [modified] Pin
(Steven Hicks)n+16-Jul-06 5:18
(Steven Hicks)n+16-Jul-06 5:18 
Questionshow release version Pin
donkaiser5-Jul-06 10:39
donkaiser5-Jul-06 10:39 
AnswerRe: show release version Pin
mav.northwind6-Jul-06 5:51
mav.northwind6-Jul-06 5:51 
Questionaccessing http headers in .NET 2.0 WebBrowser Control Pin
mbenezra5-Jul-06 10:03
mbenezra5-Jul-06 10:03 
AnswerRe: accessing http headers in .NET 2.0 WebBrowser Control Pin
led mike5-Jul-06 10:27
led mike5-Jul-06 10:27 
GeneralRe: accessing http headers in .NET 2.0 WebBrowser Control Pin
mbenezra5-Jul-06 12:33
mbenezra5-Jul-06 12:33 
GeneralRe: accessing http headers in .NET 2.0 WebBrowser Control Pin
led mike6-Jul-06 4:49
led mike6-Jul-06 4:49 
QuestionSize problem Pin
Phoen255-Jul-06 9:40
Phoen255-Jul-06 9:40 
AnswerRe: Size problem Pin
Phoen255-Jul-06 9:46
Phoen255-Jul-06 9:46 
AnswerRe: Size problem Pin
Alexander Wiseman5-Jul-06 10:55
Alexander Wiseman5-Jul-06 10:55 
QuestionGet the current users name Pin
jhsheets5-Jul-06 9:00
jhsheets5-Jul-06 9:00 
AnswerRe: Get the current users name Pin
Dustin Metzgar5-Jul-06 12:32
Dustin Metzgar5-Jul-06 12:32 

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.