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));
        }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
            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;
                }
                }
            }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
 public override string ToString() => KeyCombination.SequenceToString(keyCombinationSequence);