Inheritance and overloading

  • Thread starter Thread starter Shayne H
  • Start date Start date
S

Shayne H

I have a query about an intricacy of inheritance and overloading.
I am coding a class inherited from System.Uri.
If I look in the object browser (with hidden members shown) there are 4
overloaded constructors for the Uri class.
However, when accessing the Mybase.New() from my inherited class there are 5
overloaded versions.
The additional version is New(ByVal serializationInfo As SerializationInfo,
ByVal streamingContext As StreamingContext)
Why can I not find the definition for that in the object browser? I looked
in System.Uri and its base classes System.MarshalByRefObject and
System.Object but was not able to find it.
 
Shayne H said:
I have a query about an intricacy of inheritance and overloading.
I am coding a class inherited from System.Uri.
If I look in the object browser (with hidden members shown) there are
4 overloaded constructors for the Uri class.
However, when accessing the Mybase.New() from my inherited class
there are 5 overloaded versions.
The additional version is New(ByVal serializationInfo As
SerializationInfo, ByVal streamingContext As StreamingContext)
Why can I not find the definition for that in the object browser? I
looked in System.Uri and its base classes System.MarshalByRefObject
and System.Object but was not able to find it.

My object browser displays 5 versions of the constructor (Framework 1.1)
 
Shyne,
Its part of System.Uri. As System.Uri implements the ISerializable
interface. The interface cannot enforce the class to implement the
constructor, but the constructor is required by the runtime when
ISerializable is implemented by a class (hence derived classes need to
implement it, if you add the Serializable attribute).

Which version of VS.NET are you using?

I see it in VS.NET 2003.

Is your sort order off in Object Browser? as I find with different sorting &
grouping it is near impossible to find things sometimes. I find sort members
alphabetically works the best.

Hope this helps
Jay
 
Hi Shayne,

I was able to view it in my Object Browser (VS v2002).

That constructor is Protected and therefore only available to someone who
inherits from the class. Perhaps your OB is set up not to show Protected
methods? But how that could be I don't know. :-(

Regards,
Fergus
 
Hi Geezers,

My contract comes to an end soon, so if anyone knows of any free-lance work
or work near london, thames valley, let me know.


Cheers OHM
 
One Handed Man said:
My contract comes to an end soon, so if anyone knows of
any free-lance work or work near london, thames valley,
let me know.

Sorry, I can't help you, but there is a lot of work in this group...

;-)))
 
Hi Herfried,

|| there is a lot of work in this group...

ROFL. No kidding!!

Regards,
Fergus.
================================
Hi OHM,

If you find a position where they need two programmers - drop me a line -
I'm interested in work in London or the Thames Valley!! ;-)

Regards,
Fergus
 
Fergus Cooney said:
If you find a position where they need two programmers -
drop me a line - I'm interested in work in London or the
Thames Valley!! ;-)

ROFL again.
 
Back
Top