示例#1
0
        private static SinkDefinition GetSinkDefinition(MessageSink sink)
        {
            var definition = new SinkDefinition();

            definition.Id   = string.Format("sink{0}", DateTime.Now.Ticks);
            definition.Type = sink.GetType().AssemblyQualifiedName;
            LoadPropertyValues(definition, sink);
            return(definition);
        }
示例#2
0
        public MessageSink ResolveSink(string name)
        {
            SinkDefinition sink    = Sinks[name];
            TypeCreator    creator = new TypeCreator(sink.Type);

            foreach (var formatterProperty in sink.Properties)
            {
                creator.MemberValues.Add(formatterProperty.Key, formatterProperty.Value);
            }

            return((MessageSink)creator.Create());
        }