Click here to Skip to main content
16,011,988 members
Home / Discussions / C#
   

C#

 
AnswerRe: Help. I'm Lost. How to retrieve the selected row information from a DataGridView Pin
User 665822-Jun-08 8:22
User 665822-Jun-08 8:22 
GeneralRe: Help. I'm Lost. How to retrieve the selected row information from a DataGridView Pin
TheFoZ22-Jun-08 8:25
TheFoZ22-Jun-08 8:25 
GeneralRe: Help. I'm Lost. How to retrieve the selected row information from a DataGridView Pin
Harvey Saayman22-Jun-08 8:56
Harvey Saayman22-Jun-08 8:56 
GeneralRe: Help. I'm Lost. How to retrieve the selected row information from a DataGridView Pin
TheFoZ22-Jun-08 9:16
TheFoZ22-Jun-08 9:16 
GeneralRe: Help. I'm Lost. How to retrieve the selected row information from a DataGridView Pin
Paul Conrad22-Jun-08 9:36
professionalPaul Conrad22-Jun-08 9:36 
QuestionHow to call base class methods automatically? Pin
Metal7622-Jun-08 7:34
Metal7622-Jun-08 7:34 
AnswerRe: How to call base class methods automatically? Pin
Scott Dorman22-Jun-08 7:50
professionalScott Dorman22-Jun-08 7:50 
AnswerRe: How to call base class methods automatically? [modified] Pin
User 665822-Jun-08 8:09
User 665822-Jun-08 8:09 
As Scott already said, there's no way to automatically call a base class method. One solution would be to use some kind of hierarchy, in case the methods are always called in the same order:

public abstract class Message
{
    // Properties & methods representing fields common to all messages
    protected virtual byte[] CompilePacket()
    {
        // Compiles a part of the packet from the common fields
    }
}

public abstract class Command : Message
{
    // Additional fields and methods available for all commands
    protected override byte[] CompilePacket()
    {
        base.CompilePacket();

        // Compiles a part of the packet from command-specific data
    }
}

public abstract class Response : Message
{
    // Additional fields and methods available for all responses
    protected override byte[] CompilePacket()
    {
        base.CompilePacket();

        // Compiles a part of the packet from response-specific data
    }
}

public class MyCommand : Command
{
    // Concrete command class, adds data
    // specific to this particular command
    public byte[] CompileCustomPacket()
    {
        base.CompilePacket();

                    // Adds parts specific to this command
    }
}


So you will only have to call base.CompilePacket(), everything else will be handled by the inheritance hierarchy.

regards

modified on Sunday, June 22, 2008 2:15 PM


modified 12-Sep-18 21:01pm.

AnswerRe: How to call base class methods automatically? Pin
S. Senthil Kumar22-Jun-08 10:17
S. Senthil Kumar22-Jun-08 10:17 
AnswerRe: How to call base class methods automatically? Pin
Joe Woodbury22-Jun-08 13:27
professionalJoe Woodbury22-Jun-08 13:27 
GeneralRe: How to call base class methods automatically? Pin
Metal7623-Jun-08 4:05
Metal7623-Jun-08 4:05 
QuestionGet Class Info Pin
half-life22-Jun-08 5:45
half-life22-Jun-08 5:45 
AnswerRe: Get Class Info Pin
zafersavas22-Jun-08 5:57
zafersavas22-Jun-08 5:57 
GeneralRe: Get Class Info Pin
0x3c022-Jun-08 6:15
0x3c022-Jun-08 6:15 
GeneralRe: Get Class Info Pin
half-life23-Jun-08 8:26
half-life23-Jun-08 8:26 
QuestionConverting Firefox's icon string to the image !!! Pin
Mohammad Dayyan22-Jun-08 3:58
Mohammad Dayyan22-Jun-08 3:58 
AnswerRe: Converting Firefox's icon string to the image !!! Pin
User 665822-Jun-08 4:03
User 665822-Jun-08 4:03 
GeneralRe: Converting Firefox's icon string to the image !!! Pin
Mohammad Dayyan22-Jun-08 4:14
Mohammad Dayyan22-Jun-08 4:14 
QuestionHow to stop running thread ? Pin
Yanshof22-Jun-08 3:29
Yanshof22-Jun-08 3:29 
AnswerRe: How to stop running thread ? Pin
Guffa22-Jun-08 3:33
Guffa22-Jun-08 3:33 
AnswerRe: How to stop running thread ? Pin
half-life22-Jun-08 5:03
half-life22-Jun-08 5:03 
GeneralRe: How to stop running thread ? Pin
N a v a n e e t h22-Jun-08 5:39
N a v a n e e t h22-Jun-08 5:39 
AnswerRe: How to stop running thread ? Pin
N a v a n e e t h22-Jun-08 5:37
N a v a n e e t h22-Jun-08 5:37 
AnswerRe: How to stop running thread ? Pin
Joe Woodbury22-Jun-08 12:15
professionalJoe Woodbury22-Jun-08 12:15 
QuestionIWshRuntimeLibrary Pin
Waheed Ur Rehman22-Jun-08 2:31
Waheed Ur Rehman22-Jun-08 2:31 

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.