Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ObjectDataSourceSelectingEventArgs.cs
- RadioButton.cs
- StickyNoteAnnotations.cs
- BuildManagerHost.cs
- MenuBase.cs
- ObjectHelper.cs
- OAVariantLib.cs
- SliderAutomationPeer.cs
- WriterOutput.cs
- KeyboardDevice.cs
- BoundField.cs
- XmlDictionaryString.cs
- XamlGridLengthSerializer.cs
- Win32.cs
- JoinCqlBlock.cs
- SerializationEventsCache.cs
- AliasExpr.cs
- PngBitmapEncoder.cs
- DSACryptoServiceProvider.cs
- ProcessModuleCollection.cs
- TableCellCollection.cs
- AddingNewEventArgs.cs
- WebPartChrome.cs
- AbstractSvcMapFileLoader.cs
- WrapperEqualityComparer.cs
- SchemaElementLookUpTable.cs
- HttpRawResponse.cs
- _SpnDictionary.cs
- TemplateKey.cs
- ETagAttribute.cs
- DataGridViewComboBoxColumnDesigner.cs
- Triplet.cs
- HttpRuntime.cs
- BezierSegment.cs
- DefinitionUpdate.cs
- QilScopedVisitor.cs
- QilList.cs
- SmtpTransport.cs
- QuaternionRotation3D.cs
- DeviceFilterEditorDialog.cs
- DataGridViewCheckBoxCell.cs
- UserInitiatedRoutedEventPermission.cs
- Nodes.cs
- CopyCodeAction.cs
- Matrix3D.cs
- SaveFileDialogDesigner.cs
- DBConnection.cs
- Grant.cs
- MulticastNotSupportedException.cs
- RegistryExceptionHelper.cs
- CompressEmulationStream.cs
- TextInfo.cs
- ProfileEventArgs.cs
- Triplet.cs
- IteratorFilter.cs
- SmiContext.cs
- SizeChangedInfo.cs
- EpmSyndicationContentDeSerializer.cs
- GeneralTransform3DGroup.cs
- TemplateXamlTreeBuilder.cs
- GenericsInstances.cs
- RuleSetCollection.cs
- ComplexPropertyEntry.cs
- ErrorRuntimeConfig.cs
- _NestedSingleAsyncResult.cs
- XPathPatternBuilder.cs
- BuildResult.cs
- SafeRightsManagementSessionHandle.cs
- WebControlsSection.cs
- FtpWebRequest.cs
- Image.cs
- InArgumentConverter.cs
- DropShadowEffect.cs
- KeyEventArgs.cs
- TransformedBitmap.cs
- Transform3DCollection.cs
- ResourceAttributes.cs
- SemaphoreFullException.cs
- AmbiguousMatchException.cs
- NetworkCredential.cs
- HandlerFactoryCache.cs
- FileUtil.cs
- CharConverter.cs
- MatrixValueSerializer.cs
- SHA384.cs
- Monitor.cs
- MethodAccessException.cs
- PropertyEmitterBase.cs
- ObservableCollectionDefaultValueFactory.cs
- TextBox.cs
- XslCompiledTransform.cs
- HttpApplicationStateWrapper.cs
- ApplicationException.cs
- Calendar.cs
- HandleCollector.cs
- ConfigurationSchemaErrors.cs
- FillBehavior.cs
- ScrollBarRenderer.cs
- RepeaterItemCollection.cs
- DuplicateDetector.cs