Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / AccessibleTech / longhorn / Automation / UIAutomationTypes / MS / Internal / Automation / UiaCoreTypesApi.cs / 1 / UiaCoreTypesApi.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Imports from unmanaged UiaCore DLL // // History: // 06/02/2003 : [....] Ported to WCP // //--------------------------------------------------------------------------- using System; using System.Security; using System.Runtime.InteropServices; using Microsoft.Internal; namespace MS.Internal.Automation { internal static class UiaCoreTypesApi { //----------------------------------------------------- // // Other API types // //----------------------------------------------------- #region Other internal enum AutomationIdType { Property, Pattern, Event, ControlType, TextAttribute } internal const int UIA_E_ELEMENTNOTENABLED = unchecked((int)0x80040200); internal const int UIA_E_ELEMENTNOTAVAILABLE = unchecked((int)0x80040201); internal const int UIA_E_NOCLICKABLEPOINT = unchecked((int)0x80040202); internal const int UIA_E_PROXYASSEMBLYNOTLOADED = unchecked((int)0x80040203); #endregion Other //------------------------------------------------------ // // Internal Methods // //----------------------------------------------------- #region Internal Methods // // Support methods... // ////// Critical: This code calls into the unmanaged UIAutomationCore.dll /// TreatAsSafe: This method simply converts a Guid representing an automation type to an int, making it safe to use. /// [SecurityCritical,SecurityTreatAsSafe] internal static int UiaLookupId(AutomationIdType type, ref Guid guid) { return RawUiaLookupId( type, ref guid ); } ////// Critical: This code calls into the unmanaged UIAutomationCore.dll /// TreatAsSafe: This method only returns a fixed known object representing an Unsupported value, making it safe to use. /// [SecurityCritical,SecurityTreatAsSafe] internal static object UiaGetReservedNotSupportedValue() { object notSupportedValue; CheckError(RawUiaGetReservedNotSupportedValue(out notSupportedValue)); return notSupportedValue; } ////// Critical: This code calls into the unmanaged UIAutomationCore.dll /// TreatAsSafe: This method only returns a fixed known object representing a MixedAttribute value, making it safe to use. /// [SecurityCritical,SecurityTreatAsSafe] internal static object UiaGetReservedMixedAttributeValue() { object mixedAttributeValue; CheckError(RawUiaGetReservedMixedAttributeValue(out mixedAttributeValue)); return mixedAttributeValue; } #endregion Internal Methods //------------------------------------------------------ // // Private Methods // //------------------------------------------------------ #region Private Methods // Check hresult for error... private static void CheckError(int hr) { if (hr >= 0) { return; } Marshal.ThrowExceptionForHR(hr); } [SecurityCritical] [SuppressUnmanagedCodeSecurity] [DllImport(DllImport.UIAutomationCore, EntryPoint = "UiaLookupId", CharSet = CharSet.Unicode)] private static extern int RawUiaLookupId(AutomationIdType type, ref Guid guid); [SecurityCritical] [SuppressUnmanagedCodeSecurity] [DllImport(DllImport.UIAutomationCore, EntryPoint = "UiaGetReservedNotSupportedValue", CharSet = CharSet.Unicode)] private static extern int RawUiaGetReservedNotSupportedValue([MarshalAs(UnmanagedType.IUnknown)] out object notSupportedValue); [SecurityCritical] [SuppressUnmanagedCodeSecurity] [DllImport(DllImport.UIAutomationCore, EntryPoint = "UiaGetReservedMixedAttributeValue", CharSet = CharSet.Unicode)] private static extern int RawUiaGetReservedMixedAttributeValue([MarshalAs(UnmanagedType.IUnknown)] out object mixedAttributeValue); #endregion Private Methods } } // 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
- Keyboard.cs
- HttpCacheParams.cs
- SqlServices.cs
- CacheModeValueSerializer.cs
- Selection.cs
- PrintControllerWithStatusDialog.cs
- XmlSerializerObjectSerializer.cs
- HorizontalAlignConverter.cs
- ChineseLunisolarCalendar.cs
- RemotingServices.cs
- CodeExporter.cs
- XamlVector3DCollectionSerializer.cs
- AttachedPropertyInfo.cs
- DelegateCompletionCallbackWrapper.cs
- ApplicationDirectory.cs
- OdbcConnectionOpen.cs
- SplitContainer.cs
- CodeStatement.cs
- TextProviderWrapper.cs
- SqlTransaction.cs
- EntityDataSourceWrapperCollection.cs
- _CacheStreams.cs
- BitmapEffect.cs
- SettingsPropertyValue.cs
- SessionStateModule.cs
- SeekStoryboard.cs
- ResXBuildProvider.cs
- SocketException.cs
- SizeValueSerializer.cs
- PrintPreviewControl.cs
- DesignBindingPicker.cs
- FontCacheLogic.cs
- SimpleTextLine.cs
- SortFieldComparer.cs
- GZipStream.cs
- LogExtent.cs
- StandardOleMarshalObject.cs
- Sql8ConformanceChecker.cs
- DesignerOptions.cs
- WebBrowsableAttribute.cs
- LazyTextWriterCreator.cs
- PointAnimationClockResource.cs
- LineServices.cs
- XmlParserContext.cs
- FixedSOMSemanticBox.cs
- MetadataPropertyAttribute.cs
- DocumentReferenceCollection.cs
- ModelPerspective.cs
- DelegateHelpers.Generated.cs
- SoapFault.cs
- Menu.cs
- TrackBar.cs
- Visitor.cs
- SizeKeyFrameCollection.cs
- ShapingWorkspace.cs
- ConnectionPoint.cs
- ToolStripComboBox.cs
- ServiceModelDictionary.cs
- VectorConverter.cs
- XmlDomTextWriter.cs
- SizeAnimationClockResource.cs
- SchemaDeclBase.cs
- CustomAttributeSerializer.cs
- BindableAttribute.cs
- RadioButtonList.cs
- MultiAsyncResult.cs
- NetCodeGroup.cs
- FixedSOMImage.cs
- ComponentCache.cs
- XmlSerializer.cs
- ListViewDeleteEventArgs.cs
- DNS.cs
- DataSourceSelectArguments.cs
- CommandBindingCollection.cs
- BitmapScalingModeValidation.cs
- SmtpSection.cs
- ThreadPoolTaskScheduler.cs
- arc.cs
- CommandField.cs
- IResourceProvider.cs
- XPathDocumentIterator.cs
- ControlParameter.cs
- ResizeGrip.cs
- EditorAttribute.cs
- ListViewItemMouseHoverEvent.cs
- CallTemplateAction.cs
- Ref.cs
- KeySpline.cs
- ExternalFile.cs
- PopupEventArgs.cs
- AddInServer.cs
- ConsoleEntryPoint.cs
- ContextBase.cs
- ResourceReader.cs
- ReadOnlyNameValueCollection.cs
- UserControlFileEditor.cs
- WebPartUserCapability.cs
- FindCriteria11.cs
- Geometry.cs
- DoubleAverageAggregationOperator.cs