Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / MS / Internal / PtsHost / UnmanagedHandle.cs / 1 / UnmanagedHandle.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: UnmanagedHandle.cs // // Description: Definition for Unmanaged Handle. Provides identity (handle), // which can be used in unmanaged world. // // History: // 05/02/2003 : [....] - moving from Avalon branch. // //--------------------------------------------------------------------------- using System; namespace MS.Internal.PtsHost { ////// Provides identity (handle), which can be used in unmanaged world. /// If object is passed into unmanaged world, and there is a need to identify /// that object later on, its class should inherit from UnmanagedHandle. /// internal class UnmanagedHandle : IDisposable { ////// Constructor. Used when object derives from UnmanagedHandle. /// /// /// PTS context /// protected UnmanagedHandle(PtsContext ptsContext) { _ptsContext = ptsContext; _handle = ptsContext.CreateHandle(this); } ////// Dispose the object and release handle. /// public virtual void Dispose() { try { _ptsContext.ReleaseHandle(_handle); } finally { _handle = IntPtr.Zero; } } ////// Handle of an object. /// internal IntPtr Handle { get { return _handle; } } private IntPtr _handle; ////// PtsContext that is the owner of the handle. /// It is required to store it here for Dispose. When Dispose is called /// it is not always possible to get instance of PtsContext that /// has been used to create this handle. /// internal PtsContext PtsContext { get { return _ptsContext; } } private readonly PtsContext _ptsContext; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ASCIIEncoding.cs
- TableLayoutSettingsTypeConverter.cs
- PropertyPathWorker.cs
- SqlDataReaderSmi.cs
- CannotUnloadAppDomainException.cs
- DispatcherExceptionFilterEventArgs.cs
- DesignerObject.cs
- MergablePropertyAttribute.cs
- MachineKeySection.cs
- FormViewModeEventArgs.cs
- GridViewRowCollection.cs
- ObjectPropertyMapping.cs
- SystemEvents.cs
- SessionIDManager.cs
- propertytag.cs
- log.cs
- ControlBuilderAttribute.cs
- PermissionSetEnumerator.cs
- OnOperation.cs
- DynamicPropertyReader.cs
- DataObject.cs
- MailSettingsSection.cs
- DbParameterCollectionHelper.cs
- IgnoreSectionHandler.cs
- StsCommunicationException.cs
- HttpListenerResponse.cs
- Size3D.cs
- SQLGuid.cs
- ByteStorage.cs
- RadioButtonBaseAdapter.cs
- CodeAttributeDeclaration.cs
- DataTablePropertyDescriptor.cs
- PageThemeParser.cs
- Literal.cs
- DataGridViewHeaderCell.cs
- XmlDataSource.cs
- safelink.cs
- OleDbMetaDataFactory.cs
- WpfGeneratedKnownProperties.cs
- TransformFinalBlockRequest.cs
- MsmqIntegrationSecurityElement.cs
- DurationConverter.cs
- WindowsGrip.cs
- SmtpAuthenticationManager.cs
- CharStorage.cs
- PipelineModuleStepContainer.cs
- ConfigXmlWhitespace.cs
- BinaryWriter.cs
- CloseSequenceResponse.cs
- InputLanguage.cs
- DBSqlParserColumnCollection.cs
- HtmlGenericControl.cs
- Vars.cs
- CommandEventArgs.cs
- UnSafeCharBuffer.cs
- LinearQuaternionKeyFrame.cs
- ResourceExpression.cs
- HttpWebRequestElement.cs
- PasswordBoxAutomationPeer.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- newinstructionaction.cs
- WindowsSecurityToken.cs
- ObjectComplexPropertyMapping.cs
- ExtensionElementCollection.cs
- TypedLocationWrapper.cs
- Object.cs
- UIElement.cs
- MetroSerializationManager.cs
- ExecutionPropertyManager.cs
- XhtmlBasicFormAdapter.cs
- Material.cs
- SpellerInterop.cs
- NamedServiceModelExtensionCollectionElement.cs
- GreenMethods.cs
- StrokeRenderer.cs
- GuidelineCollection.cs
- ObjectKeyFrameCollection.cs
- MD5Cng.cs
- Vector.cs
- ConstNode.cs
- Sql8ConformanceChecker.cs
- XmlDocumentType.cs
- ImageCodecInfo.cs
- DynamicHyperLink.cs
- ColumnMapCopier.cs
- WebPartsSection.cs
- COM2TypeInfoProcessor.cs
- WebPartHelpVerb.cs
- XmlDocumentViewSchema.cs
- CompilerErrorCollection.cs
- MethodBuilderInstantiation.cs
- DomNameTable.cs
- SmtpReplyReaderFactory.cs
- DmlSqlGenerator.cs
- QuerySelectOp.cs
- ReplyChannel.cs
- HandleCollector.cs
- RootBrowserWindow.cs
- DBBindings.cs
- ImageSourceValueSerializer.cs