Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / UIAutomation / UIAutomationClient / MS / Internal / Automation / SafeHandles.cs / 1305600 / SafeHandles.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Various SafeHandles used by UIA // //--------------------------------------------------------------------------- using System; using System.Runtime.InteropServices; using System.Windows.Automation; using System.Windows.Automation.Provider; // PRESHARP: In order to avoid generating warnings about unkown message numbers and unknown pragmas. #pragma warning disable 1634, 1691 namespace MS.Internal.Automation { internal sealed class SafeNodeHandle : SafeHandle { // Called by P/Invoke when returning SafeHandles // (Also used by UiaCoreApi to create invalid handles.) internal SafeNodeHandle() : base(IntPtr.Zero, true) { } // No need to provide a finalizer - SafeHandle's critical finalizer will // call ReleaseHandle for you. public override bool IsInvalid { get { return handle == IntPtr.Zero; } } override protected bool ReleaseHandle() { return UiaCoreApi.UiaNodeRelease(handle); } } // Internal Class that wraps the IntPtr to the Pattern internal sealed class SafePatternHandle : SafeHandle { // Called by P/Invoke when returning SafeHandles // (Also used by UiaCoreApi to create invalid handles.) internal SafePatternHandle() : base(IntPtr.Zero, true) { } // No need to provide a finalizer - SafeHandle's critical finalizer will // call ReleaseHandle for you. public override bool IsInvalid { get { return handle == IntPtr.Zero; } } override protected bool ReleaseHandle() { return UiaCoreApi.UiaPatternRelease(handle); } } // Internal Class that wraps the IntPtr to the Event internal sealed class SafeEventHandle : SafeHandle { internal SafeEventHandle() : base(IntPtr.Zero, true) { } public override bool IsInvalid { get { return handle == IntPtr.Zero; } } override protected bool ReleaseHandle() { UiaCoreApi.UiaRemoveEvent(handle); return true; } } } // 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
- FileRegion.cs
- HttpCachePolicyElement.cs
- WasEndpointConfigContainer.cs
- PermissionSetEnumerator.cs
- TextTreeInsertElementUndoUnit.cs
- MergeExecutor.cs
- DrawingDrawingContext.cs
- _SslSessionsCache.cs
- XmlSerializableReader.cs
- SqlDataSourceStatusEventArgs.cs
- TypeToken.cs
- PageStatePersister.cs
- AnnotationResource.cs
- CodeArgumentReferenceExpression.cs
- SimpleRecyclingCache.cs
- SystemIPGlobalProperties.cs
- AsyncParams.cs
- QuaternionIndependentAnimationStorage.cs
- XmlException.cs
- OletxTransactionManager.cs
- GridViewDeleteEventArgs.cs
- DataDocumentXPathNavigator.cs
- LocatorGroup.cs
- Predicate.cs
- TreeNodeMouseHoverEvent.cs
- ToolStripRendererSwitcher.cs
- DataServiceStreamProviderWrapper.cs
- Helper.cs
- TimeSpanValidatorAttribute.cs
- NetworkInterface.cs
- TypeToStringValueConverter.cs
- XamlBrushSerializer.cs
- ClassImporter.cs
- IIS7WorkerRequest.cs
- TextTreeInsertElementUndoUnit.cs
- UnsafeNativeMethods.cs
- ObjectView.cs
- Zone.cs
- UserPreferenceChangedEventArgs.cs
- ProtectedConfigurationProviderCollection.cs
- TableRow.cs
- CaseInsensitiveComparer.cs
- RangeEnumerable.cs
- ParentQuery.cs
- DateTimeConverter.cs
- StateWorkerRequest.cs
- ObjectKeyFrameCollection.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- ConfigurationElementCollection.cs
- SspiHelper.cs
- EncodingTable.cs
- RegexNode.cs
- ThreadExceptionDialog.cs
- ControlBuilderAttribute.cs
- PageOutputColor.cs
- EditorPart.cs
- DataGridViewImageCell.cs
- CodeNamespaceCollection.cs
- SqlDataAdapter.cs
- IsolatedStorage.cs
- XmlSchemaAttributeGroup.cs
- DataSourceControlBuilder.cs
- QuadTree.cs
- EllipticalNodeOperations.cs
- ConnectionsZoneAutoFormat.cs
- MsmqHostedTransportConfiguration.cs
- Convert.cs
- TableSectionStyle.cs
- PermissionSetTriple.cs
- ComboBox.cs
- FrameworkObject.cs
- ButtonColumn.cs
- DictionaryManager.cs
- TextRange.cs
- SystemResources.cs
- HtmlTable.cs
- HttpResponseWrapper.cs
- Floater.cs
- PropertyChangingEventArgs.cs
- PointHitTestParameters.cs
- WeakRefEnumerator.cs
- SoapElementAttribute.cs
- LoadWorkflowAsyncResult.cs
- AttributeXamlType.cs
- TCPClient.cs
- FixedPosition.cs
- ConfigXmlText.cs
- BackgroundWorker.cs
- SoapHttpTransportImporter.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- _ProxyChain.cs
- DateTimeFormat.cs
- ApplicationSecurityManager.cs
- LostFocusEventManager.cs
- EntityCodeGenerator.cs
- PageAdapter.cs
- InputMethodStateTypeInfo.cs
- ValueTable.cs
- SingletonInstanceContextProvider.cs
- TypeLibConverter.cs