Exemple #1
0
        /// <summary>
        /// Resolve placeholder value and format.
        /// </summary>
        /// <param name="target">Target data context.</param>
        /// <returns>Formatted string.</returns>
        public string ResolveTemplate(object target)
        {
            var raw = JObjectHelper.GetValueFromAnonym(target, parameterPath);

            raw = ApplyTrimCommand(raw);
            return(ApplyModifier(raw, modifier));
        }
Exemple #2
0
        /// <summary>
        /// Evaluates the condition.
        /// </summary>
        /// <param name="target">Data context.</param>
        /// <returns>Evaluated conditional at the data context.</returns>
        public bool Evaluate(object target)
        {
            switch (comparer)
            {
            case ConditionalComparer.Equals:
                return(JObjectHelper.GetValueFromAnonym(target, parameterPath) == value);

            case ConditionalComparer.Different:
                return(JObjectHelper.GetValueFromAnonym(target, parameterPath) != value);
            }

            return(true);
        }