Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- serverconfig.cs
- ExtenderHelpers.cs
- CalloutQueueItem.cs
- MemberListBinding.cs
- TextSelection.cs
- MultipleCopiesCollection.cs
- WebPartConnectionsConnectVerb.cs
- StorageRoot.cs
- SignatureHelper.cs
- Utils.cs
- TraceLevelStore.cs
- OperatorExpressions.cs
- TextParaLineResult.cs
- PolicyException.cs
- URIFormatException.cs
- DataServiceRequestOfT.cs
- GeneratedContractType.cs
- SqlMetaData.cs
- AuthenticationConfig.cs
- ServiceChannel.cs
- WebAdminConfigurationHelper.cs
- DeviceSpecificDialogCachedState.cs
- QilReplaceVisitor.cs
- WebConfigurationHost.cs
- OleDbSchemaGuid.cs
- TimersDescriptionAttribute.cs
- EntityReference.cs
- StorageFunctionMapping.cs
- DiagnosticsElement.cs
- PopupControlService.cs
- GridViewDeleteEventArgs.cs
- HttpCacheVaryByContentEncodings.cs
- Int64Storage.cs
- ConfigurationManager.cs
- XmlSchemaProviderAttribute.cs
- SignatureDescription.cs
- RSAPKCS1SignatureFormatter.cs
- ToolboxItemAttribute.cs
- EllipticalNodeOperations.cs
- Parsers.cs
- ContentType.cs
- HighlightComponent.cs
- MemoryFailPoint.cs
- XmlDataSourceView.cs
- FillBehavior.cs
- ServiceProviders.cs
- DataGridViewUtilities.cs
- WindowsPen.cs
- StylusEditingBehavior.cs
- WindowsGraphicsWrapper.cs
- SAPIEngineTypes.cs
- JsonWriter.cs
- TextAnchor.cs
- TlsSspiNegotiation.cs
- ThreadPool.cs
- UrlPropertyAttribute.cs
- NavigationHelper.cs
- RectAnimationClockResource.cs
- CacheMemory.cs
- DbMetaDataColumnNames.cs
- RequestBringIntoViewEventArgs.cs
- StateChangeEvent.cs
- IncrementalCompileAnalyzer.cs
- InvalidContentTypeException.cs
- FloatUtil.cs
- Drawing.cs
- XmlLinkedNode.cs
- SqlClientPermission.cs
- TabRenderer.cs
- MultiDataTrigger.cs
- Mapping.cs
- SymbolType.cs
- AnnotationHelper.cs
- ScriptResourceDefinition.cs
- DataFormats.cs
- XamlPoint3DCollectionSerializer.cs
- ItemChangedEventArgs.cs
- XamlTreeBuilderBamlRecordWriter.cs
- GridViewRowPresenterBase.cs
- ToolStripDropDownMenu.cs
- ConnectionStringEditor.cs
- CollectionViewSource.cs
- TransformGroup.cs
- HtmlInputSubmit.cs
- ToolConsole.cs
- HatchBrush.cs
- WindowVisualStateTracker.cs
- ControlParameter.cs
- ThrowOnMultipleAssignment.cs
- FormsAuthenticationTicket.cs
- DeploymentExceptionMapper.cs
- InfoCardArgumentException.cs
- _LocalDataStore.cs
- RC2.cs
- ContentIterators.cs
- _FtpDataStream.cs
- XpsS0ValidatingLoader.cs
- RegistrationServices.cs
- CapabilitiesUse.cs
- PersonalizablePropertyEntry.cs