Example #1
0
        /// <summary>
        /// Pads data if needed (depending on data type).
        /// </summary>
        /// <param name="data">the string to pad</param>
        /// <param name="field">The corresponding <see cref="FieldInformation"/> object</param>
        /// <returns>Padded data if needed, else filtered data</returns>
        private string padout(string data, FieldInformation field)
        {
            var rslt = !padData ? data : data.Pad(field.DisplayWidth, field.IsNumber).NoControl();

            //return (VerifyQuote(rslt, '"', '"').NoControl());
            return(rslt.Replace(quote, "''")); // adptation for mystash
        }
Example #2
0
 /// <summary>
 /// Gets the field value.
 /// </summary>
 /// <param name="info">The field info.</param>
 /// <param name="row">The row.</param>
 /// <returns>value as object</returns>
 protected object GetFieldValue(FieldInformation info, T row)
 {
     try
     {
         if (info.GetFieldCallback != null)
         {
             // caller supplied a callback to get the value
             return(info.GetFieldCallback(info, row));
         }
         return(info.IsProperty
                    ? info.ProInfo.GetValue(row, null)
                    : info.FieldInfo.GetValue(row));
     }
     catch (Exception e)
     {
         throw new EnaxosExportException(string.Format(AppResources.ExportBase_GetFieldValue_Can_t_read_property__0_, info.Name), e);
     }
 }