static void AddMarkerMenuCommands(List <MenuActionItem> menuItems, ICollection <TrackAsset> tracks, Action <Type, Object> command, bool enabled) { var markerTypes = TypeUtility.GetBuiltInMarkerTypes().Union(TypeUtility.GetUserMarkerTypes()); if (tracks != null) { markerTypes = markerTypes.Where(x => tracks.All(track => (track == null) || TypeUtility.DoesTrackSupportMarkerType(track, x))); // null track indicates marker track to be created } AddMarkerMenuCommands(menuItems, markerTypes, command, enabled); }
public static void AddMarkerMenuCommands(GenericMenu menu, TrackAsset track, Func <Type, IMarker> command, bool enabled) { var markerTypes = TypeUtility.GetBuiltInMarkerTypes().Union(TypeUtility.GetUserMarkerTypes()); if (track != null) { markerTypes = markerTypes.Where(x => TypeUtility.DoesTrackSupportMarkerType(track, x)); } menu.AddSeparator(string.Empty); AddMarkerMenuCommands(menu, markerTypes, command, enabled); RemoveInvalidMarkersMenuItem(menu, track); }