Exemplo n.º 1
0
 /// <summary>
 /// Returns whether the column type <paramref name="colType"/> can be bound to field <paramref name="memberInfo"/>.
 /// They must both be vectors or scalars, and the raw data kind should match.
 /// </summary>
 private static bool IsCompatibleType(ColumnType colType, MemberInfo memberInfo)
 {
     InternalSchemaDefinition.GetVectorAndKind(memberInfo, out bool isVector, out DataKind kind);
     if (isVector)
     {
         return(colType.IsVector && colType.ItemType.RawKind == kind);
     }
     else
     {
         return(!colType.IsVector && colType.RawKind == kind);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Returns whether the column type <paramref name="colType"/> can be bound to field <paramref name="fieldInfo"/>.
        /// They must both be vectors or scalars, and the raw data kind should match.
        /// </summary>
        private static bool IsCompatibleType(ColumnType colType, FieldInfo fieldInfo)
        {
            bool     isVector;
            DataKind kind;

            InternalSchemaDefinition.GetVectorAndKind(fieldInfo, out isVector, out kind);
            if (isVector)
            {
                return(colType.IsVector && colType.ItemType.RawKind == kind);
            }
            else
            {
                return(!colType.IsVector && colType.RawKind == kind);
            }
        }