473,657 Members | 2,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

calling the super class

How would you explicitly call a method of a 'super' class in C#? What do I
put at the dots to just call the GetHierarchical View of XmlDataSource?
public class XmlDataSourceMa rc : XmlDataSource
{
protected override HierarchicalDat aSourceView GetHierarchical View(string
viewPath)
{
return .....;
}
}
Aug 26 '08 #1
3 2795
"Marc" <m.********@rem ovethischello.n lwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
How would you explicitly call a method of a 'super' class in C#? What do I
put at the dots to just call the GetHierarchical View of XmlDataSource?
public class XmlDataSourceMa rc : XmlDataSource
{
protected override HierarchicalDat aSourceView GetHierarchical View(string
viewPath)
{
return .....;
}
}

return base.GetHierarc hicalView(viewP ath);

The IDE even puts it in their for you.

Have you considered reading some of the documentation?

--
Anthony Jones - MVP ASP/ASP.NET
Aug 26 '08 #2

"Anthony Jones" <An*@yadayadaya da.comschreef

return base.GetHierarc hicalView(viewP ath);
Thank you. That's another one: in Delphi it's inherited in Java it's super,
in C# it's base.
The IDE even puts it in their for you.
Well, mine did not...Visual Studio Express Edition?
Have you considered reading some of the documentation?
Sorry, I am reading, but for some questions google for example gives very
irrelevant entries if you don't know what keyword to look for. Thanks for
the hint.

Aug 27 '08 #3
"Marc" <no*****@chello .nlwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>
"Anthony Jones" <An*@yadayadaya da.comschreef

return base.GetHierarc hicalView(viewP ath);

Thank you. That's another one: in Delphi it's inherited in Java it's
super,
in C# it's base.
The IDE even puts it in their for you.

Well, mine did not...Visual Studio Express Edition?
Have you considered reading some of the documentation?

Sorry, I am reading, but for some questions google for example gives very
irrelevant entries if you don't know what keyword to look for. Thanks for
the hint.
Don't google at this level its too general

See:-

http://msdn.microsoft.com/en-gb/library/hfw7t1ce.aspx

Have a rummage through the Keywords and operators reference.

Then read a few programming guides relevant to the stuff you are doing.

--
Anthony Jones - MVP ASP/ASP.NET
Aug 27 '08 #4

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

Similar topics

4
2322
by: Kerim Borchaev | last post by:
Hello! Always when I use "super" I create a code duplication because class used as first arg to "super" is always the class where the method containing "super" was defined in: ''' class C: def method(self): super(C, self).method() '''
11
5026
by: Nicolas Lehuen | last post by:
Hi, I hope this is not a FAQ, but I have trouble understanding the behaviour of the super() built-in function. I've read the excellent book 'Python in a Nutshell' which explains this built-in function on pages 89-90. Based on the example on page 90, I wrote this test code : class A(object): def test(self): print 'A'
4
5150
by: Martin Maney | last post by:
I've been to the cookbook (both forms, since they're sometimes usefully different), but that gave rise to more questions than answers. Heck, let me pull some of them up while I'm at it. Martelli gives the recipie (5.3 on paper) "Calling a Superclass __init__ Method if it Exists" where he seems to say that this: class NewStyleOnly(A, B, C): def __init__(self): super(NewStyleOnly, self).__init__()
6
3707
by: Steven Bethard | last post by:
So when I'm writing a class and I define an __init__ method, I sometimes haven't called object.__init__, e.g.: class C(object): def __init__(self, x): self.x = x instead of class C(object):
14
6397
by: Axel Straschil | last post by:
Hello! Im working with new (object) classes and normaly call init of ther motherclass with callin super(...), workes fine. No, I've got a case with multiple inherance and want to ask if this is the right and common case to call init: class Mother(object): def __init__(self, param_mother): print 'Mother'
5
6525
by: Da Costa Gomez | last post by:
Hi, I was wondering whether someone could shed some light on the following. Using inheritance in Java one can override a function f() (or is it overload?) in the child and then do: public f() { super.f(); ... } in the child to first execute the parent stuff to be followed by the
12
1729
by: torbs | last post by:
Hi I have a a function with several methods. For simplicity it looks a bit like this: super.prototype.aProperty="HELLO"; super.prototype.returnValue = function () { return 2;
9
2195
by: Mike Krell | last post by:
I'm reading Alex Martelli's "Nutshell" second edition. In the section called "Cooperative superclass method calling", he presents a diamond inheritance hierachy: class A(object): def met(self): print "A.met" class B(A): def met(self): print "B.met"
10
13290
by: Finger.Octopus | last post by:
Hello, I have been trying to call the super constructor from my derived class but its not working as expected. See the code: class HTMLMain: def __init__(self): self.text = "<HTML><BODY>"; print(self.text); def __del__(self): self.text = "</BODY></HTML>"; print(self.text);
20
2852
by: Jorgen Bodde | last post by:
Hi All, Now that I am really diving into Python, I encounter a lot of things that us newbies find difficult to get right. I thought I understood how super() worked, but with 'private' members it does not seem to work. For example; .... def __baseMethod(self): .... print 'Test'
0
8394
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8825
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7327
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.