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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SafeBitVector32.cs
- Decoder.cs
- InputLanguageEventArgs.cs
- EraserBehavior.cs
- EntityCommand.cs
- X509Extension.cs
- PasswordBoxAutomationPeer.cs
- DictationGrammar.cs
- LookupNode.cs
- GlyphingCache.cs
- ClientSettingsSection.cs
- COMException.cs
- XamlToRtfWriter.cs
- QilBinary.cs
- TypeSystemHelpers.cs
- ActivityTypeDesigner.xaml.cs
- StandardOleMarshalObject.cs
- BamlWriter.cs
- ModelVisual3D.cs
- WindowsAuthenticationModule.cs
- InstanceDataCollectionCollection.cs
- AppAction.cs
- ResourceDescriptionAttribute.cs
- ToolStripDropTargetManager.cs
- CodeDefaultValueExpression.cs
- SqlError.cs
- _SslStream.cs
- LabelAutomationPeer.cs
- _HeaderInfo.cs
- FileStream.cs
- DropDownButton.cs
- ArrayMergeHelper.cs
- SchemaElementLookUpTable.cs
- RemoveStoryboard.cs
- validationstate.cs
- Span.cs
- DictionaryBase.cs
- DateTimeSerializationSection.cs
- SortFieldComparer.cs
- BinaryReader.cs
- EventHandlingScope.cs
- GroupDescription.cs
- StylusPointPropertyInfo.cs
- CallContext.cs
- UpWmlMobileTextWriter.cs
- CharUnicodeInfo.cs
- DropTarget.cs
- SelectionService.cs
- updateconfighost.cs
- Encoder.cs
- StandardOleMarshalObject.cs
- HttpProfileGroupBase.cs
- WinEventTracker.cs
- FormatException.cs
- WorkflowEnvironment.cs
- COM2PropertyPageUITypeConverter.cs
- SymDocumentType.cs
- DrawingContextWalker.cs
- Misc.cs
- Button.cs
- TypeUtils.cs
- SpanIndex.cs
- WindowsUpDown.cs
- DataRecordInternal.cs
- FunctionMappingTranslator.cs
- RectangleGeometry.cs
- WebPartZoneAutoFormat.cs
- Debug.cs
- DelegateSerializationHolder.cs
- DataGrid.cs
- TypedTableBase.cs
- ObjectParameter.cs
- InternalDuplexBindingElement.cs
- WCFBuildProvider.cs
- XmlSchemaAll.cs
- _SpnDictionary.cs
- SrgsRulesCollection.cs
- KeyManager.cs
- XmlValueConverter.cs
- FileDataSourceCache.cs
- ObjectTag.cs
- DataGridTableCollection.cs
- DbReferenceCollection.cs
- SctClaimSerializer.cs
- ClientTargetCollection.cs
- PropertyConverter.cs
- LinkUtilities.cs
- ExtensionWindowHeader.cs
- FactoryGenerator.cs
- InvalidDataContractException.cs
- Buffer.cs
- DbProviderFactoriesConfigurationHandler.cs
- BuildProviderUtils.cs
- ImageClickEventArgs.cs
- ColorMap.cs
- ElementProxy.cs
- ReadOnlyCollectionBuilder.cs
- CurrentTimeZone.cs
- HttpServerVarsCollection.cs
- arc.cs