Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / UIAutomation / UIAutomationClient / MS / Internal / Automation / SafeHandles.cs / 1305600 / 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
- SqlServices.cs
- TempEnvironment.cs
- HtmlTableCell.cs
- CompilerParameters.cs
- EventSinkHelperWriter.cs
- DataSourceHelper.cs
- DispatcherExceptionFilterEventArgs.cs
- CodePropertyReferenceExpression.cs
- CodeAttachEventStatement.cs
- CacheChildrenQuery.cs
- GridView.cs
- InstallerTypeAttribute.cs
- RightsManagementEncryptionTransform.cs
- DrawTreeNodeEventArgs.cs
- GeometryCollection.cs
- DynamicMethod.cs
- BlobPersonalizationState.cs
- QueryMath.cs
- baseaxisquery.cs
- ValueTypeFixupInfo.cs
- DefaultAsyncDataDispatcher.cs
- Padding.cs
- Win32.cs
- Event.cs
- RoutingService.cs
- Models.cs
- JpegBitmapDecoder.cs
- SchemaContext.cs
- MessagePropertyVariants.cs
- DesignerLoader.cs
- PrintControllerWithStatusDialog.cs
- VolatileEnlistmentMultiplexing.cs
- PageThemeBuildProvider.cs
- CacheSection.cs
- DockingAttribute.cs
- PolicyStatement.cs
- relpropertyhelper.cs
- MetadataCache.cs
- HostingPreferredMapPath.cs
- TextEditorThreadLocalStore.cs
- VarInfo.cs
- WSHttpSecurityElement.cs
- _FixedSizeReader.cs
- RectIndependentAnimationStorage.cs
- mediaeventargs.cs
- StringToken.cs
- ConnectionStringsSection.cs
- DeliveryStrategy.cs
- OleDbMetaDataFactory.cs
- InplaceBitmapMetadataWriter.cs
- MediaTimeline.cs
- MimeMapping.cs
- DSASignatureDeformatter.cs
- SapiInterop.cs
- RuleSet.cs
- NumericUpDownAccelerationCollection.cs
- ShaperBuffers.cs
- FileLogRecord.cs
- XPathChildIterator.cs
- BevelBitmapEffect.cs
- StringWriter.cs
- SimpleType.cs
- IProvider.cs
- TemplateControlParser.cs
- EncodingTable.cs
- _emptywebproxy.cs
- BehaviorService.cs
- XmlComplianceUtil.cs
- LayoutEvent.cs
- QueryContinueDragEventArgs.cs
- UriScheme.cs
- File.cs
- SynchronizationLockException.cs
- EncodingNLS.cs
- _WebProxyDataBuilder.cs
- SplashScreenNativeMethods.cs
- TypeConverterMarkupExtension.cs
- AttachmentCollection.cs
- dataSvcMapFileLoader.cs
- EntitySqlQueryState.cs
- IfAction.cs
- SourceFileInfo.cs
- TypeUtil.cs
- CrossAppDomainChannel.cs
- ContractNamespaceAttribute.cs
- DoubleAnimationUsingKeyFrames.cs
- BoolExpr.cs
- MediaPlayerState.cs
- NodeInfo.cs
- PersonalizationStateQuery.cs
- ContractCodeDomInfo.cs
- CreateRefExpr.cs
- ItemsControlAutomationPeer.cs
- X500Name.cs
- CrossSiteScriptingValidation.cs
- ProxyHelper.cs
- LineVisual.cs
- UnsafeNetInfoNativeMethods.cs
- PreviewControlDesigner.cs
- EastAsianLunisolarCalendar.cs