Guest User

Untitled

a guest
Jul 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. var activityBeingValidated = new DelegateInArgument<ActivityBuilder>();
  2. var validationContext = new DelegateInArgument<ValidationContext>();
  3. var assertResult = new Variable<bool>();
  4.  
  5. return new Constraint<ActivityBuilder>
  6. {
  7. DisplayName = "CheckIfRootIsCustomTypeActivity",
  8. Body = new ActivityAction<ActivityBuilder, ValidationContext>
  9. {
  10. Argument1 = activityBeingValidated,
  11. Argument2 = validationContext,
  12.  
  13. Handler = new If
  14. {
  15. Condition = new InArgument<bool>()
  16. {
  17. Expression = new Equal<Type, Type, bool>()
  18. {
  19. Left = ExpressionServices.Convert<Type>(c => activityBeingValidated.Get(c).Implementation.GetType()),
  20. Right = ExpressionServices.Convert<Type>(c => typeof(CustomActivity))
  21. }
  22. },
  23. Then = new AssertValidation
  24. {
  25. Assertion = true,
  26. Message = new InArgument<string>("Root activity should be a CustomActivity")
  27. }
  28. }
  29. }
Add Comment
Please, Sign In to add comment