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
- BamlResourceSerializer.cs
- entityreference_tresulttype.cs
- ColorInterpolationModeValidation.cs
- MaskPropertyEditor.cs
- XPathNavigatorKeyComparer.cs
- StringKeyFrameCollection.cs
- MessagingDescriptionAttribute.cs
- ColumnResizeAdorner.cs
- RoleManagerModule.cs
- KeyPressEvent.cs
- HwndStylusInputProvider.cs
- Console.cs
- EdgeModeValidation.cs
- XmlWrappingReader.cs
- EnumerableRowCollectionExtensions.cs
- ColorEditor.cs
- HttpClientProtocol.cs
- Menu.cs
- ControlBindingsCollection.cs
- RichTextBox.cs
- AssertFilter.cs
- NativeMethods.cs
- PKCS1MaskGenerationMethod.cs
- ConnectAlgorithms.cs
- ButtonPopupAdapter.cs
- PageRequestManager.cs
- PerformanceCounter.cs
- HttpResponseMessageProperty.cs
- OleDbConnectionInternal.cs
- FillErrorEventArgs.cs
- RotateTransform3D.cs
- TagPrefixAttribute.cs
- RoleBoolean.cs
- ThreadExceptionDialog.cs
- ObjectItemCollection.cs
- PrePrepareMethodAttribute.cs
- ByteAnimationBase.cs
- Error.cs
- HiddenField.cs
- LinearGradientBrush.cs
- UserPreferenceChangedEventArgs.cs
- XmlSchemaChoice.cs
- ArrayExtension.cs
- XmlText.cs
- EventLogger.cs
- InternalSafeNativeMethods.cs
- SQLMembershipProvider.cs
- EntityProviderServices.cs
- BamlStream.cs
- EncoderReplacementFallback.cs
- HotSpot.cs
- DataGridState.cs
- SuppressMergeCheckAttribute.cs
- LabelDesigner.cs
- PieceDirectory.cs
- Timer.cs
- RemotingHelper.cs
- MenuAutomationPeer.cs
- HtmlButton.cs
- CurrencyManager.cs
- ProxyAttribute.cs
- EntityDataSourceContextCreatedEventArgs.cs
- Descriptor.cs
- TaskFactory.cs
- exports.cs
- FormViewPageEventArgs.cs
- SiteMembershipCondition.cs
- SurrogateEncoder.cs
- EasingQuaternionKeyFrame.cs
- SamlSecurityTokenAuthenticator.cs
- SaveFileDialog.cs
- TaskbarItemInfo.cs
- SpeechDetectedEventArgs.cs
- AppSecurityManager.cs
- PageThemeCodeDomTreeGenerator.cs
- FrugalList.cs
- ByteAnimationUsingKeyFrames.cs
- OracleBinary.cs
- XsltException.cs
- ClientSettingsSection.cs
- DesignerActionVerbList.cs
- MetaColumn.cs
- SynchronizedInputProviderWrapper.cs
- RegularExpressionValidator.cs
- FieldNameLookup.cs
- SimpleHandlerFactory.cs
- DataBindingExpressionBuilder.cs
- GroupBoxAutomationPeer.cs
- TileBrush.cs
- ErrorTableItemStyle.cs
- CharacterMetrics.cs
- MasterPageCodeDomTreeGenerator.cs
- UriSection.cs
- CodeDomConfigurationHandler.cs
- HScrollBar.cs
- MessageQueueEnumerator.cs
- UnsafeNativeMethods.cs
- ProfileGroupSettingsCollection.cs
- DSACryptoServiceProvider.cs
- Hash.cs