Пример #1
0
 /// <summary>
 /// Check if every types used in the defintion of a type is supported (or about to be). If not, it makes sur they are implemented after.
 /// </summary>
 /// <param name="type"></param>
 /// <param name="addUsing"></param>
 /// <returns></returns>
 internal bool AnalyzeFullType(TypeReference type, bool addUsing = true)
 {
     if (addUsing)
     {
         AddUsing(type.Namespace);
     }
     if (type.IsGenericInstance)
     {
         GenericInstanceType instanceType = (GenericInstanceType)type;
         bool isTypeKnown = analyzeHelpher._coreSupportedMethods.ContainsType(instanceType.ElementType.Name, instanceType.ElementType.Namespace) || analyzeHelpher.IsTypeSupported(type) || IsTypeGoingToBeImplemented(instanceType.ElementType) || AnalysisUtils.IsDefaultValueType(instanceType.ElementType.FullName);
         if (!isTypeKnown)
         {
             AddTypeToImplement(instanceType.ElementType);
         }
         IEnumerable <TypeReference> genericArgsTypes = instanceType.GenericArguments;
         foreach (TypeReference genericArgType in genericArgsTypes)
         {
             bool isCurrentGParamKnown = AnalyzeFullType(genericArgType);
         }
         return(isTypeKnown);
     }
     else if (type.IsGenericParameter)
     {
         return(false);
     }
     else
     {
         bool isTypeKnown = analyzeHelpher._coreSupportedMethods.ContainsType(type.Name, type.Namespace) || analyzeHelpher.IsTypeSupported(type) || IsTypeGoingToBeImplemented(type) || AnalysisUtils.IsDefaultValueType(type.FullName);
         if (!isTypeKnown)
         {
             AddTypeToImplement(type);
         }
         return(isTypeKnown);
     }
 }