Beispiel #1
0
        /// <summary>
        /// Determines whether the <see cref="AsciiColumnType"/> <paramref name="a"/> is compatible with <paramref name="b"/>.
        /// </summary>
        /// <param name="a">First column type.</param>
        /// <param name="b">Second column type.</param>
        /// <returns><c>True</c> if  <see cref="AsciiColumnType"/> <paramref name="a"/> is compatible with <paramref name="b"/>, i.e. values of type <paramref name="a"/> could be stored in columns of type <paramref name="b"/>; otherwise, <c>false</c>.</returns>
        /// <remarks>
        /// <para>The column type <see cref="AsciiColumnType.DBNull"/> is compatible to all other column types.</para>
        /// <para>Since all numeric types will be stored in Double format, all numeric column types are compatible with each other.</para>
        /// </remarks>
        public static bool IsCompatibleWith(AsciiColumnType a, AsciiColumnType b)
        {
            if (a == AsciiColumnType.DBNull || b == AsciiColumnType.DBNull)
            {
                return(true);
            }

            if ((a == AsciiColumnType.Double || a == AsciiColumnType.Int64) &&
                (b == AsciiColumnType.Double || b == AsciiColumnType.Int64))
            {
                return(true);
            }

            return(a == b);
        }
Beispiel #2
0
 private AsciiColumnInfo(AsciiColumnType t, int scoreValue, char shortCut)
 {
     _columnType = t;
     _scoreValue = scoreValue;
     _shortCut   = shortCut;
 }