protected override void CacheMetadata(CodeActivityMetadata metadata) { this.targetArgument = null; if (string.IsNullOrEmpty(this.ArgumentName)) { metadata.AddValidationError(System.Activities.SR.ArgumentNameRequired); } else { this.targetArgument = ActivityUtilities.FindArgument(this.ArgumentName, this); if (this.targetArgument == null) { metadata.AddValidationError(System.Activities.SR.ArgumentNotFound(this.ArgumentName)); } else if (this.targetArgument.Type != typeof(T)) { metadata.AddValidationError(System.Activities.SR.ArgumentTypeMustBeCompatible(this.ArgumentName, this.targetArgument.Type, typeof(T))); } } }