예제 #1
0
        public void AddValue(string name, EnumerationValue val)
        {
            System.Diagnostics.Debug.Assert(val != null);

            if (!ScriptEngine.Utils.IsValidIdentifier(name))
            {
                throw new ArgumentException("Name must be a valid identifier", "name");
            }

            int id = _values.Count;

            _nameIndexes.Add(name, id);
            _values.Add(val);
        }
예제 #2
0
        public void AddValue(string name, string alias, EnumerationValue val)
        {
            System.Diagnostics.Debug.Assert(name != null);
            System.Diagnostics.Debug.Assert(val != null);

            if (!ScriptEngine.Utils.IsValidIdentifier(name))
                throw new ArgumentException("Name must be a valid identifier", "name");

            if(alias != null && !ScriptEngine.Utils.IsValidIdentifier(alias))
                throw new ArgumentException("Name must be a valid identifier", "alias");

            _nameIds.RegisterName(name, alias);
            val.ValuePresentation = name;
            _values.Add(val);

        }
예제 #3
0
        public void AddValue(string name, string alias, EnumerationValue val)
        {
            System.Diagnostics.Debug.Assert(name != null);
            System.Diagnostics.Debug.Assert(val != null);

            if (!ScriptEngine.Utils.IsValidIdentifier(name))
            {
                throw new ArgumentException("Name must be a valid identifier", "name");
            }

            if (alias != null && !ScriptEngine.Utils.IsValidIdentifier(alias))
            {
                throw new ArgumentException("Name must be a valid identifier", "alias");
            }

            _nameIds.RegisterName(name, alias);
            val.ValuePresentation = name;
            _values.Add(val);
        }
예제 #4
0
 public int IndexOf(EnumerationValue enumVal)
 {
     return _values.IndexOf(enumVal);
 }
예제 #5
0
 public void AddValue(string name, EnumerationValue val)
 {
     AddValue(name, null, val);
 }
예제 #6
0
 public int IndexOf(EnumerationValue enumVal)
 {
     return(_values.IndexOf(enumVal));
 }
예제 #7
0
 public void AddValue(string name, EnumerationValue val)
 {
     AddValue(name, null, val);
 }