Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / UIAutomation / Win32Providers / MS / Internal / AutomationProxies / WindowsToolbarAsMenu.cs / 1 / 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
- SecurityPolicySection.cs
- UnknownBitmapDecoder.cs
- DataTableMapping.cs
- SiteOfOriginContainer.cs
- ThreadNeutralSemaphore.cs
- Help.cs
- Authorization.cs
- SimpleHandlerFactory.cs
- MarkupExtensionParser.cs
- SystemInfo.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- ObjectListField.cs
- SSmlParser.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- PathGradientBrush.cs
- WebAdminConfigurationHelper.cs
- WebBaseEventKeyComparer.cs
- Int16AnimationUsingKeyFrames.cs
- BrushMappingModeValidation.cs
- CodeNamespaceImport.cs
- FragmentQueryProcessor.cs
- SetterTriggerConditionValueConverter.cs
- ApplicationSecurityManager.cs
- XmlSerializerSection.cs
- LoadedOrUnloadedOperation.cs
- GroupBoxRenderer.cs
- Bits.cs
- LogExtentCollection.cs
- XmlNotation.cs
- FormsAuthenticationUserCollection.cs
- TemplatePartAttribute.cs
- EnumType.cs
- DynamicDocumentPaginator.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- TargetException.cs
- TypeSchema.cs
- BasicCellRelation.cs
- XmlSerializationGeneratedCode.cs
- XmlNavigatorStack.cs
- XmlNamespaceDeclarationsAttribute.cs
- PointValueSerializer.cs
- AlternateView.cs
- XmlNode.cs
- Point3DConverter.cs
- VerticalAlignConverter.cs
- FixedSOMPageElement.cs
- JsonCollectionDataContract.cs
- PageClientProxyGenerator.cs
- DataGridViewCellFormattingEventArgs.cs
- WebPartZoneAutoFormat.cs
- UnhandledExceptionEventArgs.cs
- CodeArgumentReferenceExpression.cs
- ItemCheckedEvent.cs
- RawAppCommandInputReport.cs
- BinaryWriter.cs
- SaveFileDialog.cs
- PseudoWebRequest.cs
- Context.cs
- IdentifierCollection.cs
- InkCanvasInnerCanvas.cs
- DoubleCollectionConverter.cs
- TextHintingModeValidation.cs
- ProviderConnectionPoint.cs
- FileReader.cs
- D3DImage.cs
- CanExecuteRoutedEventArgs.cs
- DataSetUtil.cs
- UncommonField.cs
- IntellisenseTextBox.designer.cs
- SqlVisitor.cs
- SequentialWorkflowRootDesigner.cs
- ScrollItemPattern.cs
- AdornerLayer.cs
- PropertyToken.cs
- XmlValidatingReaderImpl.cs
- BufferedGraphics.cs
- X509Utils.cs
- SortExpressionBuilder.cs
- QilReplaceVisitor.cs
- WebBrowserContainer.cs
- FormCollection.cs
- NativeMethods.cs
- ForceCopyBuildProvider.cs
- TraversalRequest.cs
- ImageMapEventArgs.cs
- WebPartVerb.cs
- SymDocumentType.cs
- WebPartCatalogAddVerb.cs
- GenericTypeParameterBuilder.cs
- Schema.cs
- Emitter.cs
- Executor.cs
- XmlReflectionImporter.cs
- GridViewSelectEventArgs.cs
- DataSourceGeneratorException.cs
- EntityDataSourceWrapperCollection.cs
- columnmapkeybuilder.cs
- GPStream.cs
- XmlSerializationWriter.cs
- InputGestureCollection.cs