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
- ConfigurationLocation.cs
- DependencyPropertyConverter.cs
- SingleAnimationBase.cs
- HybridDictionary.cs
- RegularExpressionValidator.cs
- XPathDocumentNavigator.cs
- EventlogProvider.cs
- Object.cs
- PackageDigitalSignatureManager.cs
- PropertyEmitter.cs
- BitmapImage.cs
- SizeLimitedCache.cs
- RectValueSerializer.cs
- DocumentStream.cs
- PrinterUnitConvert.cs
- SqlDataSourceQueryEditor.cs
- Accessible.cs
- MemberExpression.cs
- XmlNamespaceManager.cs
- Effect.cs
- TcpChannelFactory.cs
- HtmlInputReset.cs
- TypeResolvingOptions.cs
- ToolStripSeparator.cs
- DecimalAnimation.cs
- RestHandler.cs
- MetabaseServerConfig.cs
- Tuple.cs
- PrintControllerWithStatusDialog.cs
- Assert.cs
- IdnMapping.cs
- ExecutionContext.cs
- AvTrace.cs
- NameValueConfigurationCollection.cs
- RegexTypeEditor.cs
- SecurityHeaderTokenResolver.cs
- DragEvent.cs
- CheckBoxAutomationPeer.cs
- Int16Storage.cs
- ScriptComponentDescriptor.cs
- SafeSecurityHelper.cs
- QueryRewriter.cs
- PeerName.cs
- QueryCursorEventArgs.cs
- StylusSystemGestureEventArgs.cs
- SchemaImporterExtensionElementCollection.cs
- SafeFindHandle.cs
- InvokeHandlers.cs
- BoolExpr.cs
- TextTreeExtractElementUndoUnit.cs
- HelpKeywordAttribute.cs
- BuildResultCache.cs
- CodeCatchClauseCollection.cs
- HierarchicalDataSourceControl.cs
- EntityContainerEntitySet.cs
- XmlSchemaDocumentation.cs
- CloudCollection.cs
- DocumentPage.cs
- GridViewColumnCollectionChangedEventArgs.cs
- CreateUserErrorEventArgs.cs
- QilName.cs
- EdmItemError.cs
- SchemaTableColumn.cs
- DbConnectionPoolIdentity.cs
- SpecularMaterial.cs
- UncommonField.cs
- GacUtil.cs
- SecurityException.cs
- _BasicClient.cs
- LogReservationCollection.cs
- IIS7WorkerRequest.cs
- MsmqHostedTransportManager.cs
- ListView.cs
- TemplateParser.cs
- TemplateControl.cs
- ConnectivityStatus.cs
- PolyBezierSegmentFigureLogic.cs
- Root.cs
- BigInt.cs
- ProxyElement.cs
- TaskHelper.cs
- ColorConverter.cs
- DeploymentSectionCache.cs
- RegexFCD.cs
- PersonalizationStateInfo.cs
- WebControlToolBoxItem.cs
- DeferrableContent.cs
- LoadGrammarCompletedEventArgs.cs
- MDIWindowDialog.cs
- AnimatedTypeHelpers.cs
- DynamicFilterExpression.cs
- SigningProgress.cs
- WebPartAuthorizationEventArgs.cs
- SqlExpander.cs
- UserPersonalizationStateInfo.cs
- mil_sdk_version.cs
- Stack.cs
- StretchValidation.cs
- Visual3DCollection.cs
- codemethodreferenceexpression.cs