protected void OnProviderBehaviorSet (ProviderBehaviorEventArgs args) { if (ProviderBehaviorSet != null) ProviderBehaviorSet (this, args); }
private void OnProviderBehaviorSet (object sender, ProviderBehaviorEventArgs eventArgs) { if (AutomationInteropProvider.ClientsAreListening == false) return; else if ((eventArgs.Replaced == true && eventArgs.Behavior == null) || (eventArgs.Replaced == false && eventArgs.Behavior != null)) { AutomationProperty property = null; if (eventArgs.Pattern == DockPatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsDockPatternAvailableProperty; else if (eventArgs.Pattern == ExpandCollapsePatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsExpandCollapsePatternAvailableProperty; else if (eventArgs.Pattern == GridItemPatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsGridItemPatternAvailableProperty; else if (eventArgs.Pattern == GridPatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsGridPatternAvailableProperty; else if (eventArgs.Pattern == InvokePatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsInvokePatternAvailableProperty; else if (eventArgs.Pattern == MultipleViewPatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsMultipleViewPatternAvailableProperty; else if (eventArgs.Pattern == RangeValuePatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsRangeValuePatternAvailableProperty; else if (eventArgs.Pattern == ScrollItemPatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsScrollItemPatternAvailableProperty; else if (eventArgs.Pattern == ScrollPatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsScrollPatternAvailableProperty; else if (eventArgs.Pattern == SelectionItemPatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsSelectionItemPatternAvailableProperty; else if (eventArgs.Pattern == SelectionPatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsSelectionPatternAvailableProperty; else if (eventArgs.Pattern == TableItemPatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsTableItemPatternAvailableProperty; else if (eventArgs.Pattern == TablePatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsTablePatternAvailableProperty; else if (eventArgs.Pattern == TextPatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsTextPatternAvailableProperty; else if (eventArgs.Pattern == TogglePatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsTogglePatternAvailableProperty; else if (eventArgs.Pattern == TransformPatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsTransformPatternAvailableProperty; else if (eventArgs.Pattern == ValuePatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsValuePatternAvailableProperty; else if (eventArgs.Pattern == WindowPatternIdentifiers.Pattern) property = AutomationElementIdentifiers.IsWindowPatternAvailableProperty; if (property == null) //This never should happen, theoretically return; bool? val = Provider.GetPropertyValue (property.Id) as bool?; // This should never happen. if (val == null) return; bool newValue = val ?? false; AutomationPropertyChangedEventArgs args = new AutomationPropertyChangedEventArgs (property, !newValue, newValue); AutomationInteropProvider.RaiseAutomationPropertyChangedEvent (Provider, args); } }
private void OnProviderBehaviorSet (object sender, ProviderBehaviorEventArgs args) { RaiseAutomationPropertyChangedEvent (); }
private void OnProviderBehaviorSet (object sender, ProviderBehaviorEventArgs args) { AutomationPattern pattern = null; if (args.Pattern == TablePatternIdentifiers.Pattern) pattern = TableItemPatternIdentifiers.Pattern; else if (args.Pattern == GridPatternIdentifiers.Pattern) pattern = GridItemPatternIdentifiers.Pattern; else return; SetBehavior (pattern, ListProvider.GetListItemBehaviorRealization (pattern, this)); }