NotifyStateChange() protected method

protected NotifyStateChange ( Atk state ) : void
state Atk
return void
Exemplo n.º 1
0
 internal void NotifyItemSelectionRemoved(Adapter item)
 {
     if (item != selectedItem)
     {
         return;
     }
     item.NotifyStateChange(Atk.StateType.Selected, false);
     selectedItem = null;
 }
Exemplo n.º 2
0
 internal void NotifyItemSelected(Adapter item)
 {
     if (item == selectedItem)
     {
         return;
     }
     if (selectedItem != null)
     {
         selectedItem.NotifyStateChange(Atk.StateType.Selected, false);
     }
     item.NotifyStateChange(Atk.StateType.Selected, true);
     selectedItem = item;
 }
Exemplo n.º 3
0
        public override void RaiseAutomationPropertyChangedEvent(AutomationPropertyChangedEventArgs e)
        {
            if (editableTextExpert.RaiseAutomationPropertyChangedEvent(e))
            {
                return;
            }

            if (e.Property == AutomationElementIdentifiers.HasKeyboardFocusProperty)
            {
                bool    focused       = (bool)e.NewValue;
                Adapter parentAdapter = (Adapter)Parent;
                if (parentAdapter is List)
                {
                    ((List)parentAdapter).HandleItemFocus(this, focused);
                    return;
                }
                parentAdapter.NotifyStateChange(Atk.StateType.Focused, focused);
                if (focused)
                {
                    Atk.Focus.TrackerNotify(parentAdapter);
                }
            }
            else if (e.Property == TogglePatternIdentifiers.ToggleStateProperty)
            {
                NotifyStateChange(Atk.StateType.Checked, IsChecked((ToggleState)e.NewValue));
            }
            else if (e.Property == AutomationElementIdentifiers.IsTogglePatternAvailableProperty)
            {
                if ((bool)e.NewValue == true)
                {
                    toggleProvider = (IToggleProvider)Provider.GetPatternProvider(TogglePatternIdentifiers.Pattern.Id);
                    actionExpert.Add("toggle", "toggle", null, DoToggle);
                }
                else
                {
                    toggleProvider = null;
                    actionExpert.Remove("toggle");
                }
            }
            else
            {
                base.RaiseAutomationPropertyChangedEvent(e);
            }
        }
Exemplo n.º 4
0
Arquivo: Tree.cs Projeto: mono/uia2atk
		internal void NotifyItemSelectionRemoved (Adapter item)
		{
			if (item != selectedItem)
				return;
			item.NotifyStateChange (Atk.StateType.Selected, false);
			selectedItem = null;
		}
Exemplo n.º 5
0
Arquivo: Tree.cs Projeto: mono/uia2atk
		internal void NotifyItemSelected (Adapter item)
		{
			if (item == selectedItem)
				return;
			if (selectedItem != null)
				selectedItem.NotifyStateChange (Atk.StateType.Selected, false);
			item.NotifyStateChange (Atk.StateType.Selected, true);
			selectedItem = item;
		}
Exemplo n.º 6
0
        public override void RaiseAutomationPropertyChangedEvent(AutomationPropertyChangedEventArgs e)
        {
            if (editableTextExpert.RaiseAutomationPropertyChangedEvent(e) ||
                textExpert.RaiseAutomationPropertyChangedEvent(e))
            {
                return;
            }

            if (e.Property == AutomationElementIdentifiers.HasKeyboardFocusProperty)
            {
                bool    focused       = (bool)e.NewValue;
                Adapter parentAdapter = (Adapter)Parent;
                if (parentAdapter is Tree)
                {
                    ((Tree)parentAdapter).HandleItemFocus(this, focused);
                    return;
                }
                if (parentAdapter is DataGrid)
                {
                    ((DataGrid)parentAdapter).HandleItemFocus(this, focused);
                    return;
                }
                parentAdapter.NotifyStateChange(Atk.StateType.Focused, focused);
                if (focused)
                {
                    Atk.Focus.TrackerNotify(parentAdapter);
                }
            }
            else if (e.Property == TogglePatternIdentifiers.ToggleStateProperty)
            {
                NotifyStateChange(Atk.StateType.Checked, IsChecked((ToggleState)e.NewValue));
            }
            else if (e.Property == AutomationElementIdentifiers.IsTogglePatternAvailableProperty)
            {
                if ((bool)e.NewValue == true)
                {
                    actionExpert.Add("toggle", "toggle", null, DoToggle);
                }
                else
                {
                    actionExpert.Remove("toggle");
                }
            }
            else if (e.Property == ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty)
            {
                ExpandCollapseState oldValue = (ExpandCollapseState)e.OldValue;
                ExpandCollapseState newValue = (ExpandCollapseState)e.NewValue;
                if (oldValue == ExpandCollapseState.LeafNode || newValue == ExpandCollapseState.LeafNode)
                {
                    NotifyStateChange(Atk.StateType.Expandable, (newValue != ExpandCollapseState.LeafNode));
                }
                if (oldValue == ExpandCollapseState.Expanded || newValue == ExpandCollapseState.Expanded)
                {
                    bool expanded = (newValue == ExpandCollapseState.Expanded);
                    NotifyStateChange(Atk.StateType.Expanded, expanded);
                    ((Tree)Parent).NotifyRowAdjusted(this, expanded);
                }
            }
            else
            {
                base.RaiseAutomationPropertyChangedEvent(e);
            }
        }