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
- MultiByteCodec.cs
- ForeignKeyConstraint.cs
- WmlCommandAdapter.cs
- XmlElementAttribute.cs
- CollectionChangeEventArgs.cs
- AnimatedTypeHelpers.cs
- Image.cs
- CryptoKeySecurity.cs
- XamlTreeBuilderBamlRecordWriter.cs
- JulianCalendar.cs
- DesignTimeTemplateParser.cs
- CmsInterop.cs
- HashMembershipCondition.cs
- BuildManager.cs
- OutputCacheSettings.cs
- SoapIgnoreAttribute.cs
- ServerIdentity.cs
- SimpleRecyclingCache.cs
- NotFiniteNumberException.cs
- RegexStringValidator.cs
- MsmqEncryptionAlgorithm.cs
- SecurityElement.cs
- RuntimeConfig.cs
- PhonemeConverter.cs
- FileInfo.cs
- CacheMemory.cs
- DispatcherOperation.cs
- ListViewDeleteEventArgs.cs
- DataBindingsDialog.cs
- SchemaTypeEmitter.cs
- ImportCatalogPart.cs
- ConvertTextFrag.cs
- TextServicesCompartmentEventSink.cs
- SimpleBitVector32.cs
- XmlSchemaSimpleContentRestriction.cs
- ClientUrlResolverWrapper.cs
- HijriCalendar.cs
- XsltContext.cs
- ObjectDataProvider.cs
- WebPartConnection.cs
- SizeIndependentAnimationStorage.cs
- CompiledQueryCacheKey.cs
- RulePatternOps.cs
- FirstMatchCodeGroup.cs
- xml.cs
- HealthMonitoringSection.cs
- GradientStopCollection.cs
- StateManagedCollection.cs
- CodeRegionDirective.cs
- RequestResizeEvent.cs
- SoapFormatExtensions.cs
- RepeatButton.cs
- BitmapCodecInfo.cs
- CancelRequestedRecord.cs
- TableProviderWrapper.cs
- Resources.Designer.cs
- SettingsProperty.cs
- PointLight.cs
- XamlSerializer.cs
- CountdownEvent.cs
- EntitySqlQueryBuilder.cs
- AxisAngleRotation3D.cs
- WizardSideBarListControlItem.cs
- StrokeNode.cs
- Missing.cs
- DrawingAttributesDefaultValueFactory.cs
- BitmapEffectDrawingContent.cs
- ListBoxItem.cs
- BaseUriHelper.cs
- ResXBuildProvider.cs
- RootBrowserWindowAutomationPeer.cs
- SqlErrorCollection.cs
- XmlAnyElementAttribute.cs
- ItemCollection.cs
- VectorAnimation.cs
- PipelineModuleStepContainer.cs
- InkCanvasFeedbackAdorner.cs
- EmptyCollection.cs
- ItemType.cs
- _AutoWebProxyScriptWrapper.cs
- TextOptionsInternal.cs
- OneWayBindingElement.cs
- XsltSettings.cs
- XmlElementAttribute.cs
- StrongNameMembershipCondition.cs
- QueryableDataSourceView.cs
- ListViewDeletedEventArgs.cs
- dsa.cs
- XmlNodeReader.cs
- _UncName.cs
- DesignerSerializerAttribute.cs
- EncodingDataItem.cs
- _DisconnectOverlappedAsyncResult.cs
- PrivateFontCollection.cs
- FormViewInsertEventArgs.cs
- IsolatedStorageFilePermission.cs
- RegexRunner.cs
- WindowsFormsHelpers.cs
- Panel.cs
- RestHandlerFactory.cs