public MessageContext(Message message, AMessageModule module) { msg = message; mdl = module; // Populate config lookup cfg = new Dictionary <string, ANamable>(); if (mdl != null) { foreach (var c in mdl.InventoryByBase <ANamable>()) { cfg.TryAdd(c.Name, c); } } // Populate fam lookup fam = new Dictionary <string, Message>(); var current = message; while (current != null) { if (!fam.ContainsKey(current.Name)) { fam.Add(current.Name, current); } current = current.DerivedFrom; } }
/// <summary> /// Add a module upstream /// </summary> /// <param name="module">Module.</param> /// <remarks>This is used when constructing pipelines in code, not /// when deserialising them.</remarks> public static void AddUpstream(this AMessageModule parent, AMessageModule module) { if (parent.Upstreams == null) { parent.Upstreams = new List <AMessageModule>(); } parent.Upstreams.Add(module); }
public MessageContext(Message message, AMessageModule module) { msg = message; mdl = module; _cfgMutex.WaitOne(); if (cfg == null) { cfg = ANamable.InventoryByBase <ANamable>().ToDictionary(x => x.Name); } _cfgMutex.ReleaseMutex(); }
public MessageContext(Message message, AMessageModule module, Match match) : this(message, module) { rgx = match; }