Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / clr / src / BCL / System / Runtime / InteropServices / ExtensibleClassFactory.cs / 1 / ExtensibleClassFactory.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: ExtensibleClassFactory ** ** ** Purpose: Methods used to customize the creation of managed objects that ** extend from unmanaged objects. ** ** =============================================================================*/ namespace System.Runtime.InteropServices { using System.Runtime.InteropServices; using System.Runtime.Remoting; using System.Runtime.CompilerServices; using System; [System.Runtime.InteropServices.ComVisible(true)] public sealed class ExtensibleClassFactory { // Prevent instantiation. private ExtensibleClassFactory() {} // Register a delegate that will be called whenever an instance of a managed // type that extends from an unmanaged type needs to allocate the aggregated // unmanaged object. This delegate is expected to allocate and aggregate the // unmanaged object and is called in place of a CoCreateInstance. This // routine must be called in the context of the static initializer for the // class for which the callbacks will be made. // It is not legal to register this callback from a class that has any // parents that have already registered a callback. [MethodImplAttribute(MethodImplOptions.InternalCall)] public static extern void RegisterObjectCreationCallback(ObjectCreationDelegate callback); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: ExtensibleClassFactory ** ** ** Purpose: Methods used to customize the creation of managed objects that ** extend from unmanaged objects. ** ** =============================================================================*/ namespace System.Runtime.InteropServices { using System.Runtime.InteropServices; using System.Runtime.Remoting; using System.Runtime.CompilerServices; using System; [System.Runtime.InteropServices.ComVisible(true)] public sealed class ExtensibleClassFactory { // Prevent instantiation. private ExtensibleClassFactory() {} // Register a delegate that will be called whenever an instance of a managed // type that extends from an unmanaged type needs to allocate the aggregated // unmanaged object. This delegate is expected to allocate and aggregate the // unmanaged object and is called in place of a CoCreateInstance. This // routine must be called in the context of the static initializer for the // class for which the callbacks will be made. // It is not legal to register this callback from a class that has any // parents that have already registered a callback. [MethodImplAttribute(MethodImplOptions.InternalCall)] public static extern void RegisterObjectCreationCallback(ObjectCreationDelegate callback); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MetadataProperty.cs
- TraceEventCache.cs
- FrameworkPropertyMetadata.cs
- WorkflowTerminatedException.cs
- DrawingImage.cs
- __FastResourceComparer.cs
- DataGridViewSortCompareEventArgs.cs
- RSAPKCS1KeyExchangeFormatter.cs
- Vector3DCollection.cs
- TrustLevel.cs
- DeriveBytes.cs
- ObjectPersistData.cs
- TextTreeInsertElementUndoUnit.cs
- XmlSchemaFacet.cs
- DBProviderConfigurationHandler.cs
- DataGridViewCellParsingEventArgs.cs
- ContractComponent.cs
- ContextMenuStripActionList.cs
- ListView.cs
- BitmapInitialize.cs
- BidirectionalDictionary.cs
- XmlUrlEditor.cs
- MetricEntry.cs
- XmlIlVisitor.cs
- ReadWriteSpinLock.cs
- ResumeStoryboard.cs
- TabletDevice.cs
- TargetPerspective.cs
- EmptyEnumerable.cs
- TextProviderWrapper.cs
- DragStartedEventArgs.cs
- DelimitedListTraceListener.cs
- DummyDataSource.cs
- XsltQilFactory.cs
- AssemblyUtil.cs
- WebEventCodes.cs
- FacetValues.cs
- QueuePathEditor.cs
- BinHexEncoding.cs
- PropertyNames.cs
- XmlNodeComparer.cs
- ProjectionAnalyzer.cs
- ToolStripPanelRenderEventArgs.cs
- TextRenderer.cs
- ThreadAbortException.cs
- PropertyPath.cs
- XmlSchemaNotation.cs
- HMACSHA512.cs
- ParameterToken.cs
- Single.cs
- RolePrincipal.cs
- GridViewCellAutomationPeer.cs
- HttpVersion.cs
- Panel.cs
- MouseEvent.cs
- manifestimages.cs
- WorkflowInstance.cs
- PathGeometry.cs
- OdbcRowUpdatingEvent.cs
- InstanceNameConverter.cs
- ImageDesigner.cs
- MultipartContentParser.cs
- COSERVERINFO.cs
- DispatcherTimer.cs
- RtfToXamlLexer.cs
- NullRuntimeConfig.cs
- bidPrivateBase.cs
- Types.cs
- ParserStreamGeometryContext.cs
- DateTimeFormatInfo.cs
- SparseMemoryStream.cs
- ConfigXmlReader.cs
- DataBoundLiteralControl.cs
- Triplet.cs
- HostProtectionPermission.cs
- PointLightBase.cs
- PageThemeCodeDomTreeGenerator.cs
- CodeConstructor.cs
- GeneratedContractType.cs
- BinHexEncoder.cs
- ItemsPanelTemplate.cs
- SqlGenericUtil.cs
- RuntimeUtils.cs
- UseManagedPresentationBindingElement.cs
- ImageBrush.cs
- WorkItem.cs
- SocketInformation.cs
- CmsInterop.cs
- ExpressionWriter.cs
- FileDialog_Vista_Interop.cs
- LinqExpressionNormalizer.cs
- EventEntry.cs
- VectorAnimationBase.cs
- AddInStore.cs
- EndpointBehaviorElementCollection.cs
- ValidatorCollection.cs
- TypeBuilderInstantiation.cs
- ColumnMapProcessor.cs
- LightweightCodeGenerator.cs
- AssemblyGen.cs