Re: inheritance not working properly -- Help please!!



ok, I'll post the base class and the inherited class (definition and 1
method, because it would be too long)

public class CNetworkClient<PlayerInfos> : IDisposable where PlayerInfos :
CPlayerInfos, new()
{
public void Connect()
{
// Do things
}
}

public class CNetworkServer<PlayerInfos> : CNetworkClient<PlayerInfos> where
PlayerInfos : CPlayerInfos, new()
{
public override // that's where it should pop with the Connect() method,
but it's not
}

Everything seems normal to me, so I don't understand why it doesn't work...
it's important to notice that the project builds (by removing the "public
override" I just added in the CNetworkServer class

What could be the cause?

Thanks

ThunderMusic


<luvdotnet@xxxxxxxxxxx> wrote in message
news:1154706811.737280.145390@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Can you post a more complete simple code to better understand your
problem?

ThunderMusic wrote:
hi,

I have two classes in C#, one is the base, the other inherits from the
base
class... both are generics... Here is the definition of the second class
:

public class CNetworkServer<PlayerInfos> : CNetworkClient<PlayerInfos>
where
PlayerInfos : CPlayerInfos, new()
{
}

Here is the problem... when I type "public override", the intellisense
should pop with my base class methods... instead it pops with 3 methods
:
Equals, GetHashCode and ToString...

Is there a problem in my definition? here's on of my base class method
that
should be overrided : public void Connect()... Must I add anything to
the
method so I can override it in my inherited class?

I tried to rebuild the project, but no change, still the same...

Can anyone help please?

Thanks

ThunderMusic



.



Relevant Pages

  • Re: inheritance not working properly -- Help please!!
    ... public virtual void Connect ... when I type "public override", ... here's on of my base class method ... to the method so I can override it in my inherited class? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: What can I store in LPARAM
    ... I'm not saying you're wrong, but with my call back up to the base class, ... may choose to override it completely, or by adding code before or after ... comments below regarding leaf. ... This means that a subclass can't change the method body behind ...
    (microsoft.public.vc.mfc)
  • Re: How many bytes per Italian character?
    ... override the InitState() function so it needs to be pure virtual. ... derived classes call up to them anyway; ... both the base class and derived class. ...
    (microsoft.public.vc.mfc)
  • Re: Overriding "OnXXX" versus adding event handler
    ... to touch base functionality and not to deal with component ... Either for base class or for my class. ... For example, you can either write a new OnPaint override, or you can ... In other words, override when you can, add an event handler if you can't. ...
    (microsoft.public.dotnet.framework)
  • Re: problem deriving class from ostringstream (operator <<)
    ... base class Logger. ... >the following sample code writes the 1st string to both cout as well as the ... not override: ... You shouldn't use these old headers which are there ...
    (comp.lang.cpp)

Loading