/// <summary>Accepts the specified visitor.</summary>
 /// <param name="attributes">The attributes to be visited.</param>
 /// <param name="memberType">Type of the member.</param>
 /// <param name="visitor">The visitor.</param>
 /// <param name="templateMapping">Template mapping to be amended by visitor.</param>
 /// <param name="descriptionContext">Description context.</param>
 public static void Accept(
     this IEnumerable<ServerBehaviorAttribute> attributes,
     Type memberType,
     IServerBehaviorAttributeVisitor visitor, 
     IIriTemplateMapping templateMapping, 
     DescriptionContext descriptionContext)
 {
     foreach (var attribute in attributes)
     {
         attribute.GetType().GetMethod("Accept", BindingFlags.Instance | BindingFlags.Public)
             .MakeGenericMethod(memberType).Invoke(attribute, new object[] { visitor, templateMapping, descriptionContext });
     }
 }
Example #2
0
 /// <summary>Accepts the specified visitor.</summary>
 /// <param name="attributes">The attributes to be visited.</param>
 /// <param name="memberType">Type of the member.</param>
 /// <param name="visitor">The visitor.</param>
 /// <param name="templateMapping">Template mapping to be amended by visitor.</param>
 /// <param name="descriptionContext">Description context.</param>
 public static void Accept(
     this IEnumerable <ServerBehaviorAttribute> attributes,
     Type memberType,
     IServerBehaviorAttributeVisitor visitor,
     IIriTemplateMapping templateMapping,
     DescriptionContext descriptionContext)
 {
     foreach (var attribute in attributes)
     {
         attribute.GetType().GetMethod("Accept", BindingFlags.Instance | BindingFlags.Public)
         .MakeGenericMethod(memberType).Invoke(attribute, new object[] { visitor, templateMapping, descriptionContext });
     }
 }
Example #3
0
        /// <inheritdoc />
        public override void Accept <T>(IServerBehaviorAttributeVisitor visitor, IIriTemplateMapping templateMapping, DescriptionContext descriptionContext)
        {
            if (visitor == null)
            {
                throw new ArgumentNullException("visitor");
            }

            if (templateMapping == null)
            {
                throw new ArgumentNullException("templateMapping");
            }

            visitor.Visit <T>(this, templateMapping, descriptionContext);
        }
Example #4
0
 /// <summary>Accepts the specified visitor.</summary>
 /// <typeparam name="T">Type of member visited.</typeparam>
 /// <param name="visitor">The visitor.</param>
 /// <param name="templateMapping">Template mapping to be amended by visitor.</param>
 /// <param name="descriptionContext">Description context.</param>
 public abstract void Accept <T>(IServerBehaviorAttributeVisitor visitor, IIriTemplateMapping templateMapping, DescriptionContext descriptionContext);