Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- ArraySet.cs
- NumberSubstitution.cs
- DbConnectionStringCommon.cs
- metadatamappinghashervisitor.cs
- SqlTypesSchemaImporter.cs
- StringFreezingAttribute.cs
- BinaryMethodMessage.cs
- XmlCharCheckingReader.cs
- StandardTransformFactory.cs
- IndexingContentUnit.cs
- ToggleProviderWrapper.cs
- CngProvider.cs
- SynchronizationHandlesCodeDomSerializer.cs
- CodeAttachEventStatement.cs
- ConfigurationCollectionAttribute.cs
- RadioButton.cs
- ThicknessAnimationUsingKeyFrames.cs
- Page.cs
- AsyncPostBackTrigger.cs
- LoadGrammarCompletedEventArgs.cs
- WebEncodingValidator.cs
- XmlMapping.cs
- Point3DKeyFrameCollection.cs
- AstNode.cs
- SQLMoneyStorage.cs
- MimeXmlReflector.cs
- ButtonColumn.cs
- InstanceView.cs
- CodeTypeReferenceSerializer.cs
- DesignerDataConnection.cs
- WebSysDescriptionAttribute.cs
- CodeDOMUtility.cs
- ToolStripDropTargetManager.cs
- LogReserveAndAppendState.cs
- OdbcException.cs
- PolyLineSegment.cs
- XmlRawWriter.cs
- ThreadStartException.cs
- FunctionImportMapping.cs
- InputReport.cs
- FormViewDeletedEventArgs.cs
- XmlDomTextWriter.cs
- MembershipSection.cs
- Transform.cs
- ParserExtension.cs
- SyndicationElementExtension.cs
- RoutingConfiguration.cs
- AssemblyLoader.cs
- hresults.cs
- CodeDomConfigurationHandler.cs
- DataGridViewTextBoxEditingControl.cs
- ConfigurationPropertyAttribute.cs
- GroupBoxAutomationPeer.cs
- Processor.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- TypeDescriptor.cs
- CodeMemberProperty.cs
- NonVisualControlAttribute.cs
- ActivityMarkupSerializationProvider.cs
- ControlDesigner.cs
- FileUtil.cs
- SortFieldComparer.cs
- IndexedString.cs
- XsltSettings.cs
- COSERVERINFO.cs
- PreDigestedSignedInfo.cs
- SmiMetaData.cs
- EnumMemberAttribute.cs
- ISessionStateStore.cs
- MarginCollapsingState.cs
- TextBox.cs
- IteratorFilter.cs
- DataBindingCollection.cs
- _ScatterGatherBuffers.cs
- _Rfc2616CacheValidators.cs
- _LocalDataStore.cs
- CodeParameterDeclarationExpression.cs
- SourceExpressionException.cs
- Configuration.cs
- SmiContextFactory.cs
- DbTransaction.cs
- ThreadStateException.cs
- SessionEndingCancelEventArgs.cs
- XmlDocumentSerializer.cs
- ErrorFormatter.cs
- RNGCryptoServiceProvider.cs
- SystemIPInterfaceProperties.cs
- SafeFileMapViewHandle.cs
- SendMailErrorEventArgs.cs
- GetUserPreferenceRequest.cs
- CalendarDay.cs
- CalendarDateChangedEventArgs.cs
- CachedTypeface.cs
- AsyncResult.cs
- FormViewPagerRow.cs
- Oid.cs
- WebAdminConfigurationHelper.cs
- ActivityCollectionMarkupSerializer.cs
- InkCanvas.cs
- OptimalBreakSession.cs