O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

ExtensibleClassFactory

Synopsis

This class exposes the method RegisterObjectCreationCallback(), which specifies a delegate that manufactures instances of a managed type. Use this to build managed types that extend unmanaged types. Since a managed type cannot directly inherit from an unmanaged type, the managed type needs to aggregate an instance of the unmanaged type. The delegate that you register with RegisterObjectCreationCallback() takes care of creating the unmanaged type.

public sealed class ExtensibleClassFactory {
// Public Static Methods
   public static method void RegisterObjectCreationCallback(
        ObjectCreationDelegate callback);  
}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required