Example #1
0
		/*----------------------------------------------------------------------------------------*/
		#region Static Methods
		/// <summary>
		/// Retrieves the tag that decorates the specified artifact.
		/// </summary>
		/// <param name="source">The artifact (member or parameter) to retrieve the tag from.</param>
		/// <returns>The artifact's tag, or <see langword="null"/> if it does not have a <see cref="TagAttribute"/>.</returns>
		public static string GetTag(ICustomAttributeProvider source)
		{
			if (source == null)
				return null;

			var attribute = source.GetOneAttribute<TagAttribute>();
			return (attribute == null) ? null : attribute.Tag;
		}
 public static T GetOneAttribute <T>(this ICustomAttributeProvider member)
     where T : Attribute
 {
     return(member.GetOneAttribute <T>(false));
 }