本文整理匯總了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 ();
}
}