Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / ListBoxItemAutomationPeer.cs / 1305600 / ListBoxItemAutomationPeer.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
using System.Windows;
using System.Windows.Automation.Provider;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Interop;
using System.Windows.Media;
using MS.Internal;
using MS.Win32;
namespace System.Windows.Automation.Peers
{
///
public class ListBoxItemAutomationPeer : SelectorItemAutomationPeer, IScrollItemProvider
{
///
public ListBoxItemAutomationPeer(object owner, SelectorAutomationPeer selectorAutomationPeer)
: base(owner, selectorAutomationPeer)
{
}
///
override protected string GetClassNameCore()
{
return "ListBoxItem";
}
///
override protected AutomationControlType GetAutomationControlTypeCore()
{
return AutomationControlType.ListItem;
}
///
override public object GetPattern(PatternInterface patternInterface)
{
if (patternInterface == PatternInterface.ScrollItem)
{
return this;
}
return base.GetPattern(patternInterface);
}
///For ComboBoxItem for which peer is this element only, scrolling should happen when the pop-up is expanded.
internal override void RealizeCore()
{
ComboBox parent = ItemsControlAutomationPeer.Owner as ComboBox;
if (parent != null)
{
IExpandCollapseProvider iecp = (IExpandCollapseProvider)UIElementAutomationPeer.FromElement(parent) as ComboBoxAutomationPeer;
if (iecp.ExpandCollapseState != ExpandCollapseState.Expanded)
iecp.Expand();
}
base.RealizeCore();
}
void IScrollItemProvider.ScrollIntoView()
{
ListBox parent = ItemsControlAutomationPeer.Owner as ListBox;
if (parent != null)
parent.ScrollIntoView(Item);
else
{
ComboBoxAutomationPeer parentPeer = ItemsControlAutomationPeer as ComboBoxAutomationPeer;
if(parentPeer != null)
parentPeer.ScrollItemIntoView(Item);
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
using System.Windows;
using System.Windows.Automation.Provider;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Interop;
using System.Windows.Media;
using MS.Internal;
using MS.Win32;
namespace System.Windows.Automation.Peers
{
///
public class ListBoxItemAutomationPeer : SelectorItemAutomationPeer, IScrollItemProvider
{
///
public ListBoxItemAutomationPeer(object owner, SelectorAutomationPeer selectorAutomationPeer)
: base(owner, selectorAutomationPeer)
{
}
///
override protected string GetClassNameCore()
{
return "ListBoxItem";
}
///
override protected AutomationControlType GetAutomationControlTypeCore()
{
return AutomationControlType.ListItem;
}
///
override public object GetPattern(PatternInterface patternInterface)
{
if (patternInterface == PatternInterface.ScrollItem)
{
return this;
}
return base.GetPattern(patternInterface);
}
///For ComboBoxItem for which peer is this element only, scrolling should happen when the pop-up is expanded.
internal override void RealizeCore()
{
ComboBox parent = ItemsControlAutomationPeer.Owner as ComboBox;
if (parent != null)
{
IExpandCollapseProvider iecp = (IExpandCollapseProvider)UIElementAutomationPeer.FromElement(parent) as ComboBoxAutomationPeer;
if (iecp.ExpandCollapseState != ExpandCollapseState.Expanded)
iecp.Expand();
}
base.RealizeCore();
}
void IScrollItemProvider.ScrollIntoView()
{
ListBox parent = ItemsControlAutomationPeer.Owner as ListBox;
if (parent != null)
parent.ScrollIntoView(Item);
else
{
ComboBoxAutomationPeer parentPeer = ItemsControlAutomationPeer as ComboBoxAutomationPeer;
if(parentPeer != null)
parentPeer.ScrollItemIntoView(Item);
}
}
}
}
// 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
- HttpProtocolImporter.cs
- TransformerConfigurationWizardBase.cs
- LiteralControl.cs
- MediaElementAutomationPeer.cs
- TypedDataSourceCodeGenerator.cs
- ImplicitInputBrush.cs
- TextBreakpoint.cs
- DiscreteKeyFrames.cs
- UserControl.cs
- ColorTypeConverter.cs
- Point3DIndependentAnimationStorage.cs
- ConnectionsZone.cs
- columnmapkeybuilder.cs
- serverconfig.cs
- NetMsmqBindingCollectionElement.cs
- SqlConnection.cs
- ActivityExecutorDelegateInfo.cs
- StateMachineTimers.cs
- WindowsImpersonationContext.cs
- PropertyValueUIItem.cs
- ImmutablePropertyDescriptorGridEntry.cs
- DateTimeSerializationSection.cs
- InfoCardX509Validator.cs
- mongolianshape.cs
- ViewKeyConstraint.cs
- DynamicDocumentPaginator.cs
- AspNetHostingPermission.cs
- ActivityCodeGenerator.cs
- FixedFindEngine.cs
- HtmlGenericControl.cs
- Maps.cs
- DocumentSchemaValidator.cs
- ExtenderHelpers.cs
- TreeViewItem.cs
- ResourceExpressionEditor.cs
- Validator.cs
- PaintEvent.cs
- FormattedTextSymbols.cs
- RequiredFieldValidator.cs
- MiniParameterInfo.cs
- GC.cs
- TablePatternIdentifiers.cs
- SystemIPv6InterfaceProperties.cs
- LogWriteRestartAreaAsyncResult.cs
- ToolStripProgressBar.cs
- ContextInformation.cs
- StackSpiller.Generated.cs
- TypeLoadException.cs
- IPipelineRuntime.cs
- HistoryEventArgs.cs
- OracleParameter.cs
- RightsManagementEncryptionTransform.cs
- Visual3D.cs
- TransformerInfo.cs
- ExternalException.cs
- AsymmetricSignatureFormatter.cs
- MinimizableAttributeTypeConverter.cs
- RelationshipConstraintValidator.cs
- EntitySetDataBindingList.cs
- ToolStripManager.cs
- ProfileSettings.cs
- LinkConverter.cs
- SymmetricCryptoHandle.cs
- IisTraceListener.cs
- SharedPerformanceCounter.cs
- TypeConverter.cs
- SessionEndedEventArgs.cs
- WindowsStatic.cs
- HttpCookieCollection.cs
- HtmlInputCheckBox.cs
- PingOptions.cs
- ListSortDescriptionCollection.cs
- CompletedAsyncResult.cs
- TransformedBitmap.cs
- GridViewRowPresenter.cs
- RowToFieldTransformer.cs
- SafeEventHandle.cs
- TemplatedControlDesigner.cs
- XpsS0ValidatingLoader.cs
- FocusTracker.cs
- RemotingConfigParser.cs
- SecurityContext.cs
- CreateDataSourceDialog.cs
- FacetChecker.cs
- AssertUtility.cs
- DragStartedEventArgs.cs
- PropertyDescriptorCollection.cs
- TimeoutHelper.cs
- CodeVariableReferenceExpression.cs
- EndpointDesigner.cs
- ApplicationTrust.cs
- IfJoinedCondition.cs
- Lease.cs
- AuthenticateEventArgs.cs
- DynamicILGenerator.cs
- DataSourceExpression.cs
- XamlTypeMapper.cs
- PeerContact.cs
- XhtmlBasicTextBoxAdapter.cs
- SafeNativeMethods.cs