internal static void TryBind(Argument binding, System.Activities.RuntimeArgument argument, Activity violationOwner) { if (argument == null) { throw FxTrace.Exception.ArgumentNull("argument"); } bool flag = true; if (binding != null) { if (binding.Direction != argument.Direction) { violationOwner.AddTempValidationError(new ValidationError(System.Activities.SR.ArgumentDirectionMismatch(argument.Name, argument.Direction, binding.Direction))); flag = false; } if (binding.ArgumentType != argument.Type) { violationOwner.AddTempValidationError(new ValidationError(System.Activities.SR.ArgumentTypeMismatch(argument.Name, argument.Type, binding.ArgumentType))); flag = false; } } if (flag) { Bind(binding, argument); } }
internal static void TryBind(Argument binding, RuntimeArgument argument, Activity violationOwner) { if (argument == null) { throw FxTrace.Exception.ArgumentNull(nameof(argument)); } bool passedValidations = true; if (binding != null) { if (binding.Direction != argument.Direction) { violationOwner.AddTempValidationError(new ValidationError(SR.ArgumentDirectionMismatch(argument.Name, argument.Direction, binding.Direction))); passedValidations = false; } if (binding.ArgumentType != argument.Type) { violationOwner.AddTempValidationError(new ValidationError(SR.ArgumentTypeMismatch(argument.Name, argument.Type, binding.ArgumentType))); passedValidations = false; } } if (passedValidations) { Bind(binding, argument); } }