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
- ByteAnimation.cs
- DelegatingConfigHost.cs
- JsonServiceDocumentSerializer.cs
- QilInvokeLateBound.cs
- RelatedPropertyManager.cs
- PngBitmapDecoder.cs
- DataControlFieldCollection.cs
- Rotation3DAnimationBase.cs
- AnimationLayer.cs
- CounterCreationDataCollection.cs
- ProcessModule.cs
- TargetInvocationException.cs
- AccessViolationException.cs
- WindowsTreeView.cs
- DataControlLinkButton.cs
- ClientTarget.cs
- Misc.cs
- AccessorTable.cs
- DynamicDataRouteHandler.cs
- CounterCreationDataCollection.cs
- LinqDataSourceUpdateEventArgs.cs
- TimeoutStream.cs
- DocumentGridContextMenu.cs
- TextAutomationPeer.cs
- TdsParserHelperClasses.cs
- complextypematerializer.cs
- BuildResult.cs
- DocumentGridContextMenu.cs
- ClockGroup.cs
- WebPartsPersonalization.cs
- Pen.cs
- SubpageParaClient.cs
- _ContextAwareResult.cs
- Predicate.cs
- BindingManagerDataErrorEventArgs.cs
- XmlSchemaGroupRef.cs
- ControlBindingsCollection.cs
- PersonalizablePropertyEntry.cs
- BamlCollectionHolder.cs
- ReadOnlyMetadataCollection.cs
- HttpWebRequestElement.cs
- SR.cs
- ObjectItemNoOpAssemblyLoader.cs
- NamedPermissionSet.cs
- NetworkAddressChange.cs
- RMEnrollmentPage2.cs
- PriorityItem.cs
- DesignerTransaction.cs
- followingsibling.cs
- ControlCachePolicy.cs
- Cursor.cs
- DiscoveryRequestHandler.cs
- Win32.cs
- XmlDataProvider.cs
- SrgsElementFactoryCompiler.cs
- LayoutEditorPart.cs
- RayMeshGeometry3DHitTestResult.cs
- COM2TypeInfoProcessor.cs
- StdValidatorsAndConverters.cs
- PrintDialogException.cs
- CustomAttributeSerializer.cs
- ValidatorUtils.cs
- SQLResource.cs
- ListenerHandler.cs
- _AuthenticationState.cs
- CompositeActivityValidator.cs
- ExpressionVisitorHelpers.cs
- MissingFieldException.cs
- RegistrySecurity.cs
- DateRangeEvent.cs
- TraceProvider.cs
- Rule.cs
- DeviceContext2.cs
- ArraySortHelper.cs
- XamlReaderHelper.cs
- TextSimpleMarkerProperties.cs
- ItemsChangedEventArgs.cs
- ListViewTableCell.cs
- DiscreteKeyFrames.cs
- AssociationType.cs
- ArcSegment.cs
- AlternationConverter.cs
- DesignerCommandSet.cs
- SqlMethodCallConverter.cs
- ByeOperation11AsyncResult.cs
- BindingEntityInfo.cs
- FormsAuthentication.cs
- ToolZone.cs
- BaseTreeIterator.cs
- Wildcard.cs
- XmlCompatibilityReader.cs
- UInt64Storage.cs
- TraceUtility.cs
- Grant.cs
- UIElement3D.cs
- MetadataCache.cs
- NetworkAddressChange.cs
- DecimalConverter.cs
- localization.cs
- TextEditorLists.cs