Ejemplo n.º 1
0
 /// <summary>
 /// Creates a nullable type reference.
 /// </summary>
 public static ParameterizedTypeReference Create(ITypeReference elementType)
 {
     if (elementType == null)
     {
         throw new ArgumentNullException(nameof(elementType));
     }
     return(new ParameterizedTypeReference(KnownTypeReference.Get(KnownTypeCode.NullableOfT), new[] { elementType }));
 }
Ejemplo n.º 2
0
 public static bool IsKnownType(this TopLevelTypeName typeName, KnownTypeCode knownType)
 {
     return(typeName == KnownTypeReference.Get(knownType).TypeName);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a reference to the specified type.
 /// </summary>
 /// <param name="typeCode">The type to be converted.</param>
 /// <returns>Returns the type reference.</returns>
 public static ITypeReference ToTypeReference(this TypeCode typeCode)
 {
     return(KnownTypeReference.Get((KnownTypeCode)typeCode));
 }
Ejemplo n.º 4
0
		public static bool IsKnownType(this FullTypeName typeName, KnownTypeCode knownType)
		{
			return typeName == KnownTypeReference.Get(knownType).TypeName;
		}