Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- CompModSwitches.cs
- DictionarySectionHandler.cs
- Comparer.cs
- PasswordRecovery.cs
- TextEffectResolver.cs
- Span.cs
- ObjectDataSourceView.cs
- HtmlElementCollection.cs
- ProjectionCamera.cs
- SQLBytesStorage.cs
- WebMessageBodyStyleHelper.cs
- DataPagerField.cs
- TypeBuilder.cs
- WebPartPersonalization.cs
- TypeInfo.cs
- ParserContext.cs
- XmlQualifiedName.cs
- FillRuleValidation.cs
- ExpressionConverter.cs
- MenuAutoFormat.cs
- LinqDataSourceStatusEventArgs.cs
- CodeGeneratorAttribute.cs
- StringArrayConverter.cs
- CodeEventReferenceExpression.cs
- BoundColumn.cs
- EdmValidator.cs
- SecurityElement.cs
- StorageComplexPropertyMapping.cs
- RequiredFieldValidator.cs
- Menu.cs
- DataObject.cs
- DBBindings.cs
- SelectionWordBreaker.cs
- AbstractSvcMapFileLoader.cs
- DrawingAttributeSerializer.cs
- StateBag.cs
- DependentList.cs
- ColorConvertedBitmap.cs
- oledbmetadatacolumnnames.cs
- GetWinFXPath.cs
- MouseButtonEventArgs.cs
- ClientScriptItemCollection.cs
- WindowsServiceCredential.cs
- SiteMapPathDesigner.cs
- PointAnimationBase.cs
- UiaCoreProviderApi.cs
- EnumConverter.cs
- MessageEventSubscriptionService.cs
- HMACSHA256.cs
- Expressions.cs
- PackUriHelper.cs
- PerspectiveCamera.cs
- _SecureChannel.cs
- Environment.cs
- CompositeCollectionView.cs
- Int32AnimationBase.cs
- IncrementalReadDecoders.cs
- TagPrefixAttribute.cs
- contentDescriptor.cs
- WindowsUpDown.cs
- DispatcherObject.cs
- StylusButtonCollection.cs
- EmbeddedObject.cs
- ParameterCollectionEditorForm.cs
- ClientSettingsProvider.cs
- ReaderContextStackData.cs
- MetadataUtilsSmi.cs
- EventHandlers.cs
- SoapDocumentMethodAttribute.cs
- MultitargetUtil.cs
- sqlcontext.cs
- ReadOnlyHierarchicalDataSourceView.cs
- COM2ComponentEditor.cs
- WindowsStatic.cs
- EntityModelSchemaGenerator.cs
- ExpressionPrefixAttribute.cs
- TreeWalker.cs
- Argument.cs
- BinaryReader.cs
- PenThreadWorker.cs
- IgnoreFileBuildProvider.cs
- SecurityUtils.cs
- CodeSnippetCompileUnit.cs
- ListBindingConverter.cs
- XmlSchemaNotation.cs
- OdbcConnectionFactory.cs
- PageParserFilter.cs
- webeventbuffer.cs
- RSAOAEPKeyExchangeFormatter.cs
- CfgParser.cs
- ToggleButtonAutomationPeer.cs
- SafeNativeMethods.cs
- ParameterBuilder.cs
- CodeVariableDeclarationStatement.cs
- MappedMetaModel.cs
- ReadWriteObjectLock.cs
- ProcessThreadCollection.cs
- PermissionSetTriple.cs
- MetadataArtifactLoaderCompositeFile.cs
- CompilationPass2Task.cs