상속: IProviderBehavior, ISelectionProvider
 // If a child control is ControlType.RadioButton, this provider
 // needs to provide SelectionPattern behavior.
 private void CheckForRadioButtonChild(IRawElementProviderSimple childProvider)
 {
     if (GetBehavior(SelectionPatternIdentifiers.Pattern) == null &&
         childProvider.GetPatternProvider(SelectionItemPatternIdentifiers.Pattern.Id) != null &&
         (int)childProvider.GetPropertyValue(AutomationElementIdentifiers.ControlTypeProperty.Id) == ControlType.RadioButton.Id)
     {
         RB.SelectionProviderBehavior selectionProvider =
             new RB.SelectionProviderBehavior(this);
         SetBehavior(SelectionPatternIdentifiers.Pattern,
                     selectionProvider);
         hasRadioButtonChild = true;
     }
 }
예제 #2
0
		// If a child control is ControlType.RadioButton, this provider
		// needs to provide SelectionPattern behavior.
		private void CheckForRadioButtonChild (IRawElementProviderSimple childProvider)
		{
			if (GetBehavior (SelectionPatternIdentifiers.Pattern) == null &&
			    childProvider.GetPatternProvider (SelectionItemPatternIdentifiers.Pattern.Id) != null &&
			    (int) childProvider.GetPropertyValue (AutomationElementIdentifiers.ControlTypeProperty.Id) == ControlType.RadioButton.Id) {
				RB.SelectionProviderBehavior selectionProvider =
					new RB.SelectionProviderBehavior (this);
				SetBehavior (SelectionPatternIdentifiers.Pattern,
				             selectionProvider);
				hasRadioButtonChild = true;
			}
		}