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
- PopupControlService.cs
- AuthenticatingEventArgs.cs
- SchemaElementLookUpTable.cs
- RowTypePropertyElement.cs
- FragmentQueryProcessor.cs
- ControlUtil.cs
- WsatProxy.cs
- RenderOptions.cs
- QuaternionAnimation.cs
- ScrollChrome.cs
- NoneExcludedImageIndexConverter.cs
- HyperLinkColumn.cs
- BamlTreeNode.cs
- ManipulationInertiaStartingEventArgs.cs
- SuppressIldasmAttribute.cs
- PopupEventArgs.cs
- SafeHandle.cs
- PeekCompletedEventArgs.cs
- SoapException.cs
- EntityClientCacheEntry.cs
- WebPart.cs
- Pkcs7Signer.cs
- XhtmlBasicLiteralTextAdapter.cs
- SqlCommand.cs
- LinqDataSource.cs
- GeneralTransform3DTo2D.cs
- Preprocessor.cs
- HtmlSelect.cs
- OverflowException.cs
- PropertyValidationContext.cs
- ContextMenuStripGroupCollection.cs
- String.cs
- ProviderConnectionPointCollection.cs
- WorkflowInstanceUnhandledExceptionRecord.cs
- datacache.cs
- NativeRightsManagementAPIsStructures.cs
- SessionSwitchEventArgs.cs
- RegexCaptureCollection.cs
- DefaultProfileManager.cs
- MexHttpBindingElement.cs
- BaseUriHelper.cs
- NavigationHelper.cs
- TextEditorMouse.cs
- URLString.cs
- WsatServiceCertificate.cs
- LoadedOrUnloadedOperation.cs
- DecoderBestFitFallback.cs
- ContentControl.cs
- GenerateHelper.cs
- Margins.cs
- DelimitedListTraceListener.cs
- Italic.cs
- ExpressionEvaluator.cs
- AccessibilityHelperForXpWin2k3.cs
- WebPartVerbsEventArgs.cs
- DBCSCodePageEncoding.cs
- DeclarativeExpressionConditionDeclaration.cs
- Selector.cs
- SystemFonts.cs
- ComboBox.cs
- DesignUtil.cs
- SignatureGenerator.cs
- PropertyGridDesigner.cs
- XmlSortKey.cs
- XsltLoader.cs
- DesignerVerb.cs
- ClusterSafeNativeMethods.cs
- GridViewUpdatedEventArgs.cs
- FlowSwitchDesigner.xaml.cs
- ClientEventManager.cs
- XmlSchemaAnyAttribute.cs
- Evidence.cs
- Operators.cs
- AtomParser.cs
- SafeMILHandle.cs
- Tile.cs
- SafeSecurityHandles.cs
- CounterCreationDataCollection.cs
- CroppedBitmap.cs
- DataGridAddNewRow.cs
- IndexerNameAttribute.cs
- AggregateException.cs
- TouchDevice.cs
- DataTrigger.cs
- StructuralType.cs
- AlignmentXValidation.cs
- Attributes.cs
- AutoGeneratedField.cs
- SafeHandles.cs
- DataTableNewRowEvent.cs
- ContainerSelectorGlyph.cs
- DerivedKeyCachingSecurityTokenSerializer.cs
- DrawingAttributes.cs
- FlowPosition.cs
- UmAlQuraCalendar.cs
- StateMachineTimers.cs
- BinaryObjectInfo.cs
- Gdiplus.cs
- DrawListViewSubItemEventArgs.cs
- ErasingStroke.cs