Ejemplo n.º 1
0
 public static IMethodName Method([NotNull] string input)
 {
     try
     {
         var ctx = TypeNameParseUtil.ValidateMethodName(input);
         if (ctx.UNKNOWN() != null)
         {
             return(UnknownName.Get(typeof(IMethodName)));
         }
         return(new MethodName(ctx));
     }
     catch (Exception)
     {
         try
         {
             var ctx = TypeNameParseUtil.ValidateMethodName(CsNameFixer.HandleOldMethodNames(input));
             if (ctx.UNKNOWN() != null)
             {
                 return(UnknownName.Get(typeof(IMethodName)));
             }
             return(new MethodName(ctx));
         }
         catch (Exception)
         {
             return(UnknownName.Get(typeof(IMethodName)));
         }
     }
 }
Ejemplo n.º 2
0
 public static IAssemblyName Assembly(string input)
 {
     try
     {
         var ctx = TypeNameParseUtil.ValidateAssemblyName(input);
         return(new AssemblyName(ctx));
     }
     catch (Exception)
     {
         return(UnknownName.Get(typeof(IAssemblyName)));
     }
 }
Ejemplo n.º 3
0
 public static INamespaceName Namespace(string input)
 {
     try
     {
         var ctx = TypeNameParseUtil.ValidateNamespaceName(input);
         return(new NamespaceName(ctx));
     }
     catch (Exception)
     {
         return(UnknownName.Get(typeof(INamespaceName)));
     }
 }
Ejemplo n.º 4
0
 public static IParameterName Parameter(string input)
 {
     try
     {
         var ctx = TypeNameParseUtil.ValidateParameterName(input);
         return(new ParameterName(ctx));
     }
     catch (AssertException)
     {
         return(UnknownName.Get(typeof(IParameterName)));
     }
 }
Ejemplo n.º 5
0
 private static MemberName GetMemberName(string input)
 {
     try
     {
         var ctx = TypeNameParseUtil.ValidateMemberName(input);
         if (ctx.UNKNOWN() == null)
         {
             return(new MemberName(ctx));
         }
         return(null);
     }
     catch (AssertException)
     {
         return(null);
     }
 }
Ejemplo n.º 6
0
 public static ILambdaName GetLambdaName(string input)
 {
     try
     {
         var ctx = TypeNameParseUtil.ValidateLambdaName(input);
         if (ctx.UNKNOWN() != null)
         {
             return(UnknownName.Get(typeof(ILambdaName)));
         }
         return(new LambdaName(ctx));
     }
     catch (AssertException)
     {
         return(UnknownName.Get(typeof(ILambdaName)));
     }
 }
Ejemplo n.º 7
0
        public static IName ArrayType([NotNull] string input)
        {
            var ctx = TypeNameParseUtil.ValidateTypeName(input);

            return(new ArrayTypeName(ctx));
        }