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
- DrawingBrush.cs
- DetailsView.cs
- SchemaNames.cs
- AcceptorSessionSymmetricMessageSecurityProtocol.cs
- AssociationSetEnd.cs
- ForeignKeyConstraint.cs
- DateTimeOffsetConverter.cs
- WebRequestModuleElementCollection.cs
- SqlTrackingQuery.cs
- EntityEntry.cs
- RemotingSurrogateSelector.cs
- GcSettings.cs
- AuthenticationException.cs
- SupportingTokenBindingElement.cs
- FileSecurity.cs
- DataGridColumn.cs
- Type.cs
- ParameterInfo.cs
- ParserContext.cs
- IList.cs
- StackOverflowException.cs
- TableProviderWrapper.cs
- ActivationServices.cs
- PeerCollaboration.cs
- JapaneseCalendar.cs
- IntSecurity.cs
- StreamingContext.cs
- UserInitiatedRoutedEventPermissionAttribute.cs
- LayoutDump.cs
- UnsafeNativeMethods.cs
- ToolboxControl.cs
- WinEventHandler.cs
- PenThreadWorker.cs
- WindowsSysHeader.cs
- StatusStrip.cs
- SettingsAttributeDictionary.cs
- UnsafeNativeMethods.cs
- DataGridViewCellConverter.cs
- TypePresenter.xaml.cs
- HttpListenerContext.cs
- JournalEntryListConverter.cs
- EventToken.cs
- BuilderInfo.cs
- DbParameterCollectionHelper.cs
- SqlTypeSystemProvider.cs
- DataGridRowsPresenter.cs
- StringDictionary.cs
- PipeStream.cs
- HotSpotCollection.cs
- SamlAudienceRestrictionCondition.cs
- ArglessEventHandlerProxy.cs
- ErrorActivity.cs
- SqlCachedBuffer.cs
- ItemsControlAutomationPeer.cs
- StaticExtension.cs
- LicenseContext.cs
- Calendar.cs
- DetailsViewInsertEventArgs.cs
- ReferenceSchema.cs
- ListMarkerLine.cs
- Bookmark.cs
- CompModHelpers.cs
- QuotedPrintableStream.cs
- MatrixAnimationBase.cs
- ViewGenerator.cs
- GridViewDeletedEventArgs.cs
- SecurityTokenException.cs
- Exception.cs
- MouseEvent.cs
- HttpFileCollectionWrapper.cs
- ExtensionElementCollection.cs
- CompressStream.cs
- ConnectionAcceptor.cs
- TdsValueSetter.cs
- Span.cs
- FrameworkContentElement.cs
- StickyNoteHelper.cs
- ObjectRef.cs
- SpeakInfo.cs
- InvalidFilterCriteriaException.cs
- FormsAuthenticationTicket.cs
- ReversePositionQuery.cs
- PackageRelationship.cs
- Viewport2DVisual3D.cs
- Permission.cs
- WebHttpBindingElement.cs
- MetaModel.cs
- InvokePatternIdentifiers.cs
- ValueSerializerAttribute.cs
- DockProviderWrapper.cs
- SimpleWorkerRequest.cs
- EmptyImpersonationContext.cs
- DiscoveryClientBindingElement.cs
- GenerateHelper.cs
- SqlDependencyUtils.cs
- MailWebEventProvider.cs
- OpCopier.cs
- EntityCommandDefinition.cs
- PreloadedPackages.cs
- ContextActivityUtils.cs