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
- AutomationPropertyInfo.cs
- ExpressionsCollectionConverter.cs
- SqlSelectStatement.cs
- X509CertificateCollection.cs
- MetadataPropertyCollection.cs
- AnnouncementInnerClientCD1.cs
- StreamReader.cs
- Canvas.cs
- FontFamily.cs
- WindowsButton.cs
- RepeaterItemEventArgs.cs
- ServiceThrottlingBehavior.cs
- EntityDataSourceValidationException.cs
- VolatileEnlistmentMultiplexing.cs
- CommandID.cs
- ScrollBar.cs
- TrustManagerMoreInformation.cs
- SQLConvert.cs
- SQLBytesStorage.cs
- CssStyleCollection.cs
- XmlEventCache.cs
- ListViewItem.cs
- Misc.cs
- EntityCollectionChangedParams.cs
- CompositeTypefaceMetrics.cs
- SqlUdtInfo.cs
- ObjectListField.cs
- CollectionBase.cs
- DataRowIndexBuffer.cs
- RawKeyboardInputReport.cs
- ProjectedWrapper.cs
- PermissionSetTriple.cs
- XPathNavigatorKeyComparer.cs
- MappingException.cs
- SecurityMode.cs
- NameValueCollection.cs
- DynamicAttribute.cs
- CodeTypeReferenceExpression.cs
- IInstanceContextProvider.cs
- TypeGeneratedEventArgs.cs
- PerfService.cs
- SerializeAbsoluteContext.cs
- DateTimeSerializationSection.cs
- QuerySettings.cs
- FormatterServices.cs
- FontUnitConverter.cs
- Compilation.cs
- DataColumnCollection.cs
- CodeArgumentReferenceExpression.cs
- TextureBrush.cs
- FeatureSupport.cs
- OdbcDataAdapter.cs
- WebServicesDescriptionAttribute.cs
- ThreadExceptionEvent.cs
- KerberosRequestorSecurityToken.cs
- ComponentCollection.cs
- RoleServiceManager.cs
- Matrix3DConverter.cs
- CatchDesigner.xaml.cs
- EdmRelationshipRoleAttribute.cs
- TextEditorDragDrop.cs
- HostingEnvironmentSection.cs
- ActiveXHelper.cs
- ProofTokenCryptoHandle.cs
- EnumerableRowCollectionExtensions.cs
- NameTable.cs
- ConfigurationLocation.cs
- RawTextInputReport.cs
- RelationshipEnd.cs
- webeventbuffer.cs
- PackageDigitalSignatureManager.cs
- EntityContainerRelationshipSetEnd.cs
- WindowsToolbarItemAsMenuItem.cs
- XmlTextReaderImplHelpers.cs
- ThaiBuddhistCalendar.cs
- RawKeyboardInputReport.cs
- SessionPageStateSection.cs
- FragmentNavigationEventArgs.cs
- CaseInsensitiveOrdinalStringComparer.cs
- XhtmlConformanceSection.cs
- XmlNotation.cs
- SQLInt16Storage.cs
- basecomparevalidator.cs
- LinkConverter.cs
- WindowsTreeView.cs
- ScriptControlDescriptor.cs
- SerializerWriterEventHandlers.cs
- BinaryObjectWriter.cs
- ClientSettingsStore.cs
- CatchBlock.cs
- ExpandCollapsePattern.cs
- ObjectStorage.cs
- XamlWrappingReader.cs
- ResourceProperty.cs
- PolyBezierSegment.cs
- TrustManagerPromptUI.cs
- MethodToken.cs
- ToolBarButtonClickEvent.cs
- QilPatternVisitor.cs
- DetailsViewUpdatedEventArgs.cs