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
- WebPartUserCapability.cs
- ClientRuntimeConfig.cs
- PersonalizationStateQuery.cs
- ProfileEventArgs.cs
- TextRunCacheImp.cs
- RegexInterpreter.cs
- CustomAttributeFormatException.cs
- FragmentQueryKB.cs
- SessionSymmetricMessageSecurityProtocolFactory.cs
- AttributeUsageAttribute.cs
- QilInvoke.cs
- StateRuntime.cs
- WpfWebRequestHelper.cs
- ScaleTransform3D.cs
- UnsafeNetInfoNativeMethods.cs
- IdentityReference.cs
- RecordManager.cs
- HtmlEmptyTagControlBuilder.cs
- ConnectionManagementElementCollection.cs
- CollectionEditVerbManager.cs
- GeneralTransform3DGroup.cs
- ToolStripSystemRenderer.cs
- Operator.cs
- DrawingContextDrawingContextWalker.cs
- ResourceBinder.cs
- NotImplementedException.cs
- PerformanceCounters.cs
- InheritedPropertyChangedEventArgs.cs
- MDIControlStrip.cs
- WebPartMenu.cs
- CompositeFontFamily.cs
- MediaElement.cs
- XmlDesignerDataSourceView.cs
- MethodToken.cs
- MasterPageBuildProvider.cs
- CompositeDataBoundControl.cs
- ThreadStaticAttribute.cs
- Schema.cs
- WrapPanel.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- counter.cs
- BridgeDataReader.cs
- OleDbMetaDataFactory.cs
- RemotingConfiguration.cs
- HashHelper.cs
- Pkcs7Recipient.cs
- Facet.cs
- SharedStatics.cs
- AliasedSlot.cs
- UIElement.cs
- UserControl.cs
- MemberDescriptor.cs
- GroupBox.cs
- GridViewColumnCollectionChangedEventArgs.cs
- RegistrationServices.cs
- MarkupCompiler.cs
- AspNetCompatibilityRequirementsAttribute.cs
- NavigationProgressEventArgs.cs
- TextServicesCompartment.cs
- TreeNodeCollectionEditor.cs
- MSAANativeProvider.cs
- AutomationElementIdentifiers.cs
- PeerPresenceInfo.cs
- WSSecurityOneDotZeroSendSecurityHeader.cs
- GroupQuery.cs
- StatusBar.cs
- StateDesigner.TransitionInfo.cs
- OleDbRowUpdatedEvent.cs
- CalendarDay.cs
- RemotingConfiguration.cs
- XmlSchemaSimpleTypeList.cs
- XsltInput.cs
- SynchronizationContext.cs
- ColorConverter.cs
- HttpContext.cs
- DocumentPage.cs
- DoubleStorage.cs
- TraceUtils.cs
- Sql8ConformanceChecker.cs
- wmiprovider.cs
- ConfigurationSectionHelper.cs
- DispatcherFrame.cs
- SiteMapDataSource.cs
- MachineKeySection.cs
- QuaternionConverter.cs
- AliasedExpr.cs
- VolatileEnlistmentMultiplexing.cs
- _BasicClient.cs
- Size3DConverter.cs
- ReturnEventArgs.cs
- EmptyQuery.cs
- CodeAccessSecurityEngine.cs
- WmlSelectionListAdapter.cs
- PeerApplicationLaunchInfo.cs
- ObjectDataSourceDesigner.cs
- CultureMapper.cs
- WebPartManagerInternals.cs
- TriggerBase.cs
- HtmlInputHidden.cs
- CodeSnippetExpression.cs