Esempio n. 1
0
        public static IList <CBinding> List(string prefix = null) // TODO: unit tests
        {
            if (prefix != null)
            {
                return(List(delegate(CBinding binding) {
                    return CStringUtils.StartsWithIgnoreCase(binding.shortCut.ToString(), prefix);
                }));
            }

            return(m_bindings);
        }
Esempio n. 2
0
        public IDictionary <string, object> ListPreferences(string token = null)
        {
            if (string.IsNullOrEmpty(token))
            {
                return(m_data);
            }

            IDictionary <string, object> data = new Dictionary <string, object>();

            foreach (KeyValuePair <string, object> e in m_data)
            {
                if (CStringUtils.StartsWithIgnoreCase(e.Key, token))
                {
                    data[e.Key] = e.Value;
                }
            }

            return(data);
        }
Esempio n. 3
0
        internal static bool ShouldListCommand(CCommand cmd, string prefix, CCommandListOptions options = CCommandListOptions.None)
        {
            if (cmd.IsDebug && (options & CCommandListOptions.Debug) == 0)
            {
                return(false);
            }

            if (cmd.IsSystem && (options & CCommandListOptions.System) == 0)
            {
                return(false);
            }

            if (cmd.IsHidden && (options & CCommandListOptions.Hidden) == 0)
            {
                return(false);
            }

            return(prefix == null || CStringUtils.StartsWithIgnoreCase(cmd.Name, prefix));
        }
Esempio n. 4
0
 public static bool ShouldListMethod(MethodInfo m, string prefix)
 {
     return(CStringUtils.StartsWithIgnoreCase(m.Name, prefix));
 }