当前位置: 首页>>代码示例>>C#>>正文


C# Atk.AddState方法代码示例

本文整理汇总了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);
			}
		}
开发者ID:mono,项目名称:uia2atk,代码行数:33,代码来源:ExpandCollapseInvokeToggle.cs

示例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);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:13,代码来源:SelectionItem.cs

示例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);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:13,代码来源:RadioButton.cs

示例4: UpdateStates

		public void UpdateStates (Atk.StateSet states)
		{
			if (Editable)
				states.AddState (Atk.StateType.Editable);
			else
				states.RemoveState (Atk.StateType.Editable);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:7,代码来源:EditableTextImplementorHelper.cs

示例5: OnRefStateSet

		public override void OnRefStateSet (ref Atk.StateSet states)
		{
			if (valueProvider.IsReadOnly)
				states.RemoveState (Atk.StateType.Editable);
			else
				states.AddState (Atk.StateType.Editable);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:7,代码来源:Value.cs


注:本文中的Atk.AddState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。