Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>

        public static string Evaluate(string str, PropertyGetValueDelegate getValueDel, PropertyContainsKeyDelegate containsKeyDel)
        {
            string tmp = str;

            if ((getValueDel != null) && (containsKeyDel != null))
            {
                getValue    = getValueDel;
                containsKey = containsKeyDel;

                do
                {
                    replaceCount = 0;
                    tmp          = regExFindVars.Replace(tmp, new MatchEvaluator(ReplaceVariableMatch));
                } while (replaceCount > 0);
            }
            return(tmp);
        }
Пример #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>

        public static string Evaluate(string str, PropertyGetValueDelegate getValueDel, PropertyContainsKeyDelegate containsKeyDel)
        {
            string tmp = str;

            if ((getValueDel != null) && (containsKeyDel != null))
            {
                getValue = getValueDel;
                containsKey = containsKeyDel;

                do
                {
                    replaceCount = 0;
                    tmp = regExFindVars.Replace(tmp, new MatchEvaluator(ReplaceVariableMatch));
                } while (replaceCount > 0);
            }
            return tmp;
        }