예제 #1
0
 /// -----------------------------------------------------------------------------------------------
 /// <summary>
 ///     Gets the Format String attribute from the Enum Value
 /// </summary>
 /// <param name="format">NumberFormats</param>
 /// <returns>string</returns>
 /// -----------------------------------------------------------------------------------------------
 private string GetAttribute(NumberFormats format)
 {
     try
     {
         var type         = format.GetType();
         var fi           = type.GetField(format.ToString());
         var formatString = fi.GetCustomAttributes(typeof(FormatString), false) as FormatString[];
         if (formatString != null)
         {
             return(formatString[0].Value);
         }
     }
     catch (Exception ex)
     {
         Log.Error("SpreadsheetLightWrapper.Export.Exporter.GetAttribute -> " + ex.Message + ": " + ex);
     }
     return(null);
 }