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
- InstancePersistenceCommand.cs
- FactoryGenerator.cs
- WmlValidationSummaryAdapter.cs
- DataTablePropertyDescriptor.cs
- PathParser.cs
- Ref.cs
- TrustLevel.cs
- InvalidDataException.cs
- Math.cs
- TypeExtension.cs
- MenuItem.cs
- TextAutomationPeer.cs
- NativeWrapper.cs
- TextDecorationCollection.cs
- WorkflowViewService.cs
- XmlSignificantWhitespace.cs
- WebServiceMethodData.cs
- PropertyChangedEventManager.cs
- InheritanceContextHelper.cs
- SafeViewOfFileHandle.cs
- TrustManagerPromptUI.cs
- HttpCookiesSection.cs
- base64Transforms.cs
- ThreadAttributes.cs
- Tracer.cs
- DataBoundControlActionList.cs
- WebCategoryAttribute.cs
- DataKey.cs
- DelayDesigner.cs
- PointCollection.cs
- CompilerErrorCollection.cs
- AstTree.cs
- DropShadowBitmapEffect.cs
- QueryableDataSourceEditData.cs
- Buffer.cs
- ParameterToken.cs
- DataShape.cs
- MailMessageEventArgs.cs
- FakeModelItemImpl.cs
- App.cs
- ProtectedProviderSettings.cs
- CircleHotSpot.cs
- DataGridViewRowsRemovedEventArgs.cs
- StsCommunicationException.cs
- PropertyChangeTracker.cs
- ProxyDataContractResolver.cs
- DataGridSortingEventArgs.cs
- AdornedElementPlaceholder.cs
- TypeUnloadedException.cs
- OptimalBreakSession.cs
- ListViewHitTestInfo.cs
- TableFieldsEditor.cs
- ThreadStaticAttribute.cs
- EntitySqlQueryState.cs
- UnionCodeGroup.cs
- DataViewListener.cs
- Site.cs
- LogReservationCollection.cs
- GlyphRunDrawing.cs
- ListBindingHelper.cs
- _SSPIWrapper.cs
- PartialToken.cs
- PtsHost.cs
- SafeCryptoHandles.cs
- SoapEnumAttribute.cs
- processwaithandle.cs
- OracleDataAdapter.cs
- LinkGrep.cs
- AmbientProperties.cs
- ObjectQueryState.cs
- StateItem.cs
- EntryIndex.cs
- ProgressBar.cs
- SchemaRegistration.cs
- RoutedUICommand.cs
- BitmapCacheBrush.cs
- MruCache.cs
- IsolatedStorageException.cs
- StoreContentChangedEventArgs.cs
- CodeTypeReferenceExpression.cs
- MetabaseSettingsIis7.cs
- SplineQuaternionKeyFrame.cs
- TextEffect.cs
- DictionaryGlobals.cs
- EventPrivateKey.cs
- DrawingBrush.cs
- CultureTableRecord.cs
- DataReceivedEventArgs.cs
- IndicCharClassifier.cs
- CatalogZoneBase.cs
- EncoderNLS.cs
- RijndaelManagedTransform.cs
- BaseDataBoundControl.cs
- SolidColorBrush.cs
- HttpSocketManager.cs
- EdmToObjectNamespaceMap.cs
- ObservableCollection.cs
- EditingCoordinator.cs
- TriState.cs
- ReturnEventArgs.cs