public override void Insert(TextFileWriter writer)
 {
     if (null == this.PropertyGetter)
     {
         writer.Append(new string(' ', this.Length));
     }
     else
     {
         this.Value = this.PropertyGetter(this, this.Target);
         try
         {
             writer.Append(this.FieldType.FormatFixedLengthValue(this.Value, this.Length));
         }
         catch (Exception exc)
         {
             throw new Exception(this.FieldInfo + ": \"" + this.Value + "\" : " + exc.ToString());
         }
     }
 }
Exemple #2
0
        public override void Insert(TextFileWriter writer)
        {
            if (null != this.Target && null != this.PropertyGetter)
            {
                this.Value = this.PropertyGetter(this, this.Target);
            }
            else
            {
                this.Value = this.SignatureValue;
            }

            writer.Append(this.FieldType.FormatFixedLengthValue(this.Value, this.Length));
        }
Exemple #3
0
 public override void Insert(TextFileWriter writer)
 {
     if (null == this.PropertyGetter)
     {
         this.Value = null;
         writer.Append(new string(' ', this.Length));
     }
     else
     {
         this.Value = this.PropertyGetter(this, this.Target);
         if (null == this.SignatureMapper)
         {
             throw new Exception(this.FieldInfo + " - Signature field mapper is empty.");
         }
         this.SignatureMapper.Target = this.Value;
         this.SignatureMapper.Insert(writer);
         base.Insert(writer);
     }
 }
        public override void Insert(TextFileWriter writer)
        {
            if (null != this.Target && null != this.PropertyGetter)
            {
                this.Value = this.PropertyGetter(this, this.Target);
            }

            if (null == this.Value)
            {
                writer.Append(new string(' ', this.Length));
            }
            else
            {
                foreach (FixedLengthFieldMapper <V> f in this.FieldMappers)
                {
                    f.Target = this.Value;
                    f.Insert(writer);
                }
            }
            this.Value = null;
        }