public static bool ExecuteTrackAction(TrackAction trackAction, IEnumerable <TrackAsset> tracks) { if (tracks != null && tracks.Any() && trackAction.Validate(tracks) == ActionValidity.Valid) { if (trackAction.HasAutoUndo()) { UndoExtensions.RegisterTracks(tracks, trackAction.GetUndoName()); } return(trackAction.Execute(tracks)); } return(false); }
static void BuildMenu(TrackAction action, IEnumerable <TrackAsset> tracks, List <MenuActionItem> menuItems, MenuFilter filter) { BuildMenu(action, action.Validate(tracks), () => ExecuteTrackAction(action, tracks), menuItems, filter); }