Esempio 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);
        }
Esempio 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);
 }
Esempio 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)));
 }
Esempio 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));
        }