Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / AccessibleTech / longhorn / Automation / UIAutomationClient / MS / Internal / Automation / SafeHandles.cs / 1 / 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
- ResourceWriter.cs
- UInt32Storage.cs
- EntityCommandExecutionException.cs
- RightsManagementInformation.cs
- InvalidateEvent.cs
- PersonalizationStateInfoCollection.cs
- ScrollItemPattern.cs
- MSHTMLHostUtil.cs
- SelectQueryOperator.cs
- XmlDataImplementation.cs
- InputBuffer.cs
- AssemblyInfo.cs
- NativeRightsManagementAPIsStructures.cs
- BinaryObjectInfo.cs
- ColorMatrix.cs
- FixedHyperLink.cs
- FunctionDetailsReader.cs
- DrawingCollection.cs
- SqlFactory.cs
- PropertyEmitter.cs
- Int64Animation.cs
- EventManager.cs
- Size.cs
- M3DUtil.cs
- RotateTransform3D.cs
- ReliableSessionBindingElementImporter.cs
- TaskHelper.cs
- DebugController.cs
- Blend.cs
- StringFormat.cs
- ApplicationDirectoryMembershipCondition.cs
- HostedTransportConfigurationManager.cs
- RadioButton.cs
- PersonalizationAdministration.cs
- precedingsibling.cs
- TickBar.cs
- GenericsInstances.cs
- SharedTcpTransportManager.cs
- CellRelation.cs
- FlowLayout.cs
- StringArrayEditor.cs
- DefaultBindingPropertyAttribute.cs
- SiteMapHierarchicalDataSourceView.cs
- CodeAccessSecurityEngine.cs
- IntegerFacetDescriptionElement.cs
- Brush.cs
- BufferAllocator.cs
- __ComObject.cs
- FacetChecker.cs
- SiblingIterators.cs
- ListViewCommandEventArgs.cs
- Accessible.cs
- SmtpAuthenticationManager.cs
- DataGridViewEditingControlShowingEventArgs.cs
- ThousandthOfEmRealPoints.cs
- DBSqlParser.cs
- MutexSecurity.cs
- XmlObjectSerializer.cs
- GridItem.cs
- WebPartZoneDesigner.cs
- SoapRpcMethodAttribute.cs
- ListViewUpdatedEventArgs.cs
- RequestValidator.cs
- UnsafeNativeMethods.cs
- NativeCompoundFileAPIs.cs
- odbcmetadatafactory.cs
- BitmapFrame.cs
- HttpFileCollectionWrapper.cs
- OracleTimeSpan.cs
- SystemPens.cs
- Expander.cs
- DataControlCommands.cs
- DataDesignUtil.cs
- PtsPage.cs
- UpdateExpressionVisitor.cs
- Pen.cs
- DesignerHierarchicalDataSourceView.cs
- JsonReader.cs
- JumpPath.cs
- ExpressionBuilder.cs
- SymbolMethod.cs
- ItemsControlAutomationPeer.cs
- ReflectEventDescriptor.cs
- columnmapkeybuilder.cs
- UInt16Converter.cs
- XmlPreloadedResolver.cs
- XamlNamespaceHelper.cs
- HTTPNotFoundHandler.cs
- AggregateNode.cs
- XmlNamespaceMappingCollection.cs
- ToolstripProfessionalRenderer.cs
- TableLayoutPanelCodeDomSerializer.cs
- UnaryNode.cs
- CompressionTransform.cs
- _NegoStream.cs
- InitializerFacet.cs
- SerializationSectionGroup.cs
- ContainerTracking.cs
- InstanceDataCollectionCollection.cs
- AssemblyNameProxy.cs