Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------------- // //// 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
- ListBox.cs
- QilXmlReader.cs
- QueryOptionExpression.cs
- UDPClient.cs
- XmlSchemaGroupRef.cs
- ExplicitDiscriminatorMap.cs
- TraceContextRecord.cs
- AliasedSlot.cs
- SystemIPv4InterfaceProperties.cs
- GPRECTF.cs
- CompositeFontParser.cs
- PointAnimationBase.cs
- ExecutionEngineException.cs
- WebBrowserUriTypeConverter.cs
- ThreadPool.cs
- ScriptDescriptor.cs
- CheckBoxBaseAdapter.cs
- XmlC14NWriter.cs
- ColorTransform.cs
- XmlElementAttribute.cs
- odbcmetadatacollectionnames.cs
- SqlDataSourceParameterParser.cs
- ExcCanonicalXml.cs
- _UriSyntax.cs
- RepeaterItem.cs
- AssemblyHash.cs
- SByte.cs
- PartBasedPackageProperties.cs
- XmlDictionaryReaderQuotas.cs
- CleanUpVirtualizedItemEventArgs.cs
- RepeaterDesigner.cs
- InternalSafeNativeMethods.cs
- BitmapEffectRenderDataResource.cs
- ErrorFormatterPage.cs
- NetPeerTcpBindingCollectionElement.cs
- SingleAnimationUsingKeyFrames.cs
- SplitterDesigner.cs
- HttpProtocolImporter.cs
- ContextInformation.cs
- PermissionSetEnumerator.cs
- SignatureTargetIdManager.cs
- AppDomainUnloadedException.cs
- ConcurrentQueue.cs
- CriticalHandle.cs
- HttpHandlerActionCollection.cs
- EmissiveMaterial.cs
- LogicalTreeHelper.cs
- DataGridViewCellParsingEventArgs.cs
- Matrix3DConverter.cs
- ScrollViewer.cs
- ScaleTransform.cs
- exports.cs
- ByteArrayHelperWithString.cs
- Splitter.cs
- RadioButton.cs
- FloatUtil.cs
- PrePrepareMethodAttribute.cs
- AssemblyAttributes.cs
- BitmapEffect.cs
- WebOperationContext.cs
- DesignerView.xaml.cs
- DesignerVerbCollection.cs
- IDReferencePropertyAttribute.cs
- Scanner.cs
- DataSourceControl.cs
- RadioButton.cs
- SharedPersonalizationStateInfo.cs
- DataGridViewElement.cs
- FtpWebResponse.cs
- pingexception.cs
- COM2PictureConverter.cs
- validationstate.cs
- TableLayoutPanelBehavior.cs
- SqlUdtInfo.cs
- ProcessDesigner.cs
- PolicyStatement.cs
- Journaling.cs
- SortExpressionBuilder.cs
- UnsafeNativeMethods.cs
- GenericUriParser.cs
- SecurityTokenValidationException.cs
- ZipArchive.cs
- DockingAttribute.cs
- XmlValidatingReader.cs
- KnownTypeAttribute.cs
- ToolTipService.cs
- GcSettings.cs
- WindowsNonControl.cs
- PropertyCollection.cs
- LocalValueEnumerator.cs
- ValidatorCompatibilityHelper.cs
- XmlNamespaceManager.cs
- ClientSideQueueItem.cs
- ConcurrentDictionary.cs
- PixelFormatConverter.cs
- Profiler.cs
- CodeStatement.cs
- InfoCardMetadataExchangeClient.cs
- ServiceHttpHandlerFactory.cs
- DataGridViewRowCollection.cs