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
- FamilyMap.cs
- XamlParser.cs
- AccessDataSource.cs
- SynchronizedInputAdaptor.cs
- EntityContainerRelationshipSet.cs
- AssemblyBuilder.cs
- DetailsViewModeEventArgs.cs
- Point3DAnimationBase.cs
- ErrorTableItemStyle.cs
- ErrorFormatterPage.cs
- ServiceDescriptions.cs
- AssemblyBuilderData.cs
- AudienceUriMode.cs
- ClientSponsor.cs
- SoapFault.cs
- VarInfo.cs
- SimpleHandlerBuildProvider.cs
- HashCodeCombiner.cs
- DiscardableAttribute.cs
- KeyGesture.cs
- MsdtcWrapper.cs
- ListItemCollection.cs
- DigitShape.cs
- BezierSegment.cs
- ValueTable.cs
- ViewStateException.cs
- SHA256Cng.cs
- SkewTransform.cs
- CriticalFinalizerObject.cs
- SaveFileDialog.cs
- OLEDB_Enum.cs
- VisualStyleTypesAndProperties.cs
- TransformProviderWrapper.cs
- IProvider.cs
- TraceUtils.cs
- VScrollBar.cs
- XsltConvert.cs
- Site.cs
- WebPartEditorCancelVerb.cs
- XmlQueryType.cs
- ToolTipAutomationPeer.cs
- SimpleExpression.cs
- TypeSystemProvider.cs
- SqlConnectionPoolProviderInfo.cs
- SelectingProviderEventArgs.cs
- FormsAuthenticationCredentials.cs
- ListViewUpdateEventArgs.cs
- DocumentPage.cs
- VisualCollection.cs
- TreeNodeEventArgs.cs
- RSAPKCS1SignatureDeformatter.cs
- ViewKeyConstraint.cs
- DynamicPhysicalDiscoSearcher.cs
- COM2EnumConverter.cs
- SHA1.cs
- EarlyBoundInfo.cs
- CannotUnloadAppDomainException.cs
- FileDetails.cs
- CalloutQueueItem.cs
- NetDataContractSerializer.cs
- XmlCharCheckingReader.cs
- CompilerCollection.cs
- BuildProviderUtils.cs
- ResourceProperty.cs
- HotSpot.cs
- TypedReference.cs
- JournalNavigationScope.cs
- PlacementWorkspace.cs
- HttpValueCollection.cs
- Misc.cs
- DataPager.cs
- ScrollItemProviderWrapper.cs
- StringValidator.cs
- OdbcStatementHandle.cs
- FileFormatException.cs
- COM2PictureConverter.cs
- ClientSettingsProvider.cs
- RijndaelManagedTransform.cs
- HttpListenerContext.cs
- InstanceOwner.cs
- TextViewSelectionProcessor.cs
- ContainerControl.cs
- ClientRuntimeConfig.cs
- CodeGenerator.cs
- DropSourceBehavior.cs
- ToolStripComboBox.cs
- CheckBoxFlatAdapter.cs
- ConfigurationStrings.cs
- ObjectSet.cs
- WebPartPersonalization.cs
- MemberInfoSerializationHolder.cs
- HashAlgorithm.cs
- CommunicationObjectManager.cs
- MimeMapping.cs
- ExpandedProjectionNode.cs
- CodeSubDirectoriesCollection.cs
- ConfigurationManagerInternalFactory.cs
- CookieHandler.cs
- SecurityHelper.cs
- OutputCacheSettingsSection.cs