private List <object> GetParentChainWithSource(Activity activity)
        {
            List <object> parentChain = new List <object>();

            parentChain.Add(activity);
            while (activity != null)
            {
                activity = GetParent(activity);
                if (activity != null)
                {
                    IValidationErrorSourceLocator validationErrorSourceLocator = this.GetValidationErrorSourceLocator(activity.GetType());
                    if (validationErrorSourceLocator != null)
                    {
                        validationErrorSourceLocator.ReplaceParentChainWithSource(activity, parentChain);
                    }
                    else
                    {
                        parentChain.Add(activity);
                    }
                }
            }

            parentChain.RemoveAt(0);
            return(parentChain);
        }
 internal void RegisterValidationErrorSourceLocator(Type activityType, IValidationErrorSourceLocator validationErrorSourceLocator)
 {
     if (validationErrorSourceLocator == null)
     {
         throw FxTrace.Exception.ArgumentNull("validationErrorSourceLocator");
     }
     this.ValidationErrorSourceLocators.Add(activityType, validationErrorSourceLocator);
 }
        List <object> GetValidationErrorSourcePath(Activity violatingActivity, object sourceDetail)
        {
            IValidationErrorSourceLocator validationErrorSourceLocator = GetValidationErrorSourceLocator(violatingActivity.GetType());

            if (validationErrorSourceLocator == null)
            {
                return(new List <object> {
                    violatingActivity
                });
            }
            else
            {
                return(validationErrorSourceLocator.FindSourceDetailFromActivity(violatingActivity, sourceDetail));
            }
        }
 internal void RegisterValidationErrorSourceLocator(Type activityType, IValidationErrorSourceLocator validationErrorSourceLocator)
 {
     if (validationErrorSourceLocator == null)
     {
         throw FxTrace.Exception.ArgumentNull("validationErrorSourceLocator");
     }
     this.ValidationErrorSourceLocators.Add(activityType, validationErrorSourceLocator);
 }