473,385 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Inheritance and overloading

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.

--
Thanks for any help,
Shayne H
Nov 20 '05 #1
4 1765
"Shayne H" <shaynehATlycosSPAMGOTOHELLcoDOTuk> schrieb
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)
--
Armin
Nov 20 '05 #2
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

"Shayne H" <shaynehATlycosSPAMGOTOHELLcoDOTuk> wrote in message
news:eL**************@tk2msftngp13.phx.gbl...
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.

--
Thanks for any help,
Shayne H

Nov 20 '05 #3
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

Nov 20 '05 #4
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
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Fuzzyman | last post by:
I've been programming in python for a few months now - and returning to programming after a gap of about ten years I've really enjoyed learning python. I've just made my first forays into...
1
by: Katie | last post by:
my one base class is a linklist class.now i'd like to inherit it by another class.The problem is that when i use the derived class i can't access the base class's pointers.classic type mismatch.how...
12
by: Steve Jorgensen | last post by:
The classing Visual Basic and VBA support for polymorphism, let's face it, is a bit on the weak side, and built-in support for inheritance is non-existent. This little essay is about some patterns...
6
by: apm | last post by:
Recently I have had to use a value type for a complex structure because I don't know how to override the = operator. Can the operator ever be overloaded? Or can inheritance be used with value types?
10
by: Lino Barreca | last post by:
Take a look at this code: Class clsAnagrafica Public Overridable ReadOnly Property Codice() As Integer Get Return 1 End Get End Property End Class
6
by: Massimo Soricetti | last post by:
Hello, recently I wrote a little class which has to wrap two different type of data, showing the same external interface. I used operator overloading, but the same result I could eventually...
7
by: =?Utf-8?B?QWxleCBDb2hu?= | last post by:
In C++, there is an easy technique to provide an overloaded Equals() method. A straightforward translation to C# causes a stack overflow. Why does b.Equals(ba) in the snippet below not understand...
17
by: Bart Friederichs | last post by:
Hello, I created the following inheritance: class Parent { public: void foo(int i); }; class Child : public Parent {
3
by: puzzlecracker | last post by:
Are static method inheritable under csharp rules, if so how can they be used? Can they be virtual? They reason I am asking is because operators are static, and I don't understand how can we...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.