public void RaisePropertyChangedEvent (AutomationPeer peer, AutomationProperty property, object oldValue, object newValue) { if (!AccessibilityEnabled || peer == null) return; if (object.Equals (newValue, oldValue)) return; // We are going to raise changes only when the value ACTUALLY CHANGES IAutomationCacheProperty cachedProperty = peer.GetCachedProperty (property); if (cachedProperty != null) { if (object.Equals (newValue, cachedProperty.OldValue)) return; cachedProperty.OldValue = newValue; } if (AutomationPropertyChanged != null) AutomationPropertyChanged (this, new AutomationPropertyChangedEventArgs (peer, property, oldValue, newValue)); }
public Calendar (Adapter adapter, AutomationPeer peer) : base (adapter, peer) { FrameworkElementAutomationPeer feap = peer as FrameworkElementAutomationPeer; if (feap == null) return; // XXX: We can't link to System.Windows.Controls, so // we'll use reflection instead. UIElement calendar = feap.Owner; Type t = calendar.GetType (); if (t.Namespace != "System.Windows.Controls" || t.Name != "Calendar") return; // XXX SUCH A HACK! XXX // Workaround a bug in CalendarAutomationPeer. // Even though its selection and NameProperty // change, it does not send the proper change // notifications via the peer. So we fake them. EventInfo ei = t.GetEvent ("SelectedDatesChanged"); ei.AddEventHandler (calendar, new EventHandler<SelectionChangedEventArgs> (OnSelectedDatesChanged)); }
public ExpandCollapseInvokeToggle (Adapter adapter, AutomationPeer peer) : base (adapter, peer) { adapter.AutomationPropertyChanged += new EventHandler<AutomationPropertyChangedEventArgs> ( OnAutomationPropertyChanged); }
public RadioButton (Adapter adapter, AutomationPeer peer) : base (adapter, peer) { adapter.AutomationPropertyChanged += new EventHandler<AutomationPropertyChangedEventArgs> ( OnAutomationPropertyChanged); }
public GridTable (Adapter adapter, AutomationPeer peer) : base (adapter, peer) { this.peer = peer; this.tableProvider = (ITableProvider) peer.GetPattern ( PatternInterface.Table); }
public BaseActionImplementor (Adapter adapter, AutomationPeer peer) : base (adapter, peer) { // TODO: also do this in response to patterns being // added/removed RefreshActions (); }
public void RaiseAutomationEvent (AutomationPeer peer, AutomationEvents eventId) { if (!AccessibilityEnabled || peer == null) return; if (AutomationEventRaised != null) AutomationEventRaised (this, new AutomationEventEventArgs (peer, eventId)); }
// Private ctor called from two public, static accessors private CategoryContainerAutomationPeer(CiderCategoryContainer container, AutomationPeer itemPeer) { Fx.Assert(container != null, "CategoryContainer not specified."); Fx.Assert(itemPeer != null, "CategoryContainerItemAutomationPeer not specified."); _container = container; _itemAutomationPeer = itemPeer; }
public RangeValue (Adapter adapter, AutomationPeer peer) : base (adapter, peer) { this.rangeValueProvider = (IRangeValueProvider) peer.GetPattern ( PatternInterface.RangeValue); adapter.AutomationPropertyChanged += new EventHandler<AutomationPropertyChangedEventArgs> ( OnAutomationPropertyChanged); }
public Selection (Adapter adapter, AutomationPeer peer) : base (adapter, peer) { this.selectionProvider = (ISelectionProvider) peer.GetPattern ( PatternInterface.Selection); adapter.AutomationPropertyChanged += (o, args) => { if (args.Property == SelectionPatternIdentifiers.SelectionProperty) adapter.EmitSignal ("selection_changed"); }; }
//------------------------------------------------------ // // Constructors // //------------------------------------------------------ #region Constructors // private ctor - the Wrap() pseudo-ctor is used instead. private ElementProxy(AutomationPeer peer) { if ((AutomationInteropReferenceType == ReferenceType.Weak) && (peer is UIElementAutomationPeer || peer is ContentElementAutomationPeer || peer is UIElement3DAutomationPeer)) { _peer = new WeakReference(peer); } else { _peer = peer; } }
//------------------------------------------------------------------- // // Constructors // //------------------------------------------------------------------- #region Constructors /// <summary> /// Constructor /// </summary> /// <param name="textPeer">Automation Peer representing element for the ui scope of the text</param> /// <param name="textContainer">ITextContainer</param> internal TextAdaptor(AutomationPeer textPeer, ITextContainer textContainer) { Invariant.Assert(textContainer != null, "Invalid ITextContainer"); Invariant.Assert(textPeer is TextAutomationPeer || textPeer is ContentTextAutomationPeer, "Invalid AutomationPeer"); _textPeer = textPeer; _textContainer = textContainer; _textContainer.Changed += new TextContainerChangedEventHandler(OnTextContainerChanged); if (_textContainer.TextSelection != null) { _textContainer.TextSelection.Changed += new EventHandler(OnTextSelectionChanged); } }
internal static new object GetSupportedPropertyValueInternal(AutomationPeer itemPeer, int propertyId) { if (SelectionItemPatternIdentifiers.IsSelectedProperty.Id == propertyId) { ISelectionItemProvider selectionItem = itemPeer.GetPattern(PatternInterface.SelectionItem) as ISelectionItemProvider; if (selectionItem != null) return selectionItem.IsSelected; else return null; } return ItemsControlAutomationPeer.GetSupportedPropertyValueInternal(itemPeer, propertyId); }
public SelectionItem (Adapter adapter, AutomationPeer peer) : base (adapter, peer) { bool? isSelected = IsSelected; if (isSelected.HasValue) WasSelected = isSelected.Value; adapter.AutomationPropertyChanged += new EventHandler<AutomationPropertyChangedEventArgs> ( OnAutomationPropertyChanged); adapter.AutomationEventRaised += new EventHandler<AutomationEventEventArgs> ( OnAutomationEventRaised); }
internal InteropAutomationProvider(HostedWindowWrapper wrapper, AutomationPeer parent) { if (wrapper == null) { throw new ArgumentNullException("wrapper"); } if (parent == null) { throw new ArgumentNullException("parent"); } _wrapper = wrapper; _parent = parent; }
/// <summary> /// AutomationPeer for an item in a DataGrid /// </summary> public DataGridItemAutomationPeer(object item, DataGrid dataGrid) : base() { if (item == null) { throw new ArgumentNullException("item"); } if (dataGrid == null) { throw new ArgumentNullException("dataGrid"); } _item = item; _dataGridAutomationPeer = FrameworkElementAutomationPeer.CreatePeerForElement(dataGrid); }
private static bool TryInvokePatternAutomation(AutomationPeer peer) { var pattern = peer.GetPattern(PatternInterface.Invoke) as IInvokeProvider; if (pattern == null) return false; try { pattern.Invoke(); } catch (Exception exception) { throw new TestAutomationException("Exception while invoking pattern", exception); } return true; }
/// <summary> /// AutomationPeer for a group of items in a DataGrid /// </summary> public DataGridGroupItemAutomationPeer(CollectionViewGroup group, DataGrid dataGrid) : base(dataGrid) { if (group == null) { // throw new ElementNotAvailableException(); } if (dataGrid == null) { // throw new ElementNotAvailableException(); } _group = group; _dataGridAutomationPeer = FrameworkElementAutomationPeer.CreatePeerForElement(dataGrid); }
/// <summary> /// AutomationPeer for an item in a DataGrid /// </summary> public DataGridItemAutomationPeer(object item, DataGrid dataGrid) : base(dataGrid) { if (item == null) { // throw new ElementNotAvailableException(); } if (dataGrid == null) { // throw new ElementNotAvailableException(); } _item = item; _dataGridAutomationPeer = FrameworkElementAutomationPeer.CreatePeerForElement(dataGrid); }
/// <summary> /// Retrieves a UI automation provider for each child element that is /// selected. /// </summary> /// <returns>An array of UI automation providers.</returns> /// <remarks> /// This API supports the .NET Framework infrastructure and is not /// intended to be used directly from your code. /// </remarks> IRawElementProviderSimple[] ISelectionProvider.GetSelection() { if (OwnerAutoCompleteBox.SelectionAdapter != null) { object selectedItem = OwnerAutoCompleteBox.SelectionAdapter.SelectedItem; if (selectedItem != null) { var uie = selectedItem as UIElement; if (uie != null) { AutomationPeer peer = CreatePeerForElement(uie); if (peer != null) { return(new[] { ProviderFromPeer(peer) }); } } } } return(new IRawElementProviderSimple[] {}); }
IRawElementProviderSimple[] ITableItemProvider.GetRowHeaderItems() { if (this.OwningDataGrid != null && (this.OwningDataGrid.HeadersVisibility & DataGridHeadersVisibility.Row) == DataGridHeadersVisibility.Row) { DataGridAutomationPeer dataGridAutomationPeer = UIElementAutomationPeer.CreatePeerForElement(this.OwningDataGrid) as DataGridAutomationPeer; DataGridItemAutomationPeer dataGridItemAutomationPeer = dataGridAutomationPeer.FindOrCreateItemAutomationPeer(Item) as DataGridItemAutomationPeer; if (dataGridItemAutomationPeer != null) { AutomationPeer rowHeaderAutomationPeer = dataGridItemAutomationPeer.RowHeaderAutomationPeer; if (rowHeaderAutomationPeer != null) { List <IRawElementProviderSimple> providers = new List <IRawElementProviderSimple>(1); providers.Add(ProviderFromPeer(rowHeaderAutomationPeer)); return(providers.ToArray()); } } } return(null); }
IRawElementProviderSimple[] ITableItemProvider.GetColumnHeaderItems() { if (this.OwningDataGrid != null && (this.OwningDataGrid.HeadersVisibility & DataGridHeadersVisibility.Column) == DataGridHeadersVisibility.Column && this.OwningDataGrid.ColumnHeadersPresenter != null) { DataGridColumnHeadersPresenterAutomationPeer columnHeadersPresenterPeer = UIElementAutomationPeer.CreatePeerForElement(this.OwningDataGrid.ColumnHeadersPresenter) as DataGridColumnHeadersPresenterAutomationPeer; if (columnHeadersPresenterPeer != null) { AutomationPeer dataGridColumnHeaderPeer = columnHeadersPresenterPeer.FindOrCreateItemAutomationPeer(_column); if (dataGridColumnHeaderPeer != null) { List <IRawElementProviderSimple> providers = new List <IRawElementProviderSimple>(1); providers.Add(ProviderFromPeer(dataGridColumnHeaderPeer)); return(providers.ToArray()); } } } return(null); }
private static void AddAutomationPeer(List <AutomationPeer> children, UIElement child) { if (child != null) { AutomationPeer peer = FromElement(child); if (peer == null) { peer = CreatePeerForElement(child); } if (peer != null) { // In the array that GetChildrenCore returns, which is used by AutomationPeer.EnsureChildren, // no null entries are allowed or a NullReferenceException will be thrown from the guts of WPF. // This has reproducibly been observed null on certain systems so the null check was added. // This may mean that some child controls are missing for automation, but at least the // application doesn't crash in normal usage. children.Add(peer); } } }
internal static void RaiseAsyncContentLoadedEvent(AutomationPeer peer, long bytesRead, long maxBytes) { double percentComplete = 0d; AsyncContentLoadedState asyncContentState = AsyncContentLoadedState.Beginning; if (bytesRead > 0) { if (bytesRead < maxBytes) { percentComplete = maxBytes > 0 ? (bytesRead * 100d / maxBytes) : 0; asyncContentState = AsyncContentLoadedState.Progress; } else { percentComplete = 100d; asyncContentState = AsyncContentLoadedState.Completed; } } peer.RaiseAsyncContentLoadedEvent(new AsyncContentLoadedEventArgs(asyncContentState, percentComplete)); }
/// <summary>Returns a collection of UI Automation providers that represents all the column headers in a table.</summary> /// <returns>A collection of UI Automation providers.</returns> // Token: 0x060026B0 RID: 9904 RVA: 0x000B7B94 File Offset: 0x000B5D94 IRawElementProviderSimple[] ITableProvider.GetColumnHeaders() { if (this._owner.HeaderRowPresenter != null) { List <IRawElementProviderSimple> list = new List <IRawElementProviderSimple>(this._owner.HeaderRowPresenter.ActualColumnHeaders.Count); ListViewAutomationPeer listViewAutomationPeer = UIElementAutomationPeer.FromElement(this._listview) as ListViewAutomationPeer; if (listViewAutomationPeer != null) { foreach (UIElement element in this._owner.HeaderRowPresenter.ActualColumnHeaders) { AutomationPeer automationPeer = UIElementAutomationPeer.CreatePeerForElement(element); if (automationPeer != null) { list.Add(ElementProxy.StaticWrap(automationPeer, listViewAutomationPeer)); } } } return(list.ToArray()); } return(new IRawElementProviderSimple[0]); }
protected override List <AutomationPeer> GetChildrenCore() { List <AutomationPeer> children = base.GetChildrenCore(); DataGridColumnHeadersPresenter columnsHeaderPresenter = this.OwningDataGrid.ColumnHeadersPresenter; // Add ColumnsHeaderPresenter if it is visible if (columnsHeaderPresenter != null && columnsHeaderPresenter.IsVisible) { AutomationPeer columnsHeaderPresenterPeer = FrameworkElementAutomationPeer.CreatePeerForElement(columnsHeaderPresenter); if (columnsHeaderPresenterPeer != null) { if (children == null) { children = new List <AutomationPeer>(1); } children.Insert(0, columnsHeaderPresenterPeer); } } return(children); }
/// <summary>Retrieves a collection of UI Automation providers that represents all row headers in the table.</summary> /// <returns>A collection of UI Automation providers.</returns> // Token: 0x06002575 RID: 9589 RVA: 0x000B4284 File Offset: 0x000B2484 IRawElementProviderSimple[] ITableProvider.GetRowHeaders() { if ((this.OwningDataGrid.HeadersVisibility & DataGridHeadersVisibility.Row) == DataGridHeadersVisibility.Row) { List <IRawElementProviderSimple> list = new List <IRawElementProviderSimple>(); foreach (object item in ((IEnumerable)this.OwningDataGrid.Items)) { DataGridItemAutomationPeer dataGridItemAutomationPeer = this.FindOrCreateItemAutomationPeer(item) as DataGridItemAutomationPeer; AutomationPeer rowHeaderAutomationPeer = dataGridItemAutomationPeer.RowHeaderAutomationPeer; if (rowHeaderAutomationPeer != null) { list.Add(base.ProviderFromPeer(rowHeaderAutomationPeer)); } } if (list.Count > 0) { return(list.ToArray()); } } return(null); }
/// <summary> /// Returns the text label of the GlobalCalendarButton that is associated with /// this GlobalCalendarButtonAutomationPeer. This method is called by GetName. /// </summary> /// <returns> /// The text label of the element that is associated with this /// automation peer. /// </returns> /// <remarks> /// The name property can be thought of as the string of text that a /// user would use to explain which control is being referred to. It is /// important to have a textual representation for all controls in the /// graphical user interface (GUI) so that you can programmatically /// refer to the control in a localized manner. The value is settable /// on control instances through the AutomationProperties.Name attached /// property. /// </remarks> protected override string GetNameCore() { string name = base.GetNameCore(); if (string.IsNullOrEmpty(name)) { AutomationPeer labeledBy = GetLabeledByCore(); if (labeledBy != null) { name = labeledBy.GetName(); } if (string.IsNullOrEmpty(name) && OwningCalendarButton.Content != null) { name = string.Format( OwningCalendar.Info.DateFormatInfo, OwningCalendarButton.Content.ToString()); } } return(name); }
internal static void RaiseAsyncContentLoadedEvent(AutomationPeer peer, long bytesRead, long maxBytes) { double percentComplete = 0d; AsyncContentLoadedState asyncContentState = AsyncContentLoadedState.Beginning; if (bytesRead > 0) { if (bytesRead < maxBytes) { percentComplete = maxBytes > 0 ? (bytesRead * 100d / maxBytes) : 0; asyncContentState = AsyncContentLoadedState.Progress; } else { percentComplete = 100d; asyncContentState = AsyncContentLoadedState.Completed; } } peer.RaiseAsyncContentLoadedEvent(new AsyncContentLoadedEventArgs(asyncContentState, percentComplete)); }
// Token: 0x0600257B RID: 9595 RVA: 0x000B44A0 File Offset: 0x000B26A0 internal void RaiseAutomationSelectionEvents(SelectionChangedEventArgs e) { int count = this.OwningDataGrid.SelectedItems.Count; int count2 = e.AddedItems.Count; if (AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementSelected) && count == 1 && count2 == 1) { ItemAutomationPeer itemAutomationPeer = this.FindOrCreateItemAutomationPeer(this.OwningDataGrid.SelectedItem); if (itemAutomationPeer != null) { itemAutomationPeer.RaiseAutomationEvent(AutomationEvents.SelectionItemPatternOnElementSelected); return; } } else { if (AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementAddedToSelection)) { for (int i = 0; i < e.AddedItems.Count; i++) { ItemAutomationPeer itemAutomationPeer2 = this.FindOrCreateItemAutomationPeer(e.AddedItems[i]); if (itemAutomationPeer2 != null) { itemAutomationPeer2.RaiseAutomationEvent(AutomationEvents.SelectionItemPatternOnElementAddedToSelection); } } } if (AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementRemovedFromSelection)) { for (int i = 0; i < e.RemovedItems.Count; i++) { ItemAutomationPeer itemAutomationPeer3 = this.FindOrCreateItemAutomationPeer(e.RemovedItems[i]); if (itemAutomationPeer3 != null) { itemAutomationPeer3.RaiseAutomationEvent(AutomationEvents.SelectionItemPatternOnElementRemovedFromSelection); } } } } }
/// protected override List <AutomationPeer> GetChildrenCore() { // see whether the DataGridRow uses the standard control template DataGridCellsPresenter cellsPresenter = OwningDataGridRow.CellsPresenter; if (cellsPresenter != null && cellsPresenter.ItemsHost != null) { // this is the normal case List <AutomationPeer> children = new List <AutomationPeer>(3); // Step 1: Add row header if exists AutomationPeer dataGridRowHeaderAutomationPeer = RowHeaderAutomationPeer; if (dataGridRowHeaderAutomationPeer != null) { children.Add(dataGridRowHeaderAutomationPeer); } // Step 2: Add all cells DataGridItemAutomationPeer itemPeer = this.EventsSource as DataGridItemAutomationPeer; if (itemPeer != null) { children.AddRange(itemPeer.GetCellItemPeers()); } // Step 3: Add DetailsPresenter last if exists AutomationPeer dataGridDetailsPresenterAutomationPeer = DetailsPresenterAutomationPeer; if (dataGridDetailsPresenterAutomationPeer != null) { children.Add(dataGridDetailsPresenterAutomationPeer); } return(children); } else { // in the unusual case where the app uses a non-standard control template // for the DataGridRow, fall back to the base implementation return(base.GetChildrenCore()); } }
/// <summary>Retrieves a collection of UI Automation providers that represent all the column headers associated with a table item or cell.</summary> /// <returns>A collection of UI Automation providers.</returns> // Token: 0x060026D3 RID: 9939 RVA: 0x000B80DC File Offset: 0x000B62DC IRawElementProviderSimple[] ITableItemProvider.GetColumnHeaderItems() { ListView listView = this._listviewAP.Owner as ListView; if (listView != null && listView.View is GridView) { GridView gridView = listView.View as GridView; if (gridView.HeaderRowPresenter != null && gridView.HeaderRowPresenter.ActualColumnHeaders.Count > this.Column) { GridViewColumnHeader element = gridView.HeaderRowPresenter.ActualColumnHeaders[this.Column]; AutomationPeer automationPeer = UIElementAutomationPeer.FromElement(element); if (automationPeer != null) { return(new IRawElementProviderSimple[] { base.ProviderFromPeer(automationPeer) }); } } } return(new IRawElementProviderSimple[0]); }
// Token: 0x06002707 RID: 9991 RVA: 0x000B8B2C File Offset: 0x000B6D2C internal virtual AutomationPeer GetWrapperPeer() { AutomationPeer automationPeer = null; UIElement wrapper = this.GetWrapper(); if (wrapper != null) { automationPeer = UIElementAutomationPeer.CreatePeerForElement(wrapper); if (automationPeer == null) { if (wrapper is FrameworkElement) { automationPeer = new FrameworkElementAutomationPeer((FrameworkElement)wrapper); } else { automationPeer = new UIElementAutomationPeer(wrapper); } } } return(automationPeer); }
/// <summary> /// Gets text that describes the DataPager that is associated with this automation peer. /// Called by System.Windows.Automation.Peers.AutomationPeer.GetName(). /// </summary> /// <returns> /// When the control is not paging data: /// - Value returned by the base implementation if it's not empty /// - Name of the owning DataPager control if it's not empty /// - Name returned by the LabeledBy automation peer if it's not empty /// - DataPager class name if none of the above is valid /// When the control is paging data: /// - "Page N" when the total page count is unknown /// - "Page N of M" when the count is known /// </returns> protected override string GetNameCore() { if (this.OwningDataPager.Source == null || this.OwningDataPager.PageSize == 0) { string name = base.GetNameCore(); if (string.IsNullOrEmpty(name)) { name = this.OwningDataPager.Name; } if (string.IsNullOrEmpty(name)) { AutomationPeer labeledByAutomationPeer = this.GetLabeledByCore(); if (labeledByAutomationPeer != null) { name = labeledByAutomationPeer.GetName(); } } if (string.IsNullOrEmpty(name)) { name = this.GetClassNameCore(); } return(name); } if (this.OwningDataPager.PagedSource != null && this.OwningDataPager.PagedSource.TotalItemCount == -1) { // Returns "Page M" return(string.Format( CultureInfo.InvariantCulture, PagerResources3.AutomationPeerName_TotalPageCountUnknown, (this.OwningDataPager.PageIndex + 1).ToString(CultureInfo.CurrentCulture))); } // Returns "Page M of N" return(string.Format( CultureInfo.InvariantCulture, PagerResources3.AutomationPeerName_TotalPageCountKnown, (this.OwningDataPager.PageIndex + 1).ToString(CultureInfo.CurrentCulture), this.OwningDataPager.PageCount.ToString(CultureInfo.CurrentCulture))); }
/// override public object GetPattern(PatternInterface patternInterface) { if (patternInterface == PatternInterface.Selection) { return(this); } else if (patternInterface == PatternInterface.Scroll) { ItemsControl owner = (ItemsControl)Owner; if (owner.ScrollHost != null) { AutomationPeer scrollPeer = UIElementAutomationPeer.CreatePeerForElement(owner.ScrollHost); if (scrollPeer != null && scrollPeer is IScrollProvider) { scrollPeer.EventsSource = this; return((IScrollProvider)scrollPeer); } } } return(base.GetPattern(patternInterface)); }
/// <summary> /// Raise selection AutomationEvents when the GlobalCalendar's SelectedDates /// collection changes. /// </summary> /// <param name="e">Event arguments.</param> internal void RaiseSelectionEvents(SelectionChangedEventArgs e) { GlobalCalendar calendar = OwningCalendar; int selectedDates = calendar.SelectedDates.Count; if (AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementSelected) && selectedDates == 1) { RaiseDayButtonSelectionEvent( calendar, (DateTime)e.AddedItems[0], AutomationEvents.SelectionItemPatternOnElementSelected); } else { if (AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementAddedToSelection)) { foreach (DateTime date in e.AddedItems) { RaiseDayButtonSelectionEvent( calendar, date, AutomationEvents.SelectionItemPatternOnElementAddedToSelection); } } if (AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementRemovedFromSelection)) { foreach (DateTime date in e.RemovedItems) { RaiseDayButtonSelectionEvent( calendar, date, AutomationEvents.SelectionItemPatternOnElementRemovedFromSelection); } } } }
// Token: 0x06002530 RID: 9520 RVA: 0x000B3504 File Offset: 0x000B1704 internal void RaiseSelectionEvents(SelectionChangedEventArgs e) { int count = this.OwningCalendar.SelectedDates.Count; int count2 = e.AddedItems.Count; if (AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementSelected) && count == 1 && count2 == 1) { DateTimeAutomationPeer orCreateDateTimeAutomationPeer = this.GetOrCreateDateTimeAutomationPeer((DateTime)e.AddedItems[0], CalendarMode.Month); if (orCreateDateTimeAutomationPeer != null) { orCreateDateTimeAutomationPeer.RaiseAutomationEvent(AutomationEvents.SelectionItemPatternOnElementSelected); } } else if (AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementAddedToSelection)) { foreach (object obj in e.AddedItems) { DateTime date = (DateTime)obj; DateTimeAutomationPeer orCreateDateTimeAutomationPeer2 = this.GetOrCreateDateTimeAutomationPeer(date, CalendarMode.Month); if (orCreateDateTimeAutomationPeer2 != null) { orCreateDateTimeAutomationPeer2.RaiseAutomationEvent(AutomationEvents.SelectionItemPatternOnElementAddedToSelection); } } } if (AutomationPeer.ListenerExists(AutomationEvents.SelectionItemPatternOnElementRemovedFromSelection)) { foreach (object obj2 in e.RemovedItems) { DateTime date2 = (DateTime)obj2; DateTimeAutomationPeer orCreateDateTimeAutomationPeer3 = this.GetOrCreateDateTimeAutomationPeer(date2, CalendarMode.Month); if (orCreateDateTimeAutomationPeer3 != null) { orCreateDateTimeAutomationPeer3.RaiseAutomationEvent(AutomationEvents.SelectionItemPatternOnElementRemovedFromSelection); } } } }
//------------------------------------------------------ // // Constructors // //------------------------------------------------------ #region Constructors private MultipleViewProviderWrapper( AutomationPeer peer, IMultipleViewProvider iface ) { _peer = peer; _iface = iface; }
//------------------------------------------------------ // // Constructors // //------------------------------------------------------ #region Constructors private VirtualizedItemProviderWrapper(AutomationPeer peer, IVirtualizedItemProvider iface) { _peer = peer; _iface = iface; }
//------------------------------------------------------ // // Internal Methods // //------------------------------------------------------ #region Internal Methods internal static object Wrap(AutomationPeer peer, object iface) { return new VirtualizedItemProviderWrapper(peer, (IVirtualizedItemProvider)iface); }
//------------------------------------------------------ // // Internal Methods // //------------------------------------------------------ #region Internal Methods internal static object Wrap( AutomationPeer peer, object iface ) { return new SynchronizedInputProviderWrapper( peer, (ISynchronizedInputProvider) iface ); }
//------------------------------------------------------ // // Constructors // //------------------------------------------------------ #region Constructors private SynchronizedInputProviderWrapper( AutomationPeer peer, ISynchronizedInputProvider iface ) { _peer = peer; _iface = iface; }
//------------------------------------------------------ // // Internal Methods // //------------------------------------------------------ #region Internal Methods internal static object Wrap( AutomationPeer peer, object iface ) { return new DockProviderWrapper( peer, (IDockProvider) iface ); }
//------------------------------------------------------ // // Constructors // //------------------------------------------------------ #region Constructors private DockProviderWrapper( AutomationPeer peer, IDockProvider iface ) { _peer = peer; _iface = iface; }
//------------------------------------------------------ // // Internal Methods // //------------------------------------------------------ #region Internal Methods internal static object Wrap( AutomationPeer peer, object iface ) { return new MultipleViewProviderWrapper( peer, (IMultipleViewProvider) iface ); }
// Raise synchronized input automation events here. internal static void RaiseAutomationEvent(AutomationPeer peer) { if (peer != null) { switch (InputManager.SynchronizedInputState) { case SynchronizedInputStates.Handled: peer.RaiseAutomationEvent(AutomationEvents.InputReachedTarget); break; case SynchronizedInputStates.Discarded: peer.RaiseAutomationEvent(AutomationEvents.InputDiscarded); break; default: peer.RaiseAutomationEvent(AutomationEvents.InputReachedOtherElement); break; } } }
/// <summary> /// Maps AutomationPeer to provider object. /// </summary> internal new IRawElementProviderSimple ProviderFromPeer(AutomationPeer peer) { return base.ProviderFromPeer(peer); }