public override void EditRule(IDataRule aRule)
        {
            base.EditRule(aRule);
            SingleFieldDataSourceRule iRule = (SingleFieldDataSourceRule)aRule;

            LoadFile(iRule.TypeofInternalSource);
            SourceType       = iRule.TypeofInternalSource;
            rangeCtrl.Start  = iRule.RangeStart;
            rangeCtrl.End    = iRule.RangeEnd;
            rangeCtrl.Random = iRule.IsRandom;
            regularExpressionCtrl.RegularExpression = iRule.RegularExpression;
            txtMaxRecords.Text = iRule.MaxRecords.ToString();
        }
Ejemplo n.º 2
0
 public static void Buildrule(SingleFieldDataSourceRule aRule, DataResources typeofInternalSource, int maxRecs, string startRange, string endRange, string regularExpression)
 {
     try
     {
         aRule.RangeStart        = startRange;
         aRule.RangeEnd          = endRange;
         aRule.RegularExpression = regularExpression;
         aRule.MaxRecords        = maxRecs;
     }
     catch (Exception e)
     {
         throw new Exception("Build SingleFieldDataSource rule failed");
     }
 }
Ejemplo n.º 3
0
        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);
        }