/// <summary> /// Adds a global (applicable to all interfaces) routing rule. /// </summary> /// <typeparam name="T">Type of the rule.</typeparam> /// <param name="constructor">Delegate that constructs a new instance of the rule.</param> /// <param name="condition">Condition which must be true for the rule to be added to the chain.</param> public void AddRule <T>(Func <IRuleCreationContext, T> constructor, Func <IRuleCreationContext, bool> condition = null) where T : IRule { Chains.AddRule(constructor, condition); }