/// <summary> /// Creates an If block that will be executed if the condition evaluates to true. /// </summary> public FluentIfBuilder <TThis> If(FluentExpression conditionExpression) { if (conditionExpression == null) { throw new ArgumentNullException("conditionExpression"); } _CheckModifiable(); var result = new FluentIfBuilder <TThis>(_this, _method, conditionExpression.Expression); _statements.Add(result); return(result); }
public void StandardProperties() { // TODO: remove those CompilerGenerated attributes var type = TypeSignature.Class("MyType", ns, Accessibility.APublic); var prop = PropertySignature.Create("A", type, TypeSignature.String, Accessibility.APublic, Accessibility.AProtected); var td = TypeDef.Empty(type).AddMember( new PropertyDef(prop, getter: MethodDef.Create(prop.Getter, thisP => Expression.Constant("abcd")), setter: MethodDef.Create(prop.Setter, (thisP, xP) => Expression.While(FluentExpression.Box(thisP).CallMethod(MethodSignature.Object_Equals, Expression.Default(TypeSignature.Object)), Expression.Nop)) ) ); cx.AddType(td); check.CheckOutput(cx); }
/// <summary> /// Starts a For loop. /// </summary> public FluentForBuilder <TThis> For <T>(FluentExpression initialization, Expression <Func <bool> > condition, FluentExpression increment) { return(_For(initialization, condition.Body, increment)); }
/// <summary> /// Starts a For loop. /// </summary> public FluentForBuilder <TThis> For <T>(FluentExpression initialization, FluentExpression condition, FluentExpression increment) { return(_For(initialization, condition, increment)); }
/// <summary> /// Starts a For loop. /// </summary> public FluentForBuilder <TThis> For <T>(Expression <Func <T> > initialization, FluentExpression condition, Expression <Func <T> > increment) { return(_For(initialization.Body, condition, increment.Body)); }