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
- PageHandlerFactory.cs
- FlagsAttribute.cs
- InkCanvas.cs
- ImpersonateTokenRef.cs
- IPipelineRuntime.cs
- TableHeaderCell.cs
- CharacterShapingProperties.cs
- dbenumerator.cs
- SchemaAttDef.cs
- ToggleProviderWrapper.cs
- GroupedContextMenuStrip.cs
- SortedList.cs
- TreeViewImageKeyConverter.cs
- HtmlTernaryTree.cs
- SingleKeyFrameCollection.cs
- FileAccessException.cs
- ObjectListSelectEventArgs.cs
- VisualTreeHelper.cs
- InternalBufferManager.cs
- SQLInt32.cs
- SoapObjectReader.cs
- PropagatorResult.cs
- FutureFactory.cs
- ObjectReferenceStack.cs
- ProfileSettings.cs
- OutputScopeManager.cs
- TemplatedAdorner.cs
- LicenseException.cs
- ReadOnlyHierarchicalDataSource.cs
- XPathDocumentBuilder.cs
- UriScheme.cs
- TagMapCollection.cs
- DSASignatureDeformatter.cs
- SiteMapNodeCollection.cs
- TextRangeProviderWrapper.cs
- AppearanceEditorPart.cs
- ConsoleKeyInfo.cs
- SqlInternalConnectionTds.cs
- AbstractExpressions.cs
- NGCUIElementCollectionSerializerAsync.cs
- SourceFileInfo.cs
- ValueExpressions.cs
- ExpressionBuilderCollection.cs
- WebConfigurationFileMap.cs
- Animatable.cs
- ControlTemplate.cs
- TemplatedWizardStep.cs
- Filter.cs
- ManipulationDeltaEventArgs.cs
- NoClickablePointException.cs
- NotifyParentPropertyAttribute.cs
- FatalException.cs
- IgnoreFileBuildProvider.cs
- BreadCrumbTextConverter.cs
- ApplicationCommands.cs
- BitmapCodecInfoInternal.cs
- XmlSerializationGeneratedCode.cs
- URL.cs
- FixedTextBuilder.cs
- SafeMemoryMappedViewHandle.cs
- _ContextAwareResult.cs
- Publisher.cs
- TextWriterEngine.cs
- ReadOnlyActivityGlyph.cs
- ImageField.cs
- DockPatternIdentifiers.cs
- CheckBoxField.cs
- QuotedStringWriteStateInfo.cs
- TypeBinaryExpression.cs
- GradientStop.cs
- AppSettingsReader.cs
- HttpUnhandledOperationInvoker.cs
- DataGridViewBand.cs
- AsyncDataRequest.cs
- ISCIIEncoding.cs
- XmlCharType.cs
- HtmlObjectListAdapter.cs
- WsdlInspector.cs
- CollectionBase.cs
- BinaryFormatter.cs
- FileDetails.cs
- Relationship.cs
- WorkflowEnvironment.cs
- MarkupProperty.cs
- XmlSchemaInfo.cs
- DBAsyncResult.cs
- _PooledStream.cs
- TextDecorationCollection.cs
- SqlCacheDependencyDatabaseCollection.cs
- DrawingVisualDrawingContext.cs
- DataGridRowClipboardEventArgs.cs
- TextModifier.cs
- AuthenticationModulesSection.cs
- EventLogEntryCollection.cs
- DiagnosticsConfiguration.cs
- TypeGeneratedEventArgs.cs
- TableLayoutPanelCellPosition.cs
- AssemblyBuilderData.cs
- TemplateControlParser.cs
- ProtocolsSection.cs