overriding method or property in partial class

J

john_teague

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 and then override a
property or method for customization. How would I do this with a
partial class. override doesn't compile. is there another modifier I
can use?
 
J

Jon Skeet [C# MVP]

john_teague said:
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 and then override a
property or method for customization. How would I do this with a
partial class. override doesn't compile. is there another modifier I
can use?

No - you can't do this with partial classes. It's something I believe
the C# team are considering for a future release.

Of course, you can still derive from the class and override the method
there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top