Ejemplo n.º 1
0
        /// <summary>
        /// Gets the field value.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="fieldName">Name of the field.</param>
        /// <returns></returns>
        public static object GetFieldValue(this TableDef table, string fieldName, TableDef localizationTable)
        {
            object value = null;

            if (table == null)
            {
                throw new ArgumentNullException("table");
            }
            if (localizationTable != null)
            {
                value = localizationTable.GetFieldValue <string>(fieldName);
            }
            if (value == null)
            {
                value = table.GetFieldValue <string>(fieldName);
            }
            return(value);
        }
Ejemplo n.º 2
0
 public static T GetFieldValue <T>(this TableDef table, string fieldName, TableDef localizationTable)
 {
     return((T)table.GetFieldValue(fieldName, localizationTable));
 }