473,387 Members | 1,757 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,387 software developers and data experts.

Can a partial class inherit from a partial class?

In 2.0, can a partial class inherit from a partial class to override a
virtual method? I do not have VS2005 installed to test, I'm just
trying to plan with respect to upgrading to 2.0 later.

If it is not possible in 2.0, is it planned for later C#? I'm just
curious here.

Thanks,
Brad Williams

Sep 28 '06 #1
3 4563


"bradw2k" <br*****@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
In 2.0, can a partial class inherit from a partial class to override a
virtual method? I do not have VS2005 installed to test, I'm just
trying to plan with respect to upgrading to 2.0 later.

Sure. A partial class just instructs the compiler to look through all the
source files to piece together the definition of the class. Once it's
compiled, it's no different from any other class.

David

Sep 28 '06 #2
"bradw2k" <br*****@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
In 2.0, can a partial class inherit from a partial class to override a
virtual method?
Yes.
Sep 28 '06 #3
Brad,

There is no such thing as a partial class. A class is a class, nothing
more, nothing less.

The partial keyword allows you to break up the definition of a class
across multiple files.

To answer what I think you are asking, yes, if you use the partial
keyword to break up your class definition, you can still derive from a base
class.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"bradw2k" <br*****@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
In 2.0, can a partial class inherit from a partial class to override a
virtual method? I do not have VS2005 installed to test, I'm just
trying to plan with respect to upgrading to 2.0 later.

If it is not possible in 2.0, is it planned for later C#? I'm just
curious here.

Thanks,
Brad Williams

Sep 28 '06 #4

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

Similar topics

17
by: Paul MG | last post by:
Hi Template partial specialization always seems like a fairly straightforward concept - until I try to do it :). I am trying to implement the input sequence type (from Stroustrup section...
10
by: ptass | last post by:
Hi In asp.net 2.0 an aspx files .cs file is a partial class and all works fine, however, I thought I’d be able to create another class file, call it a partial class and have that compile and...
3
by: George Meng | last post by:
Is there a way to build partial class on the fly, the partial class then extend the class which is already complied? For example: I have a class public class TheClass ...... End Class ...
1
by: Cody Powell | last post by:
I have a partial class split across two files. In the class declaration found in the first file, I state that it's a sealed class. In the class declaration found in the second file, I do not use...
2
by: Billy | last post by:
In .Net 2, when I have created a strongly typed dataset of a SQL table and then 'viewed' the code from the RHM menu. I am taken to the new partial class; as expected, but why do I have a partial...
1
by: john_teague | last post by:
I'm working with a code generator that uses partial classes to generated the basic stuff and leave the other file alone for you to make changes. In the 1.1 version we would inherit from a class...
0
by: dinesh | last post by:
I am using ASP.Net 2.0 ,i've inherited a page in another page. During compilaton I get the error saying " the "base class" could not be found" But when I rebuild the application the error goes....
9
by: Fat Elvis | last post by:
I'd like to extend some of my Asp.net pages by using Partial Classes. Example ASP.Net Page: public partial class Admin_Customer : System.Web.UI.Page { protected void Page_Load(object sender,...
3
by: Lau Lei Cheong | last post by:
A few quick questions: Is there a limitation on how much partial class files we can have for a single class? And can a ASP.NET page file inherit a class from multiple code-behind files? if so,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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,...

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.