using System; using iTextSharp.text; using Spring.Objects; using Sleis.Utility; using iTextSharp.text.pdf; using log4net; namespace Sleis.Pdf { public class ObjectValueParser : ElementWriter, IElementWriter { //public readonly ILog LOG = LogManager.GetLogger(typeof(ObjectValueParser)); public string Format { get; set; } //public string Select { get; set; } /* public void Init() { ArgumentValidationUtility.ThrowOnEmpty(Select, "Select"); if (String.IsNullOrEmpty(Format)) { Format = "{0}"; } } */ public string Make(ObjectWrapper context) { LOG.Debug("Init Make"); object selectionValue = null; try { selectionValue = context.GetPropertyValue(Select); } catch (Exception err) { LOG.Debug(String.Format("Error getting accessing {0} : {1}", Select, err.Message)); return null; }//swallowed return String.Format(Format, selectionValue); } } }