public IReadOnlyArgument CreateAlternateArgument(string name, IReadOnlyType type, Preposition alternateAccess) { if (this.argumentNames.Contains(name)) throw new InvalidOperationException("An argument with the given name already exists."); if (this.prepArgMap.ContainsKey(alternateAccess)) throw new InvalidOperationException("An argument already exists with the given alternate access."); ArgumentData arg = new ArgumentData(name, type, this, alternateAccess); this.arguments.Add(arg); this.argumentNames.Add(name); this.prepArgMap[alternateAccess] = arg; return arg; }
public IReadOnlyArgument CreateArgument(string name, IReadOnlyType type) { if (this.argumentNames.Contains(name)) throw new InvalidOperationException("An argument with the given name already exists."); ArgumentData arg = new ArgumentData(name, type, this); this.arguments.Add(arg); this.argumentNames.Add(name); return arg; }