public void Update(IActionContext context, ref ActionPresentation presentation) { if (context.SelectedResources.Count == 0 || ResourceTypeHelper.AnyResourcesInternal(context.SelectedResources)) { if (context.Kind == ActionContextKind.MainMenu) { presentation.Enabled = false; } else { presentation.Visible = false; } return; } bool anyHasFlag = false; for (int i = 0; i < context.SelectedResources.Count; i++) { if (context.SelectedResources[i].HasProp("Flag")) { anyHasFlag = true; break; } } presentation.Enabled = anyHasFlag; }
public void Update(IActionContext context, ref ActionPresentation presentation) { if (context.SelectedResources.Count == 0 || ResourceTypeHelper.AnyResourcesInternal(context.SelectedResources)) { if (context.Kind == ActionContextKind.MainMenu) { presentation.Enabled = false; } else { presentation.Visible = false; } } }