Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / UIAutomation / 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 : BrendanM 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. //---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Imports from unmanaged UiaCore DLL // // History: // 06/02/2003 : BrendanM 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
- LinearGradientBrush.cs
- fixedPageContentExtractor.cs
- CompoundFileIOPermission.cs
- PropertyGridEditorPart.cs
- TreeWalkHelper.cs
- ParserStreamGeometryContext.cs
- ValidatedControlConverter.cs
- Vector3DKeyFrameCollection.cs
- ClientType.cs
- StorageInfo.cs
- documentsequencetextpointer.cs
- FtpCachePolicyElement.cs
- Decorator.cs
- DebugHandleTracker.cs
- PrimitiveSchema.cs
- RepeatBehavior.cs
- TextRangeAdaptor.cs
- BaseDataBoundControl.cs
- ColumnProvider.cs
- ControlUtil.cs
- SchemaContext.cs
- XmlReaderSettings.cs
- CodeDirectoryCompiler.cs
- PopupRootAutomationPeer.cs
- GestureRecognitionResult.cs
- MatrixAnimationBase.cs
- SecondaryViewProvider.cs
- FontStyles.cs
- Parser.cs
- DataConnectionHelper.cs
- CommonDialog.cs
- DataGridViewCellMouseEventArgs.cs
- EndOfStreamException.cs
- ExpressionParser.cs
- TypeDescriptorFilterService.cs
- GetPageCompletedEventArgs.cs
- EncryptedData.cs
- SignatureDescription.cs
- ExtensionSimplifierMarkupObject.cs
- SqlXml.cs
- PersistChildrenAttribute.cs
- X509Certificate.cs
- CLSCompliantAttribute.cs
- HttpHandlersSection.cs
- RelationshipManager.cs
- updateconfighost.cs
- MemberProjectionIndex.cs
- RegexCharClass.cs
- UshortList2.cs
- InternalDuplexBindingElement.cs
- MemberCollection.cs
- TdsParserSafeHandles.cs
- StorageFunctionMapping.cs
- cookie.cs
- SystemPens.cs
- DbDeleteCommandTree.cs
- SizeLimitedCache.cs
- BinaryNode.cs
- XPathNode.cs
- WindowsListViewItemStartMenu.cs
- securitymgrsite.cs
- RtfToXamlLexer.cs
- SqlUserDefinedAggregateAttribute.cs
- SudsCommon.cs
- TextTreeUndo.cs
- ChannelSinkStacks.cs
- HandledMouseEvent.cs
- XmlMapping.cs
- SerialPort.cs
- NamedElement.cs
- ImageSource.cs
- Stopwatch.cs
- GenericsNotImplementedException.cs
- XmlIterators.cs
- httpserverutility.cs
- SafePointer.cs
- GenericFlowSwitchHelper.cs
- MLangCodePageEncoding.cs
- InvokeDelegate.cs
- ImageMap.cs
- KeyedQueue.cs
- DefaultValueTypeConverter.cs
- WsdlParser.cs
- KnownIds.cs
- PenThread.cs
- KnownTypeAttribute.cs
- RequestCacheManager.cs
- NativeMethods.cs
- SessionStateUtil.cs
- AffineTransform3D.cs
- CodePrimitiveExpression.cs
- UnsettableComboBox.cs
- Calendar.cs
- HScrollBar.cs
- SafeIUnknown.cs
- XPathNodePointer.cs
- OptimalTextSource.cs
- DLinqAssociationProvider.cs
- ActiveXSite.cs
- SQLSingle.cs