Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / AccessibleTech / longhorn / Automation / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ScriptResourceMapping.cs
- ExtensibleClassFactory.cs
- ClearTypeHintValidation.cs
- SafeViewOfFileHandle.cs
- CalendarDay.cs
- NotSupportedException.cs
- AdornedElementPlaceholder.cs
- ScrollProperties.cs
- RequestQueryProcessor.cs
- Transform3DGroup.cs
- UniqueConstraint.cs
- FunctionNode.cs
- StorageTypeMapping.cs
- SqlInfoMessageEvent.cs
- SqlDataSourceConfigureFilterForm.cs
- ExceptionHandler.cs
- ToolStripItemRenderEventArgs.cs
- IISMapPath.cs
- DbDataAdapter.cs
- Size3D.cs
- DetailsViewDeleteEventArgs.cs
- RunWorkerCompletedEventArgs.cs
- Brush.cs
- ObjectIDGenerator.cs
- AdornerPresentationContext.cs
- PageStatePersister.cs
- PopupEventArgs.cs
- ObjectStateEntry.cs
- GetMemberBinder.cs
- ExpressionList.cs
- ScrollData.cs
- TreeNodeBinding.cs
- XamlFilter.cs
- StructuralComparisons.cs
- CodeIdentifier.cs
- Setter.cs
- userdatakeys.cs
- InfoCardArgumentException.cs
- DynamicResourceExtensionConverter.cs
- BinaryObjectInfo.cs
- IndexedEnumerable.cs
- AdRotatorDesigner.cs
- RemotingConfiguration.cs
- NavigateEvent.cs
- TargetInvocationException.cs
- TdsParserSessionPool.cs
- Highlights.cs
- GridItemPatternIdentifiers.cs
- ChangeNode.cs
- ProcessHostConfigUtils.cs
- ActionFrame.cs
- CheckBoxPopupAdapter.cs
- AnnotationHelper.cs
- WsdlBuildProvider.cs
- VisualBasicSettings.cs
- CapabilitiesUse.cs
- SafeNativeMethods.cs
- Avt.cs
- UnsafeNativeMethods.cs
- PartDesigner.cs
- storepermission.cs
- ViewStateChangedEventArgs.cs
- PolyBezierSegmentFigureLogic.cs
- DefaultSection.cs
- ConnectionProviderAttribute.cs
- DebugHandleTracker.cs
- InputMethodStateTypeInfo.cs
- XPathException.cs
- XmlElement.cs
- InstanceKeyView.cs
- IdentityModelStringsVersion1.cs
- DateBoldEvent.cs
- TableLayoutStyle.cs
- DefaultPrintController.cs
- XmlHierarchyData.cs
- PopupRoot.cs
- InternalPermissions.cs
- AttachedAnnotation.cs
- GridViewSelectEventArgs.cs
- BasicCellRelation.cs
- InfiniteTimeSpanConverter.cs
- PolicyManager.cs
- XmlIterators.cs
- DataGridViewAdvancedBorderStyle.cs
- HexParser.cs
- CodeConditionStatement.cs
- WebBrowsableAttribute.cs
- namescope.cs
- WSDualHttpBinding.cs
- ClientProtocol.cs
- Codec.cs
- ColorConvertedBitmap.cs
- DataGridViewImageColumn.cs
- XmlIgnoreAttribute.cs
- RelatedImageListAttribute.cs
- EntityCommandExecutionException.cs
- QilScopedVisitor.cs
- _BufferOffsetSize.cs
- TreeNodeMouseHoverEvent.cs
- tibetanshape.cs