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


C# CommandArrayInfo.Clear方法代码示例

本文整理汇总了C#中MonoDevelop.Components.Commands.CommandArrayInfo.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# CommandArrayInfo.Clear方法的具体用法?C# CommandArrayInfo.Clear怎么用?C# CommandArrayInfo.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MonoDevelop.Components.Commands.CommandArrayInfo的用法示例。


在下文中一共展示了CommandArrayInfo.Clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnSetBuildActionUpdate

		public void OnSetBuildActionUpdate (CommandArrayInfo info)
		{
			Set<string> toggledActions = new Set<string> ();
			Project proj = null;
			foreach (ITreeNavigator node in CurrentNodes) {
				ProjectFile finfo = (ProjectFile) node.DataItem;
				
				//disallow multi-slect on more than one project, since available build actions may differ
				if (proj == null && finfo.Project != null) {
					proj = finfo.Project;
				} else if (proj == null || proj != finfo.Project) {
					info.Clear ();
					return;
				}
				toggledActions.Add (finfo.BuildAction);
			}
			
			foreach (string action in proj.GetBuildActions ()) {
				if (action == "--") {
					info.AddSeparator ();
				} else {
					CommandInfo ci = info.Add (BuildAction.Translate (action), action);
					ci.Checked = toggledActions.Contains (action);
					if (ci.Checked)
						ci.CheckedInconsistent = toggledActions.Count > 1;
				}
			}
		}
开发者ID:techsaint,项目名称:monodevelop,代码行数:28,代码来源:ProjectFileNodeBuilder.cs

示例2: CommandUpdate

		// If multiple nodes are selected and the method does not have the AllowMultiSelectionAttribute
		// attribute, disable the command.
		
		protected override void CommandUpdate (object target, CommandArrayInfo cinfo)
		{
			NodeCommandHandler nc = (NodeCommandHandler) target;
			base.CommandUpdate (target, cinfo);
			if (nc.MultipleSelectedNodes) {
				bool allowMultiArray = false;
				ICommandArrayUpdateHandler h = ((ICommandArrayUpdateHandler)this).Next;
				while (h != null) {
					if (h is AllowMultiSelectionAttribute) {
						allowMultiArray = true;
						break;
					}
					h = h.Next;
				}
				if (!allowMultiArray)
					cinfo.Clear ();
			}
		}
开发者ID:nieve,项目名称:monodevelop,代码行数:21,代码来源:NodeCommandHandler.cs


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