tags:

views:

149

answers:

3

Is it possible to extend a dundas chart control or any other propietary (binary distributed) control(s) where we don't have the sources using partial classes?

I thought it could be done as long as the dll was referenced, but I've been struggling trying to find a way of doing this.

I'm trying to avoid the creation of an ASP .NET Server Control which inherits from the Dundas.Charting.WebControl.Chart class.

+1  A: 

No, to use a partial class the main declaration of that class must already use the partial keyword, usually not the case.

Inheritance is possible if the class is not marked as sealed. You seem not to want that, but it could be the shortest path.

The last option, but one that always works, is to embed the control in a Wrapper that extends its functionality.

Henk Holterman
A: 

if the class is sealed, you cannot inherit from it to add your own functionality. If you are using .net 3.5 you can make class extensions for the class you want to add too. If neither of these options are viable, you will have to create a wrapper class.

Muad'Dib
Method extensions have some limitations, for instance properties can't be created this way.
Raúl Roa
+1  A: 

Nope, this is not possible. All partials definitions must reside in the same assembly. Your way to extend may be to inherit yourself from the Chart class.

flq
+1, I forgot a class must be complete in 1 assembly.
Henk Holterman