public void handle(Sendable s) { EbXmlMessage ebxml = (EbXmlMessage)s; ITKDistributionEnvelopeAttachment a = (ITKDistributionEnvelopeAttachment)ebxml.Attachments[ITKATTACHMENT]; DistributionEnvelope d = a.DistributionEnvelope; IDistributionEnvelopeHandler h = null; try { h = handlers[d.getService()]; } catch (KeyNotFoundException) { EventLog logger = new EventLog("Application"); logger.Source = LOGSOURCE; StringBuilder sb = new StringBuilder("No explicit handler found for "); sb.Append(d.getService()); sb.Append(" using default DefaultFileSaveDistributionEnvelopeHandler instead"); logger.WriteEntry(sb.ToString(), EventLogEntryType.Warning); h = new DefaultFileSaveDistributionEnvelopeHandler(); } h.handle(d); }
/** * Add an IDistributionEnvelopeHandler implementation, against the given ITK service name. */ public void addHandler(string s, IDistributionEnvelopeHandler h) { handlers.Add(s, h); }
/** * Add an IDistributionEnvelopeHandler implementation, against the given ITK service name. */ public void addHandler(string s, IDistributionEnvelopeHandler h) { handlers.Add(s, h); }