// internal handling of structure chanegd events private void RaisePropertyChangedInternal(IRawElementProviderSimple provider, AutomationProperty propertyId, object oldValue, object newValue) { // Callers have only checked if automation clients are present so filter for any interest in this particular event. if ( provider != null && EventMap.HasRegisteredEvent(AutomationEvents.PropertyChanged) ) { AutomationPropertyChangedEventArgs e = new AutomationPropertyChangedEventArgs(propertyId, oldValue, newValue); AutomationInteropProvider.RaiseAutomationPropertyChangedEvent(provider, e); } }
internal void HandleAutomationPropertyChanged (AutomationPropertyChangedEventArgs args) { if (args.Property == AEIds.HasKeyboardFocusProperty) { bool focused = (bool) args.NewValue; NotifyFocused (focused); foreach (FocusHandler handler in focusHandlers.Values) handler (this, focused); } else if (args.Property == AEIds.IsOffscreenProperty) { bool offscreen = (bool) args.NewValue; NotifyStateChange (Atk.StateType.Visible, !offscreen); } else if (args.Property == AEIds.IsEnabledProperty) { bool enabled = (bool) args.NewValue; NotifyStateChange (Atk.StateType.Enabled, enabled); NotifyStateChange (Atk.StateType.Sensitive, enabled); } else if (args.Property == AEIds.HelpTextProperty) { Description = (string) args.NewValue; } else if (args.Property == AEIds.BoundingRectangleProperty) { EmitBoundsChanged ((System.Windows.Rect) args.NewValue); } else if (args.Property == AEIds.NameProperty) { Notify ("accessible-name"); } else if (args.Property == AEIds.ControlTypeProperty) { // Assume that the RootVisual will never change // its control type. Adapter parent = Parent as Adapter; if (parent != null) parent.HandleControlTypeChange (Peer); } if (AutomationPropertyChanged != null) AutomationPropertyChanged (args.Peer, args); }