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); }
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); }
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); }
public int IndexOf(EnumerationValue enumVal) { return _values.IndexOf(enumVal); }
public void AddValue(string name, EnumerationValue val) { AddValue(name, null, val); }
public int IndexOf(EnumerationValue enumVal) { return(_values.IndexOf(enumVal)); }