Ejemplo n.º 1
0
        /// <summary>Update the <see cref="Value"/> with the given tokens.</summary>
        /// <param name="context">The condition context.</param>
        /// <returns>Returns whether the value changed.</returns>
        public bool UpdateContext(ConditionContext context)
        {
            string prevValue = this.Value;

            this.Value = this.Apply(this.Raw, context.Values);
            return(this.Value != prevValue);
        }
Ejemplo n.º 2
0
 /// <summary>Whether the condition matches.</summary>
 /// <param name="context">The condition context.</param>
 public bool IsMatch(ConditionContext context)
 {
     foreach (string conditionValue in context.GetValues(this.Key))
     {
         if (this.Values.Contains(conditionValue))
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 3
0
 /// <summary>Whether the condition matches.</summary>
 /// <param name="context">The condition context.</param>
 public bool IsMatch(ConditionContext context)
 {
     return(context
            .GetValues(this.Key)
            .Any(p => this.Values.Contains(p)));
 }
Ejemplo n.º 4
0
        /// <summary>Whether the condition matches.</summary>
        /// <param name="context">The condition context.</param>
        public bool IsMatch(ConditionContext context)
        {
            string contextValue = context.GetValue(this.Key);

            return(this.Values.Contains(contextValue));
        }