Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var activityBeingValidated = new DelegateInArgument<ActivityBuilder>();
- var validationContext = new DelegateInArgument<ValidationContext>();
- var assertResult = new Variable<bool>();
- return new Constraint<ActivityBuilder>
- {
- DisplayName = "CheckIfRootIsCustomTypeActivity",
- Body = new ActivityAction<ActivityBuilder, ValidationContext>
- {
- Argument1 = activityBeingValidated,
- Argument2 = validationContext,
- Handler = new If
- {
- Condition = new InArgument<bool>()
- {
- Expression = new Equal<Type, Type, bool>()
- {
- Left = ExpressionServices.Convert<Type>(c => activityBeingValidated.Get(c).Implementation.GetType()),
- Right = ExpressionServices.Convert<Type>(c => typeof(CustomActivity))
- }
- },
- Then = new AssertValidation
- {
- Assertion = true,
- Message = new InArgument<string>("Root activity should be a CustomActivity")
- }
- }
- }
Add Comment
Please, Sign In to add comment