Example #1
0
        public static bool FindBinding(CShortCut shortCut, out CBinding result)
        {
            for (int i = 0; i < m_bindings.Count; ++i)
            {
                if (m_bindings[i].shortCut.Equals(shortCut))
                {
                    result = m_bindings[i];
                    return(true);
                }
            }

            result = default(CBinding);
            return(false);
        }
Example #2
0
        public static void Bind(CShortCut shortCut, string cmdKeyDown, string cmdKeyUp)
        {
            if (cmdKeyDown == null)
            {
                throw new NullReferenceException("Command is null");
            }

            int index = IndexOf(shortCut);

            if (index != -1)
            {
                CBinding existing = m_bindings[index];
                existing.cmdKeyDown = cmdKeyDown;
                existing.cmdKeyUp   = cmdKeyUp;
                m_bindings[index]   = existing;
            }
            else
            {
                m_bindings.Add(new CBinding(shortCut, cmdKeyDown, cmdKeyUp));
            }
        }
Example #3
0
        public static bool FindBinding(CShortCut shortCut, out CBinding result)
        {
            for (int i = 0; i < m_bindings.Count; ++i)
            {
                if (m_bindings[i].shortCut.Equals(shortCut))
                {
                    result = m_bindings[i];
                    return true;
                }
            }

            result = default(CBinding);
            return false;
        }
Example #4
0
 public static string ToString(CBinding b)
 {
     return string.Format("bind {0} {1}", b.shortCut.ToString(), StringUtils.Arg(b.cmdKeyDown));
 }
Example #5
0
 public static string ToString(CBinding b)
 {
     return(string.Format("bind {0} {1}", b.shortCut.ToString(), StringUtils.Arg(b.cmdKeyDown)));
 }