internal string GetKeyCombinationFor(string shortcutId) { var shortcutEntry = directory.FindShortcutEntry(shortcutId); if (shortcutEntry != null) { return(KeyCombination.SequenceToString(shortcutEntry.combinations)); } throw new System.ArgumentException(shortcutId + " is not defined.", nameof(shortcutId)); }
public void ResolveConflict(List <KeyCombination> keyCombinationSequence, List <ShortcutEntry> entries) { var builder = new StringBuilder(); builder.Append($"Shortcut conflict detected for key binding {KeyCombination.SequenceToString(keyCombinationSequence)}.\n"); builder.Append("Please resolve the conflict by rebinding one or more of the following shortcuts:\n"); foreach (var entry in entries) { builder.Append($"{entry.identifier.path} ({KeyCombination.SequenceToString(entry.combinations)})\n"); } Debug.Log(builder.ToString()); }
static void CellGUI(Rect getCellRect, ShortcutEntry item, MyColumns getColumn, ref RowGUIArgs args) { switch (getColumn) { case MyColumns.Name: { GUI.Label(getCellRect, item.displayName); break; } case MyColumns.Type: { GUI.Label(getCellRect, item.type.ToString()); break; } case MyColumns.Binding: { GUI.Label(getCellRect, KeyCombination.SequenceToString(item.combinations)); break; } } }
internal void Init(IConflictResolver conflictResolver, IEnumerable <KeyCombination> keyCombinationSequence, IEnumerable <ShortcutEntry> entries, GUIView previouslyFocusedView) { m_PreviouslyFocusedView = previouslyFocusedView; m_ConflictResolver = conflictResolver; m_Entries = entries.ToList(); var multiColumnHeader = new MultiColumnHeader(m_MulticolumnHeaderState); multiColumnHeader.ResizeToFit(); m_ConflictListView = new ConflictListView(m_TreeViewState, multiColumnHeader, m_Entries); m_Header = string.Format(L10n.Tr("The binding \"{0}\" conflicts with multiple commands."), KeyCombination.SequenceToString(keyCombinationSequence)); }
public override string ToString() => KeyCombination.SequenceToString(keyCombinationSequence);