public override ExtractStatus Extract(ExcelFileReader recordSource)
        {
            dynamic v = null;

            try
            {
                v          = recordSource.Extract(this.ColumnNo);
                this.Value = (V)v;
            }
            catch (Exception exc)
            {
                throw new Exception(this.FieldInfo + " value=" + (v == null ? "[null]" : "\"" + v.ToString() + "\""), exc);
            }

            return(null == this.PropertySetter ? ExtractStatus.Success : this.PropertySetter(this, this.Target, this.Value));
        }
Ejemplo n.º 2
0
        public override ExtractStatus Extract(ExcelFileReader recordSource)
        {
            dynamic v = null;

            try
            {
                v          = recordSource.Extract(this.ColumnNo);
                this.Value = (V)v;
            }
            catch (Exception exc)
            {
                throw new Exception(this.FieldInfo + " value=" + (v == null ? "[null]" : "\"" + v.ToString() + "\""), exc);
            }


            ExtractStatus r = ExtractStatus.Success;

            if (null == this.InstanceCreator)
            {
                if (this.Value.Equals(SignatureValue))
                {
                    if (this.Target == null)
                    {
                        this.Target = new T();
                    }
                }
                else
                {
                    return(ExtractStatus.ValueMismatched);
                }
            }
            else
            {
                this.Target = this.InstanceCreator(this, this.Value);
            }
            return(r);
        }