AspectSharp.Core.Matchers.SingleTypeMatcher.Match C# (CSharp) Method

Match() public method

public Match ( Type targetType, AspectSharp.Lang.AST.AspectDefinition aspect ) : bool
targetType System.Type
aspect AspectSharp.Lang.AST.AspectDefinition
return bool
		public bool Match(Type targetType, AspectDefinition aspect)
		{
			Type type = GetTypeToCompare(aspect);

			if (type.IsGenericTypeDefinition && targetType.IsGenericType)
			{
				type = type.MakeGenericType(targetType.GetGenericArguments());
			}

			if (type.IsAssignableFrom(targetType))
			{
				return true;
			}

			return false;
		}