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
- DataGridViewButtonCell.cs
- Logging.cs
- FreezableOperations.cs
- XmlDataSource.cs
- ColorTypeConverter.cs
- GridViewColumnHeader.cs
- BindingCollectionElement.cs
- DependencyPropertyHelper.cs
- HostProtectionException.cs
- XmlNodeComparer.cs
- BevelBitmapEffect.cs
- XmlSerializerAssemblyAttribute.cs
- SpecularMaterial.cs
- IdentityManager.cs
- ProfileSettingsCollection.cs
- ColumnMap.cs
- OraclePermission.cs
- TreeNode.cs
- UnionCqlBlock.cs
- updatecommandorderer.cs
- DynamicMethod.cs
- XmlSchemaSimpleTypeList.cs
- InstanceDataCollection.cs
- ConstantSlot.cs
- FormsAuthenticationTicket.cs
- RSAPKCS1SignatureDeformatter.cs
- TransformCryptoHandle.cs
- RoleManagerModule.cs
- DocumentEventArgs.cs
- ExceptionHandlers.cs
- MenuEventArgs.cs
- SerializationStore.cs
- DataFormats.cs
- SecurityException.cs
- Vector3DCollectionConverter.cs
- SmtpTransport.cs
- EventWaitHandleSecurity.cs
- RegexRunner.cs
- NotImplementedException.cs
- Predicate.cs
- SelectionPatternIdentifiers.cs
- ImmutableObjectAttribute.cs
- MemberPath.cs
- SqlIdentifier.cs
- XmlSchemaGroupRef.cs
- CommandPlan.cs
- SqlCacheDependencyDatabase.cs
- ColumnPropertiesGroup.cs
- BaseContextMenu.cs
- ToolStripRendererSwitcher.cs
- XmlCharCheckingWriter.cs
- Shape.cs
- TableRow.cs
- DocumentPaginator.cs
- GeneralTransform3DGroup.cs
- CssClassPropertyAttribute.cs
- ItemDragEvent.cs
- SrgsRuleRef.cs
- AxWrapperGen.cs
- NotifyCollectionChangedEventArgs.cs
- DataAdapter.cs
- ViewgenContext.cs
- PointKeyFrameCollection.cs
- RowsCopiedEventArgs.cs
- EnumBuilder.cs
- HtmlWindowCollection.cs
- TextBoxView.cs
- XmlFormatExtensionAttribute.cs
- DependencyObjectPropertyDescriptor.cs
- HttpModuleActionCollection.cs
- CatalogPartCollection.cs
- GridViewSortEventArgs.cs
- SpellerInterop.cs
- ListControl.cs
- CodeArrayCreateExpression.cs
- XmlMemberMapping.cs
- Deflater.cs
- ListItemCollection.cs
- EndpointAddressMessageFilter.cs
- DataSourceView.cs
- GC.cs
- XmlSchemas.cs
- ListViewSelectEventArgs.cs
- ReadOnlyNameValueCollection.cs
- EntityTypeEmitter.cs
- SimpleFieldTemplateUserControl.cs
- WindowsScrollBarBits.cs
- SingleStorage.cs
- TraceContextEventArgs.cs
- ListView.cs
- SystemIPv6InterfaceProperties.cs
- dtdvalidator.cs
- PopupRoot.cs
- DesignerValidatorAdapter.cs
- OutputCacheSettings.cs
- AnimationLayer.cs
- EventHandlersDesigner.cs
- ElapsedEventArgs.cs
- GetIndexBinder.cs
- OverrideMode.cs