overriding method or property in partial class

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • john_teague

    #1

    overriding method or property in partial class

    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?

  • Jon Skeet [C# MVP]

    #2
    Re: overriding method or property in partial class

    john_teague <jcteague@gmail .com> wrote:[color=blue]
    > 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?[/color]

    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.

    --
    Jon Skeet - <skeet@pobox.co m>
    http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
    If replying to the group, please do not mail me too

    Comment

    Working...