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
- TabControlDesigner.cs
- ActivityCompletionCallbackWrapper.cs
- messageonlyhwndwrapper.cs
- SHA512.cs
- TriState.cs
- LinkArea.cs
- AutomationElementIdentifiers.cs
- QilStrConcat.cs
- RuleElement.cs
- HtmlWindow.cs
- GradientBrush.cs
- BaseCAMarshaler.cs
- WorkflowTimerService.cs
- MachineKey.cs
- ConfigurationSchemaErrors.cs
- FunctionImportMapping.cs
- ContractNamespaceAttribute.cs
- SoapTypeAttribute.cs
- IISUnsafeMethods.cs
- HeaderFilter.cs
- LockCookie.cs
- PrincipalPermission.cs
- StringComparer.cs
- FileDialogCustomPlace.cs
- XmlSchemaImporter.cs
- NavigationHelper.cs
- PeerInvitationResponse.cs
- HttpCachePolicyElement.cs
- TransformerInfoCollection.cs
- Point3DCollection.cs
- XPathScanner.cs
- JsonByteArrayDataContract.cs
- ToolStripDesignerAvailabilityAttribute.cs
- ChtmlMobileTextWriter.cs
- _HelperAsyncResults.cs
- CustomBindingCollectionElement.cs
- DependencyObjectProvider.cs
- MimeMapping.cs
- StylesEditorDialog.cs
- ProtectedProviderSettings.cs
- HierarchicalDataSourceConverter.cs
- TargetParameterCountException.cs
- DrawingCollection.cs
- HttpListenerException.cs
- Message.cs
- RightNameExpirationInfoPair.cs
- PropertiesTab.cs
- XmlSerializerSection.cs
- GradientSpreadMethodValidation.cs
- DebuggerAttributes.cs
- Walker.cs
- DataView.cs
- SelectedDatesCollection.cs
- ObjectDataSourceEventArgs.cs
- TransformerInfoCollection.cs
- NavigationPropertyAccessor.cs
- PageThemeBuildProvider.cs
- StringConcat.cs
- WinInetCache.cs
- ResourceWriter.cs
- QuaternionRotation3D.cs
- SafeHandle.cs
- DBCommandBuilder.cs
- SocketElement.cs
- DataKeyCollection.cs
- GeometryHitTestResult.cs
- TextElementCollection.cs
- EncoderFallback.cs
- TemplatedMailWebEventProvider.cs
- Empty.cs
- AppDomainProtocolHandler.cs
- ProcessThread.cs
- CryptoStream.cs
- DataGridViewDesigner.cs
- ExceptionNotification.cs
- InfoCardConstants.cs
- XmlSignatureManifest.cs
- RelatedImageListAttribute.cs
- ContourSegment.cs
- ScriptResourceHandler.cs
- VisualTransition.cs
- AmbientLight.cs
- _BaseOverlappedAsyncResult.cs
- MyContact.cs
- WeakReferenceList.cs
- GridViewPageEventArgs.cs
- AdornedElementPlaceholder.cs
- COM2IDispatchConverter.cs
- HttpServerProtocol.cs
- LoginUtil.cs
- Equal.cs
- LinqDataSourceDeleteEventArgs.cs
- KeyboardEventArgs.cs
- ResourceManagerWrapper.cs
- XhtmlBasicPhoneCallAdapter.cs
- GenericTypeParameterBuilder.cs
- SizeKeyFrameCollection.cs
- EncryptedType.cs
- OracleDateTime.cs
- Quaternion.cs