本文整理汇总了C#中Atk.AddState方法的典型用法代码示例。如果您正苦于以下问题:C# Atk.AddState方法的具体用法?C# Atk.AddState怎么用?C# Atk.AddState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Atk
的用法示例。
在下文中一共展示了Atk.AddState方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRefStateSet
public override void OnRefStateSet (ref Atk.StateSet states)
{
IExpandCollapseProvider expandCollapse
= peer.GetPattern (PatternInterface.ExpandCollapse)
as IExpandCollapseProvider;
if (expandCollapse != null) {
var state = expandCollapse.ExpandCollapseState;
// If it's not a leaf, it can be expanded
if (state != ExpandCollapseState.LeafNode)
states.AddState (Atk.StateType.Expandable);
if (state == ExpandCollapseState.Expanded
|| state == ExpandCollapseState.PartiallyExpanded)
states.AddState (Atk.StateType.Expanded);
else
states.RemoveState (Atk.StateType.Expanded);
}
IToggleProvider toggle
= peer.GetPattern (PatternInterface.Toggle)
as IToggleProvider;
if (toggle != null) {
states.RemoveState (Atk.StateType.Checked);
states.RemoveState (Atk.StateType.Indeterminate);
var state = toggle.ToggleState;
if (state == ToggleState.On)
states.AddState (Atk.StateType.Checked);
else if (state == ToggleState.Indeterminate)
states.AddState (Atk.StateType.Indeterminate);
}
}
示例2: OnRefStateSet
public override void OnRefStateSet (ref Atk.StateSet states)
{
bool? isSelected = IsSelected;
if (!isSelected.HasValue)
return;
states.AddState (Atk.StateType.Selectable);
if (isSelected.Value)
states.AddState (Atk.StateType.Selected);
else
states.RemoveState (Atk.StateType.Selected);
}
示例3: OnRefStateSet
public override void OnRefStateSet (ref Atk.StateSet states)
{
var selectionItem = peer.GetPattern (
PatternInterface.SelectionItem)
as ISelectionItemProvider;
if (selectionItem == null)
return;
if (selectionItem.IsSelected)
states.AddState (Atk.StateType.Checked);
else
states.RemoveState (Atk.StateType.Checked);
}
示例4: UpdateStates
public void UpdateStates (Atk.StateSet states)
{
if (Editable)
states.AddState (Atk.StateType.Editable);
else
states.RemoveState (Atk.StateType.Editable);
}
示例5: OnRefStateSet
public override void OnRefStateSet (ref Atk.StateSet states)
{
if (valueProvider.IsReadOnly)
states.RemoveState (Atk.StateType.Editable);
else
states.AddState (Atk.StateType.Editable);
}