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
- WebPartVerb.cs
- SchemaConstraints.cs
- IpcChannelHelper.cs
- UnmanagedMemoryStreamWrapper.cs
- CompilerWrapper.cs
- DbConnectionPoolGroupProviderInfo.cs
- TabItem.cs
- Point3DCollectionConverter.cs
- RequestCachePolicy.cs
- ApplicationServiceHelper.cs
- SafeLibraryHandle.cs
- ObjectListComponentEditor.cs
- PropertyDescriptorGridEntry.cs
- SelectionProcessor.cs
- UnmanagedMarshal.cs
- DesignColumn.cs
- DefaultEventAttribute.cs
- XmlSchemaGroup.cs
- ObjectIDGenerator.cs
- DnsPermission.cs
- BitmapImage.cs
- InplaceBitmapMetadataWriter.cs
- NTAccount.cs
- TreeWalkHelper.cs
- BamlLocalizationDictionary.cs
- DrawListViewSubItemEventArgs.cs
- EntityDesignerDataSourceView.cs
- TextEvent.cs
- StreamGeometry.cs
- ObjectViewEntityCollectionData.cs
- TableLayoutPanelBehavior.cs
- TransactionOptions.cs
- SoapFormatExtensions.cs
- CodeCompiler.cs
- OleDbDataAdapter.cs
- storepermission.cs
- OperandQuery.cs
- OracleColumn.cs
- ResourceReader.cs
- StrongTypingException.cs
- PeerEndPoint.cs
- HwndProxyElementProvider.cs
- input.cs
- XmlCodeExporter.cs
- StateMachineAction.cs
- HostingEnvironmentException.cs
- StylusTip.cs
- GradientStop.cs
- MetafileHeader.cs
- Token.cs
- GridSplitterAutomationPeer.cs
- AtlasWeb.Designer.cs
- PrintingPermission.cs
- SHA1Cng.cs
- BinaryObjectInfo.cs
- PagerSettings.cs
- PropertyInformation.cs
- HashCodeCombiner.cs
- SafeViewOfFileHandle.cs
- VolatileResourceManager.cs
- DataObject.cs
- XXXInfos.cs
- PageContentCollection.cs
- SelectedGridItemChangedEvent.cs
- VarRemapper.cs
- InternalSafeNativeMethods.cs
- ControlCollection.cs
- Camera.cs
- DoubleIndependentAnimationStorage.cs
- Lookup.cs
- XmlImplementation.cs
- SQLRoleProvider.cs
- DataSourceViewSchemaConverter.cs
- FormatterServicesNoSerializableCheck.cs
- Operators.cs
- WeakReference.cs
- DetailsView.cs
- LabelLiteral.cs
- DataViewSetting.cs
- Missing.cs
- Timer.cs
- FontSourceCollection.cs
- DataGridViewComboBoxEditingControl.cs
- StickyNoteHelper.cs
- RegexBoyerMoore.cs
- InputDevice.cs
- AmbientEnvironment.cs
- XPathNodeHelper.cs
- SortableBindingList.cs
- SqlComparer.cs
- BindingNavigator.cs
- DtdParser.cs
- MemberPath.cs
- TableDetailsRow.cs
- RSAPKCS1SignatureFormatter.cs
- DeclarationUpdate.cs
- TextDecorationLocationValidation.cs
- OleDbDataReader.cs
- EnumMember.cs
- DataKey.cs