Beispiel #1
0
        void InitializeFromConfiguration(MessageAddressConversionConfiguration configuration)
        {
            Contract.Requires(configuration != null);

            this.topicTemplateTable = new List <UriPathTemplate>();
            this.topicTemplateTable.Add(new UriPathTemplate(configuration.InboundTemplates[0]));
            this.outboundTemplate = configuration.OutboundTemplates.Select(x => new UriPathTemplate(x)).Single();
        }
Beispiel #2
0
        void InitializeFromConfiguration(MessageAddressConversionConfiguration configuration)
        {
            Contract.Requires(configuration != null);

            this.topicTemplateTable = new UriTemplateTable(
                BaseUri,
                from template in configuration.InboundTemplates select new KeyValuePair <UriTemplate, object>(new UriTemplate(template, false), null));
            this.topicTemplateTable.MakeReadOnly(true);
            this.outboundTemplate = configuration.OutboundTemplates.Select(x => new UriPathTemplate(x)).Single();
        }
        void InitializeFromConfiguration(MessageAddressConversionConfiguration configuration)
        {
            Contract.Requires(configuration != null);

            this.topicTemplateTable = new UriTemplateTable(
                BaseUri,
                from template in configuration.InboundTemplates select new KeyValuePair<UriTemplate, object>(new UriTemplate(template, false), null));
            this.topicTemplateTable.MakeReadOnly(true);
            this.outboundTemplate = configuration.OutboundTemplates.Select(x => new UriPathTemplate(x)).Single();
        }
        public bool TryDeriveAddress(IMessage message, out string address)
        {
            UriPathTemplate template = this.outboundTemplate;

            try
            {
                address = template.Bind(message.Properties);
            }
            catch (InvalidOperationException)
            {
                address = null;
                return(false);
            }
            return(true);
        }
 public CommandTopicFormatter(string template)
 {
     this.template = new UriPathTemplate(template);
 }