public override ParameterBuilderDTO Create(ParameterBuilder b) { var sb = b as LikeBuilder; if (sb == null) return base.Create(b); // find the instance of the MatchMode in the static fields var modes = typeof(MatchMode).GetFields(BindingFlags.Public | BindingFlags.Static); FieldInfo mode = null; foreach (var f in modes) { if (f.FieldType == typeof(MatchMode) && f.GetValue(null) == sb.Mode) { mode = f; break; } } if (mode == null) throw new ArgumentException("The provided MatchMode does not match an internal static field on MatchMode."); return new LikeBuilderDTO() { Label = sb.Label, Mode = mode.Name }; }
public override ParameterBuilderDTO Create(ParameterBuilder b) { var sb = b as NotBuilder; if (sb == null) return base.Create(b); return new NotBuilderDTO() { Label = sb.Label, Other = Chain.Create(sb.Other) }; }
public override ParameterBuilderDTO Create(ParameterBuilder b) { var sb = b as SimpleBuilder; if (sb == null) return base.Create(b); return new SimpleBuilderDTO() { Label = sb.Label, Operator = sb.Operator }; }
public override ParameterBuilderDTO Create(ParameterBuilder b) { var sb = b as BooleanBuilder; if (sb == null) return base.Create(b); return new BooleanBuilderDTO() { Label = sb.Label, Value = sb.Value }; }
public override ParameterBuilderDTO Create(ParameterBuilder b) { var sb = b as JunctionBuilder; if (sb == null) return base.Create(b); return new JunctionBuilderDTO() { Label = sb.Label, Type = sb.Type.ToString(), Other = base.Chain.Create(sb.Other) }; }
public NotBuilder(ParameterBuilder other) { Other = other; }
public override ParameterBuilderDTO Create(ParameterBuilder source) { return DTO; }