Exemple #1
0
        /// <inheritdoc />
        public IGenericParameterBuilder NewGenericParameter(string parameterName)
        {
            this.genericParameters = this.genericParameters ?? new List <FluentGenericParameterBuilder>();
            var builder = new FluentGenericParameterBuilder(parameterName, null);

            this.genericParameters.Add(builder);
            return(builder);
        }
Exemple #2
0
        /// <inheritdoc/>
        public IGenericParameterBuilder NewGenericParameter(string parameterName)
        {
            this.genericParameterBuilders = this.genericParameterBuilders ?? new List <FluentGenericParameterBuilder>();
            var builder = new FluentGenericParameterBuilder(
                parameterName,
                (name) =>
            {
                this.Define();
                return(this.GetGenericParameter(name));
            });

            this.genericParameterBuilders.Add(builder);
            return(builder);
        }
Exemple #3
0
        /// <inheritdoc/>
        public IMethodBuilder NewGenericParameters(string[] parameterNames, Action <IGenericParameterBuilder[]> action)
        {
            this.genericParameterBuilders = this.genericParameterBuilders ?? new List <FluentGenericParameterBuilder>();
            foreach (var parameterName in parameterNames)
            {
                var builder = new FluentGenericParameterBuilder(
                    parameterName,
                    (name) =>
                {
                    this.Define();
                    return(this.GetGenericParameter(name));
                });
                this.genericParameterBuilders.Add(builder);
            }

            action?.Invoke(this.genericParameterBuilders.ToArray());

            return(this);
        }