public override bool Execute(WindowState state) { if (SelectionManager.GetCurrentInlineEditorCurve() != null) { return(false); } if (!CanDelete(state)) { return(false); } var selectedItems = SelectionManager.SelectedItems(); DeleteItems(selectedItems); var tracks = SelectionManager.SelectedTracks().ToArray(); if (tracks.Any()) { TrackAction.Invoke <DeleteTracks>(state, tracks); } state.Refresh(); return(selectedItems.Any() || tracks.Length > 0); }
internal bool Execute(WindowState state, Func <ITimelineItem, ITimelineItem, double> gapBetweenItems) { var selectedItems = SelectionManager.SelectedItems().ToItemsPerTrack().ToList(); if (selectedItems.Any()) { var requestedTime = CalculateDuplicateTime(selectedItems, gapBetweenItems); var duplicatedItems = TimelineHelpers.DuplicateItemsUsingCurrentEditMode(state, TimelineEditor.inspectedDirector, TimelineEditor.inspectedDirector, selectedItems, requestedTime, "Duplicate Items"); TimelineHelpers.FrameItems(state, duplicatedItems); SelectionManager.RemoveTimelineSelection(); foreach (var item in duplicatedItems) { SelectionManager.Add(item); } } var tracks = SelectionManager.SelectedTracks().ToArray(); if (tracks.Length > 0) { TrackAction.Invoke <DuplicateTracks>(state, tracks); } state.Refresh(); return(true); }