Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / UIAutomation / Win32Providers / MS / Internal / AutomationProxies / WindowsToolbarAsMenu.cs / 1305600 / WindowsToolbarAsMenu.cs
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
//
// Description: Some applications implement menus with toolbars. This proxy
// will used the IAccessible to expose these toolbars as
// menus. This proxy is derived from WindowsToolbar since
// the underlying control really is a toolbar and WindowsToolbar
// knows how to communicate with then underlying toolbar control
// already.
//
// History:
// 01/31/2005 : [....] Created
//---------------------------------------------------------------------------
using System;
using System.Windows.Automation;
using MS.Win32;
namespace MS.Internal.AutomationProxies
{
class WindowsToolbarAsMenu : WindowsToolbar
{
// -----------------------------------------------------
//
// Constructors
//
// -----------------------------------------------------
#region Constructors
internal WindowsToolbarAsMenu(IntPtr hwnd, ProxyFragment parent, int item, Accessible acc)
: base( hwnd, parent, item )
{
_acc = acc;
// Set the control type based on the IAccessible role.
AccessibleRole role = acc.Role;
if (role == AccessibleRole.MenuBar)
{
_cControlType = ControlType.MenuBar;
_sAutomationId = "MenuBar"; // This string is a non-localizable string
}
else if (role == AccessibleRole.MenuPopup)
{
_cControlType = ControlType.Menu;
_sAutomationId = "MenuPopup"; // This string is a non-localizable string
}
else
{
System.Diagnostics.Debug.Assert(false, "Unexpected role " + role);
}
}
#endregion
// ------------------------------------------------------
//
// Private Fields
//
// -----------------------------------------------------
#region Private Fields
Accessible _acc;
#endregion
}
}
// 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: Some applications implement menus with toolbars. This proxy
// will used the IAccessible to expose these toolbars as
// menus. This proxy is derived from WindowsToolbar since
// the underlying control really is a toolbar and WindowsToolbar
// knows how to communicate with then underlying toolbar control
// already.
//
// History:
// 01/31/2005 : [....] Created
//---------------------------------------------------------------------------
using System;
using System.Windows.Automation;
using MS.Win32;
namespace MS.Internal.AutomationProxies
{
class WindowsToolbarAsMenu : WindowsToolbar
{
// -----------------------------------------------------
//
// Constructors
//
// -----------------------------------------------------
#region Constructors
internal WindowsToolbarAsMenu(IntPtr hwnd, ProxyFragment parent, int item, Accessible acc)
: base( hwnd, parent, item )
{
_acc = acc;
// Set the control type based on the IAccessible role.
AccessibleRole role = acc.Role;
if (role == AccessibleRole.MenuBar)
{
_cControlType = ControlType.MenuBar;
_sAutomationId = "MenuBar"; // This string is a non-localizable string
}
else if (role == AccessibleRole.MenuPopup)
{
_cControlType = ControlType.Menu;
_sAutomationId = "MenuPopup"; // This string is a non-localizable string
}
else
{
System.Diagnostics.Debug.Assert(false, "Unexpected role " + role);
}
}
#endregion
// ------------------------------------------------------
//
// Private Fields
//
// -----------------------------------------------------
#region Private Fields
Accessible _acc;
#endregion
}
}
// 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
- RSAPKCS1SignatureFormatter.cs
- InlineCollection.cs
- ExecutorLocksHeldException.cs
- CustomValidator.cs
- RelationshipConstraintValidator.cs
- DataGridViewSortCompareEventArgs.cs
- MsmqIntegrationElement.cs
- QilTypeChecker.cs
- ResourceSetExpression.cs
- GeneratedContractType.cs
- WebServiceData.cs
- NavigationCommands.cs
- CryptoApi.cs
- WebPartHelpVerb.cs
- ValidateNames.cs
- CodeMethodReturnStatement.cs
- TextHidden.cs
- ADMembershipUser.cs
- WindowsTab.cs
- EnumValidator.cs
- UnsafeNativeMethods.cs
- XmlElementAttributes.cs
- MemberDescriptor.cs
- ExpressionReplacer.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- SoapEnvelopeProcessingElement.cs
- OutKeywords.cs
- IpcPort.cs
- DataTable.cs
- QuestionEventArgs.cs
- ControlEvent.cs
- DbProviderManifest.cs
- InheritedPropertyDescriptor.cs
- TreeNodeEventArgs.cs
- SafeProcessHandle.cs
- QilStrConcatenator.cs
- IntranetCredentialPolicy.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- TimelineCollection.cs
- _ContextAwareResult.cs
- GestureRecognizer.cs
- TagMapCollection.cs
- MergeLocalizationDirectives.cs
- FormsAuthenticationModule.cs
- TransportContext.cs
- XmlWellformedWriter.cs
- ContextMarshalException.cs
- ConfigPathUtility.cs
- ClassHandlersStore.cs
- SQLString.cs
- SerializationAttributes.cs
- InternalUserCancelledException.cs
- StorageMappingFragment.cs
- ProtectedConfigurationSection.cs
- SchemaImporterExtension.cs
- AutoGeneratedField.cs
- BoundPropertyEntry.cs
- WmpBitmapDecoder.cs
- ColorBlend.cs
- FileVersion.cs
- InstallerTypeAttribute.cs
- ComponentSerializationService.cs
- XmlSignificantWhitespace.cs
- TranslateTransform3D.cs
- DiscoveryOperationContext.cs
- BackStopAuthenticationModule.cs
- ThreadStaticAttribute.cs
- EventLogEntry.cs
- HandleExceptionArgs.cs
- SettingsAttributes.cs
- ReadingWritingEntityEventArgs.cs
- VectorAnimationBase.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- DataGridAutoFormatDialog.cs
- OpCellTreeNode.cs
- DependencyObject.cs
- DeviceContext.cs
- GradientBrush.cs
- ObjectManager.cs
- ObjectListSelectEventArgs.cs
- SHA1Managed.cs
- TextServicesCompartment.cs
- FormatSettings.cs
- XmlQueryType.cs
- RegexStringValidator.cs
- ValueTypeFieldReference.cs
- QueryAccessibilityHelpEvent.cs
- BaseResourcesBuildProvider.cs
- InternalSafeNativeMethods.cs
- BookmarkTable.cs
- ImpersonateTokenRef.cs
- CmsUtils.cs
- InsufficientMemoryException.cs
- ProcessThreadCollection.cs
- Debugger.cs
- GregorianCalendar.cs
- WebPartZoneDesigner.cs
- GlyphsSerializer.cs
- StrokeDescriptor.cs
- AssemblyAssociatedContentFileAttribute.cs