Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / UIAutomation / 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. //---------------------------------------------------------------------------- // //// 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
- BehaviorEditorPart.cs
- XslTransform.cs
- HttpCachePolicy.cs
- BinaryUtilClasses.cs
- ServiceContractListItemList.cs
- PerfService.cs
- LinqDataSourceDeleteEventArgs.cs
- InvokeMethodActivity.cs
- TypeNameHelper.cs
- ImageDrawing.cs
- BaseParaClient.cs
- IsolatedStorageFile.cs
- FileDataSourceCache.cs
- PriorityChain.cs
- DefaultClaimSet.cs
- Events.cs
- ConcurrentBag.cs
- ControlPaint.cs
- ContentType.cs
- QueryOptionExpression.cs
- DataProtection.cs
- TextSelection.cs
- FormsAuthentication.cs
- EncoderParameter.cs
- SqlXmlStorage.cs
- RegexRunner.cs
- BamlBinaryWriter.cs
- TrackingCondition.cs
- InlineObject.cs
- TransactionContext.cs
- HeaderUtility.cs
- CustomPopupPlacement.cs
- SolidBrush.cs
- BaseResourcesBuildProvider.cs
- PrintDialogDesigner.cs
- FileSecurity.cs
- ClientBuildManager.cs
- ArrayList.cs
- Polyline.cs
- ServiceBuildProvider.cs
- DelegateArgument.cs
- PointAnimationClockResource.cs
- Utils.cs
- CryptoKeySecurity.cs
- DPCustomTypeDescriptor.cs
- mda.cs
- ExpressionBinding.cs
- AnnotationHighlightLayer.cs
- WebPart.cs
- CombinedGeometry.cs
- ComPersistableTypeElement.cs
- DefaultExpression.cs
- PipeStream.cs
- ServiceOperationParameter.cs
- DoubleAnimationBase.cs
- CodeStatementCollection.cs
- ErrorTableItemStyle.cs
- XmlBaseReader.cs
- ConnectionStringsExpressionBuilder.cs
- HttpConfigurationContext.cs
- WebBrowserUriTypeConverter.cs
- HtmlTableRow.cs
- ellipse.cs
- TextDocumentView.cs
- EventEntry.cs
- SizeChangedInfo.cs
- TemplateInstanceAttribute.cs
- BinaryObjectInfo.cs
- XmlUrlResolver.cs
- XmlSchemaAttribute.cs
- NamespaceTable.cs
- TPLETWProvider.cs
- VectorCollectionValueSerializer.cs
- EpmSyndicationContentSerializer.cs
- SafeRightsManagementSessionHandle.cs
- ScopedKnownTypes.cs
- RawMouseInputReport.cs
- StateDesignerConnector.cs
- PrePostDescendentsWalker.cs
- ServiceModelEnumValidator.cs
- TypeBuilderInstantiation.cs
- KeyInstance.cs
- PropertyChangedEventManager.cs
- PropertyConverter.cs
- ComPlusInstanceProvider.cs
- WaitHandle.cs
- WasAdminWrapper.cs
- StrokeCollectionDefaultValueFactory.cs
- FirstQueryOperator.cs
- altserialization.cs
- FixedSOMLineCollection.cs
- SHA512.cs
- AsymmetricKeyExchangeDeformatter.cs
- DmlSqlGenerator.cs
- EntityCollection.cs
- IDictionary.cs
- MimeWriter.cs
- ReceiveContent.cs
- BaseResourcesBuildProvider.cs
- UpdateException.cs