Ejemplo n.º 1
0
 public static DotNetType MakeAsync(DotNetType dotNetType)
 {
     if (dotNetType.IsVoid)
     {
         return(new DotNetType(typeof(Task).FullName));
     }
     else
     {
         return(new DotNetType(typeof(Task).FullName, false, true, new DotNetType[] { dotNetType }));
     }
 }
Ejemplo n.º 2
0
 public override bool Equals(object obj)
 {
     if (obj is DotNetType)
     {
         DotNetType input  = (DotNetType)obj;
         bool       result = input.Name == Name && input.IsArray == IsArray &&
                             input.IsGeneric == IsGeneric && input.IsVoid == IsVoid &&
                             input.GenericTypeArguments?.Length == GenericTypeArguments?.Length;
         if (result)
         {
             for (int i = 0; i < GenericTypeArguments.Length; i++)
             {
                 if (input.GenericTypeArguments[i]?.Equals(GenericTypeArguments[i]) != true)
                 {
                     return(false);
                 }
             }
         }
         return(result);
     }
     return(false);
 }
Ejemplo n.º 3
0
 public static DotNetType MakeIEnumerable(DotNetType dotNetType)
 {
     return(new DotNetType("System.Collections.Generic.IEnumerable", false, true, new DotNetType[] { dotNetType }));
 }
Ejemplo n.º 4
0
 public static DotNetType MakeNullable(DotNetType dotNetType)
 {
     return(new DotNetType("System.Nullable", false, true, new DotNetType[] { dotNetType }));
 }