public static void Buildrule(EnumeratorRule aRule, bool isRandom, String enumType, String assemblyName) { aRule.IsRandom = isRandom; aRule.Enumerator = enumType; aRule.Assembly = assemblyName; }
public static IDataRule InitializeBase(FieldTypes generalType, bool isRandom, String fieldName, String fieldDataType, bool convertToString) { IDataRule result = null; switch (generalType) { case FieldTypes.Date: result = new DateRule(); break; case FieldTypes.Time: result = new TimeRule(); break; case FieldTypes.GUID: result = new GuidRule(); break; case FieldTypes.Imported: //result = new break; case FieldTypes.MultiColumn: result = new MultiFieldDataSourceRule(); break; case FieldTypes.SingleColumn: result = new SingleFieldDataSourceRule(); break; case FieldTypes.Number: result = new NumberRule(); break; case FieldTypes.String: result = new StringRule(); break; case FieldTypes.Bool: result = new BoolRule(); break; case FieldTypes.Dynamic: case FieldTypes.Type: result = new TRule(); break; case FieldTypes.Enumerator: result = new EnumeratorRule(); break; case FieldTypes.MappedSource: result = new MappedSourceRule(); break; case FieldTypes.Collection: result = new CollectionRule(); break; case FieldTypes.Tuple: result = new TupleRule(); break; } result.ConvertToString = convertToString; result.FieldDataType = fieldDataType; result.FieldName = fieldName; result.IsRandom = isRandom; result.RuleType = generalType; return(result); }