/**
  * Construct the AckDistributionEnvelope as an acknowledgment to the given
  * DistributionEnvelope.
  */
 public AckDistributionEnvelope(DistributionEnvelope d)
     : base()
 {
     Address[] a = new Address[1];
     a[0] = d.getSender();
     setTo(a);
     String id = null;
     String snd = null;
     try
     {
         Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
         id = config.AppSettings.Settings[AUDIT_ID_PROPERTY].Value;
         snd = config.AppSettings.Settings[SENDER_PROPERTY].Value;
     }
     catch (Exception e)
     {
         throw new DistributionEnvelopeException("SYST-0000", "Configuration manager exception", e.ToString());
     }
     Address sndr = new Address(snd);
     Identity[] auditId = new Identity[1];
     auditId[0] = new Identity(id);
     setAudit(auditId);
     setSender(sndr);
     setService(SERVICE);
     setTrackingId(d.getTrackingId());
     serviceRef = d.getService();
 }
 private Entity makeEntity(bool addr, String[] f)
 {
     Entity e = null;
     if (addr) {
         if (f[1].Length > 0) {
             e = new Address(f[2], f[1]);
         } else {
             e = new Address(f[2]);
         }
     } else {
         if (f[1].Length > 0) {
             e = new Identity(f[2], f[1]);
         } else {
             e = new Identity(f[2]);
         }
     }
     return e;
 }
 /**
  * Called by the DistributionEnvelopeHelper to set the recipients list
  * after it has been parsed out of the received DistributionEnvelope
  * XML.
  *
  * @param t[] Address instances.
  */
 internal void setTo(Address[] t)
 {
     if (t == null)
     {
         return;
     }
     for (int i = 0; i < t.Length; i++)
     {
         recipients.Add(t[i]);
     }
 }
 /**
  * Called by the DistributionEnvelopeHelper to set the sender address
  * after it has been parsed out of the received DistributionEnvelope
  * XML.
  *
  * @param t Sender Address.
  */
 internal void setSender(Address a)
 {
     sender = a;
 }
 /**
  * (This should probably be called setSender()) Used by the
  * sender to set the sender address. Any address type may
  * be entered, described by the appropriate OID. Where the OID is
  * null, the default "ITK address" is supplied.
  *
  * @param oid OID for the address type, or null
  * @param id Address
  */
 public void addSender(String oid, String id)
 {
     Address a = null;
     if (oid == null) {
         a = new Address(id);
     } else {
         a = new Address(oid, id);
     }
     sender = a;
 }
 /**
  * Used by senders to add recipient addresses. Any address type may
  * be entered, described by the appropriate OID. Where the OID is
  * null, the default "ITK address" is supplied.
  *
  * @param oid OID for the address type, or null
  * @param id Address
  */
 public void addRecipient(String oid, String id)
 {
     Address a = null;
     if (oid == null) {
         a = new Address(id);
     } else {
         a = new Address(id, oid);
     }
     recipients.Add(a);
 }