void ItemDoubleClickedCallback(int id) { var trackGUI = m_TreeView.FindItem(id) as TimelineTrackGUI; if (trackGUI == null) { return; } if (trackGUI.track == null || trackGUI.track.lockedInHierarchy) { return; } var selection = SelectionManager.SelectedItems().ToList(); var items = ItemsUtils.GetItems(trackGUI.track).ToList(); var addToSelection = !selection.SequenceEqual(items); foreach (var i in items) { if (addToSelection) { SelectionManager.Add(i); } else { SelectionManager.Remove(i); } } }
internal void ItemDoubleClickedCallback(int id) { var gui = m_TreeView.FindItem(id); var trackGUI = gui as TimelineTrackGUI; if (trackGUI != null) { if (trackGUI.track == null || trackGUI.track.lockedInHierarchy) { return; } var selection = SelectionManager.SelectedItems().ToList(); var items = ItemsUtils.GetItems(trackGUI.track).ToList(); var addToSelection = !selection.SequenceEqual(items); foreach (var i in items) { if (addToSelection) { SelectionManager.Add(i); } else { SelectionManager.Remove(i); } } return; } if (gui is TimelineGroupGUI groupGUI) { KeyboardNavigation.ToggleCollapseGroup(new[] { groupGUI.track }); } }
public static void RangeSelectItems(ITimelineItem lastItemToSelect) { var selectSorted = SelectionManager.SelectedItems().ToList(); var firstSelect = selectSorted.FirstOrDefault(); if (firstSelect == null) { SelectionManager.Add(lastItemToSelect); return; } var allItems = TimelineWindow.instance.allTracks.OfType <TimelineTrackGUI>().SelectMany(ttGui => ItemsUtils.GetItems(ttGui.track)).ToList(); TimelineHelpers.RangeSelect(allItems, selectSorted, lastItemToSelect, SelectionManager.Add, SelectionManager.Remove); }