本文整理汇总了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;
}
}
}
示例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 ();
}
}