コード例 #1
0
        public void RegisterShortcut(MyDebugSystem system, string category, string name, MyShortcut shortcut, DebugItemHandler action)
        {
            MyDebugConsoleItem item = new MyDebugConsoleItem
            {
                System = system,
                Category = category,
                Name = name,
                Shortcut = shortcut,
                Action = action
            };

            //if (m_shortcutMap.ContainsKey(shortcut))
              //  return false;
            if (shortcut != null)
            {
                m_shortcutMap.Add(shortcut, item);
            }

            List<MyDebugConsoleItem> items;
            m_categoriesMap.TryGetValue(category.ToString(), out items);
            if (items == null)
            {
                items = new List<MyDebugConsoleItem>();
                m_categoriesMap.Add(category.ToString(), items);
            }

            items.Add(item);
        }
コード例 #2
0
        public void RegisterShortcut(MyDebugSystem system, string category, string name, MyShortcut shortcut, DebugItemHandler action)
        {
            MyDebugConsoleItem item = new MyDebugConsoleItem
            {
                System   = system,
                Category = category,
                Name     = name,
                Shortcut = shortcut,
                Action   = action
            };

            //if (m_shortcutMap.ContainsKey(shortcut))
            //  return false;
            if (shortcut != null)
            {
                m_shortcutMap.Add(shortcut, item);
            }

            List <MyDebugConsoleItem> items;

            m_categoriesMap.TryGetValue(category.ToString(), out items);
            if (items == null)
            {
                items = new List <MyDebugConsoleItem>();
                m_categoriesMap.Add(category.ToString(), items);
            }

            items.Add(item);
        }