示例#1
0
        public static ScriptElementDescriptor GetScriptElement(string elementName)
        {
            if (String.IsNullOrWhiteSpace(elementName))
            {
                return(null);
            }
            ScriptElementDescriptor d = null;

            ScriptElements.TryGetValue(elementName, out d);
            return(d);
        }
示例#2
0
        public static string Complete(string prefix)
        {
            IDictionaryEnumerator elements = ScriptElements.GetEnumerator();

            while (elements.MoveNext())
            {
                ScriptElementDescriptor d = (ScriptElementDescriptor)elements.Value;
                string s = d.GetName();
                if (s.StartsWith(prefix))
                {
                    if (s.Length > prefix.Length)
                    {
                        return(s.Substring(prefix.Length));
                    }
                }
            }
            return(Scripts.Complete(prefix));
        }
示例#3
0
        public static bool IsFunctionName(string name)
        {
            ScriptElementDescriptor d = GetScriptElement(name);

            return((d != null) && d.GetIsFunc());
        }