Article View: borland.public.csharpbuilder.language.csharp
Article #144Re: More about "class of" in C#
From: Joanna Carter [TeamB]
Date: Fri, 22 Jun 2007 06:46
Date: Fri, 22 Jun 2007 06:46
27 lines
2241 bytes
2241 bytes
David Fallas a οΏ½crit :
> For the sake of completeness for anyone referring to this thread in future -
> there is a little bit more to the story if using the first strategy
> suggested.
>
> Where there is a requirement to call a static method which has NOT been
> overridden in a descendent class, the type.GetMethod() method will not find
> it (where type is the descendent's type).
>
> Instead, if it isn't known if the method has been overridden or not, one
> needs to check the return from the type.GetMethod("xxxx") call and if null,
> call type.BaseType.GetMethod("xxxx") to find the base class' implementation
> of the method.
Thanks for that. I only omitted that due to lack of time.
> This appears to differ significantly from Delphi which seems to be
> capable of finding either a base or overridden method quite happily.
Delphi can find derived static methods because they are declared
virtual; something that cannot be done in C#.
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer
Technical Details
Message-ID:
<467b703a$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<467757d6$1@newsgroups.borland.com> <4677b67f@newsgroups.borland.com> <467b1fbe$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,77a80b77cf3a9a3e X-Google-Attributes: gid1efe35,public,usenet X-Google-Language: ENGLISH,ASCII Date: Fri, 22 Jun 2007 07:46:20 +0100 From: "Joanna Carter [TeamB]" <joanna@nospam.for.me> Organization: Carter Consulting User-Agent: Thunderbird 2.0.0.4 (Macintosh/20070604) MIME-Version: 1.0 Newsgroups: borland.public.csharpbuilder.language.csharp Subject: Re: More about "class of" in C# References: <467757d6$1@newsgroups.borland.com> <4677b67f@newsgroups.borland.com> <467b1fbe$1@newsgroups.borland.com> In-Reply-To: <467b1fbe$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 82.69.239.102 Message-ID: <467b703a$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1182494778 82.69.239.102 (21 Jun 2007 23:46:18 -0700) Lines: 27 X-Authenticated-User: jcarter Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail