示例#1
0
        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;
        }
示例#2
0
        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;
        }