Exemplo n.º 1
0
 public static int NormalizeDataTypeId(ProjectConverter P, int dataType)
 {
     if (dataType == 0)
     {
         return(EplSystemId.DataType_Int);
     }
     if (EplSystemId.IsLibDataType(dataType) && dataType != P.DataTypeId_IntPtr)
     {
         EplSystemId.DecomposeLibDataTypeId(dataType, out var libId, out var typeId);
         try
         {
             if (P.Libs[libId].DataType[typeId].IsEnum)
             {
                 return(EplSystemId.DataType_Int);
             }
         }
         catch (Exception)
         {
         }
         try
         {
             if (P.EocLibs[libId].Enum.ContainsKey(P.Libs[libId].DataType[typeId].Name))
             {
                 return(EplSystemId.DataType_Int);
             }
         }
         catch (Exception)
         {
         }
     }
     return(dataType);
 }
Exemplo n.º 2
0
 public int TranslateDataTypeId(int dataType)
 {
     if (dataType == 0)
     {
         return(EplSystemId.DataType_Int);
     }
     if (EplSystemId.IsLibDataType(dataType))
     {
         EplSystemId.DecomposeLibDataTypeId(dataType, out var libId, out var typeId);
         try
         {
             if (EocLibs[libId].Enum.ContainsKey(Libs[libId].DataType[typeId].Name))
             {
                 return(EplSystemId.DataType_Int);
             }
         }
         catch (Exception)
         {
         }
     }
     return(dataType);
 }