internal FluentMethodBuilder(_IFluentTypeBuilder typeBuilder, string name, Type returnType, bool isStatic, int creatorThreadId, int delegateIndex, bool respectVisibility) { _creatorThreadId = creatorThreadId; _visitor = new _Visitor(this); _returnTarget = Expression.Label(returnType); TypeBuilder = typeBuilder; _body = new FluentBodyBuilder(this); Name = name; ReturnType = returnType; IsStatic = isStatic; _delegateIndex = delegateIndex; _respectVisibility = respectVisibility; }
/// <summary> /// Creates a new method builder. /// </summary> /// <param name="returnType">The type of the return of the method that will be generated.</param> public FluentMethodBuilder(Type returnType) { if (returnType == null) { throw new ArgumentNullException("returnType"); } _delegateIndex = -1; _creatorThreadId = Thread.CurrentThread.ManagedThreadId; _visitor = new _Visitor(this); _returnTarget = Expression.Label(returnType); _body = new FluentBodyBuilder(this); ReturnType = returnType; IsStatic = true; }