Esempio n. 1
0
 /// <summary>
 /// Returns a bool indicating whether a rule is contained in this conditional traffic splitter
 /// </summary>
 /// <param name="tsr">The rule to search for</param>
 /// <returns>A bool indicating whether a rule is contained in this conditional traffic splitter</returns>
 public bool ContainsRule(TrafficSplitterRule tsr)
 {
     lock (tsrRules)
     {
         return(tsrRules.Contains(tsr));
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Removes a rule from this conditional traffic splitter
 /// </summary>
 /// <param name="tsr">The rule to remove</param>
 public void RemoveRule(TrafficSplitterRule tsr)
 {
     lock (tsrRules)
     {
         tsrRules.Remove(tsr);
         InvokeExternalAsync(RuleRemoved, new TrafficRuleEventArgs(tsr));
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Adds a rule to this conditional traffic splitter
 /// </summary>
 /// <param name="tsr">The rule to add</param>
 public void AddRule(TrafficSplitterRule tsr)
 {
     lock (tsrRules)
     {
         tsrRules.Add(tsr);
         InvokeExternalAsync(RuleAdded, new TrafficRuleEventArgs(tsr));
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Creates a new instance of this class.
 /// </summary>
 /// <param name="tsrRule">The rule associated with the event</param>
 public TrafficRuleEventArgs(TrafficSplitterRule tsrRule)
 {
     this.tsrRule = tsrRule;
 }
Esempio n. 5
0
 /// <summary>
 /// Checks whether a given child condition is contained by this condition.
 /// </summary>
 /// <param name="cChild">The child to check for.</param>
 /// <returns>A bool indicating whether a given child condition is contained by this condition.</returns>
 public bool ContainsChildRule(TrafficSplitterRule cChild)
 {
     lock (lChildRules) { return(lChildRules.Contains(cChild)); }
 }
Esempio n. 6
0
 /// <summary>
 /// Removes the given child condition.
 /// </summary>
 /// <param name="cChild">The child to remove</param>
 public void RemoveChildRule(TrafficSplitterRule cChild)
 {
     lock (lChildRules) { lChildRules.Remove(cChild); }
 }
Esempio n. 7
0
 /// <summary>
 /// Adds a child condition to this rule.
 /// Actions of child rules are ignored, but they are validated and the result is and-conjuncted with the result of the parent rule.
 /// <br />
 /// If there are multiple child rules, and the result of at least one child rule is true, and the result of this rule is true, the end result is true.<br />
 /// If there are multiple child rules, and the result of all child rules is false, the end result is flase.<br />
 /// If the result of this rule is false, the end result is false.<br />
 /// </summary>
 /// <param name="cChild"></param>
 public void AddChildRule(TrafficSplitterRule cChild)
 {
     lock (lChildRules) { lChildRules.Add(cChild); }
 }