示例#1
0
        /// <summary>
        ///     Finds the name of the field that has been assigned the <paramref name="modelName" /> that is within the specified
        ///     <paramref name="source" />.
        /// </summary>
        /// <param name="source">The table.</param>
        /// <param name="modelName">The field model name.</param>
        /// <param name="throwException">
        ///     if set to <c>true</c> if an exception should be thrown when the model name is not
        ///     assigned.
        /// </param>
        /// <returns>
        ///     Returns a <see cref="string" /> representing the name of the field that is assigned the field model name.
        /// </returns>
        /// <exception cref="MissingFieldModelNameException"></exception>
        public static string GetFieldName(this ITable source, string modelName, bool throwException)
        {
            if (source == null)
            {
                return(null);
            }
            IObjectClass table = source as IObjectClass;

            if (table == null)
            {
                return(null);
            }

            return(table.GetFieldName(modelName, throwException));
        }
示例#2
0
 /// <summary>
 ///     Returns the name of the field that is assigned the <paramref name="modelName" /> on the <paramref name="source" />.
 /// </summary>
 /// <param name="source">The object class.</param>
 /// <param name="modelName">The field model name.</param>
 /// <returns>
 ///     Returns a <see cref="string" /> representing the name of the field, otherwise <c>null</c>.
 /// </returns>
 /// <exception cref="ArgumentNullException">modelName</exception>
 /// <exception cref="MissingFieldModelNameException"></exception>
 public static string GetFieldName(this IObjectClass source, string modelName)
 {
     return(source.GetFieldName(modelName, true));
 }