Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Automation / Peers / SelectorAutomationPeer.cs / 1 / SelectorAutomationPeer.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 abstract class SelectorAutomationPeer : ItemsControlAutomationPeer, ISelectionProvider { /// protected SelectorAutomationPeer(Selector owner): base(owner) {} /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.List; } /// override public object GetPattern(PatternInterface patternInterface) { if(patternInterface == PatternInterface.Selection) { return this; } return base.GetPattern(patternInterface); // ItemsControlAutomationPeer support Scroll pattern } //-------------------------------------------------------------------- // // ISelectionProvider // //------------------------------------------------------------------- #region ISelectionProvider IRawElementProviderSimple [] ISelectionProvider.GetSelection() { Selector owner = (Selector)Owner; int count = owner._selectedItems.Count; if(count > 0 && ItemPeers.Count > 0) { ListselectedProviders = new List (count); for(int i=0; i AutomationInteropProvider.InvalidateLimit) { this.RaiseAutomationEvent(AutomationEvents.SelectionPatternOnInvalidated); } else { int i; for (i = 0; i < numAdded; i++) { SelectorItemAutomationPeer peer = (SelectorItemAutomationPeer)ItemPeers[e.AddedItems[i]]; if (peer != null) { peer.RaiseAutomationEvent(AutomationEvents.SelectionItemPatternOnElementAddedToSelection); } } for (i = 0; i < numRemoved; i++) { SelectorItemAutomationPeer peer = (SelectorItemAutomationPeer)ItemPeers[e.RemovedItems[i]]; if (peer != null) { peer.RaiseAutomationEvent(AutomationEvents.SelectionItemPatternOnElementRemovedFromSelection); } } } } } #endregion } } // 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 abstract class SelectorAutomationPeer : ItemsControlAutomationPeer, ISelectionProvider { /// protected SelectorAutomationPeer(Selector owner): base(owner) {} /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.List; } /// override public object GetPattern(PatternInterface patternInterface) { if(patternInterface == PatternInterface.Selection) { return this; } return base.GetPattern(patternInterface); // ItemsControlAutomationPeer support Scroll pattern } //-------------------------------------------------------------------- // // ISelectionProvider // //------------------------------------------------------------------- #region ISelectionProvider IRawElementProviderSimple [] ISelectionProvider.GetSelection() { Selector owner = (Selector)Owner; int count = owner._selectedItems.Count; if(count > 0 && ItemPeers.Count > 0) { List selectedProviders = new List (count); for(int i=0; i AutomationInteropProvider.InvalidateLimit) { this.RaiseAutomationEvent(AutomationEvents.SelectionPatternOnInvalidated); } else { int i; for (i = 0; i < numAdded; i++) { SelectorItemAutomationPeer peer = (SelectorItemAutomationPeer)ItemPeers[e.AddedItems[i]]; if (peer != null) { peer.RaiseAutomationEvent(AutomationEvents.SelectionItemPatternOnElementAddedToSelection); } } for (i = 0; i < numRemoved; i++) { SelectorItemAutomationPeer peer = (SelectorItemAutomationPeer)ItemPeers[e.RemovedItems[i]]; if (peer != null) { peer.RaiseAutomationEvent(AutomationEvents.SelectionItemPatternOnElementRemovedFromSelection); } } } } } #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
- cache.cs
- TokenizerHelper.cs
- DefaultShape.cs
- AutomationPeer.cs
- GradientStop.cs
- TableAutomationPeer.cs
- EventLogHandle.cs
- BindingUtils.cs
- PluralizationServiceUtil.cs
- HtmlInputHidden.cs
- PeerInvitationResponse.cs
- ParseNumbers.cs
- ImportCatalogPart.cs
- DescendentsWalker.cs
- SqlNodeAnnotation.cs
- ClassHandlersStore.cs
- GridItemProviderWrapper.cs
- UrlMappingsSection.cs
- ProfessionalColorTable.cs
- ByteArrayHelperWithString.cs
- KerberosSecurityTokenAuthenticator.cs
- UnsafeNativeMethods.cs
- SessionStateModule.cs
- BaseParagraph.cs
- ExecutionContext.cs
- documentation.cs
- DigitalSignatureProvider.cs
- EntityFunctions.cs
- WebPartZoneBase.cs
- UnauthorizedWebPart.cs
- ProfileServiceManager.cs
- BuildResult.cs
- TabItemAutomationPeer.cs
- ControlParameter.cs
- HMAC.cs
- PinnedBufferMemoryStream.cs
- XmlDownloadManager.cs
- CoTaskMemHandle.cs
- DetailsViewCommandEventArgs.cs
- SimpleBitVector32.cs
- PixelShader.cs
- TaskHelper.cs
- SurrogateSelector.cs
- TaskFormBase.cs
- GridProviderWrapper.cs
- autovalidator.cs
- DebugViewWriter.cs
- _BaseOverlappedAsyncResult.cs
- Point3DCollection.cs
- RegionIterator.cs
- InertiaExpansionBehavior.cs
- WebBrowserHelper.cs
- FontStretches.cs
- RuntimeConfigLKG.cs
- ProxyElement.cs
- SimpleHandlerBuildProvider.cs
- ObjectSecurity.cs
- XmlQueryType.cs
- CachedFontFace.cs
- RoleBoolean.cs
- TextEvent.cs
- Message.cs
- PathSegment.cs
- TitleStyle.cs
- SamlSubject.cs
- glyphs.cs
- DrawingBrush.cs
- ConfigXmlAttribute.cs
- DPCustomTypeDescriptor.cs
- TransformProviderWrapper.cs
- SqlCacheDependencySection.cs
- DataGridViewButtonCell.cs
- TextRangeBase.cs
- SvcMapFileSerializer.cs
- XmlExtensionFunction.cs
- GeneralTransform3DTo2D.cs
- PassportPrincipal.cs
- AuthStoreRoleProvider.cs
- NonDualMessageSecurityOverHttpElement.cs
- MasterPageCodeDomTreeGenerator.cs
- ComPlusTypeValidator.cs
- ProjectionCamera.cs
- LineBreakRecord.cs
- Transform3DGroup.cs
- ChtmlCommandAdapter.cs
- NativeActivityContext.cs
- ReferencedType.cs
- ApplicationFileCodeDomTreeGenerator.cs
- DataPager.cs
- FormsIdentity.cs
- LiteralControl.cs
- CatalogPart.cs
- Color.cs
- TraceHandlerErrorFormatter.cs
- VectorCollection.cs
- MethodCallConverter.cs
- RequestTimeoutManager.cs
- FederatedMessageSecurityOverHttp.cs
- IApplicationTrustManager.cs
- WebPartTransformerCollection.cs