GetExtra() public method

public GetExtra ( string field ) : string
field string
return string
Esempio n. 1
0
        public static string DoReplaceForExtraValueCode(string text, Person p)
        {
            const string RE = @"{ev:(?<name>.+?)}";

            var re    = new Regex(RE, RegexOptions.Singleline | RegexOptions.Multiline);
            var match = re.Match(text);

            while (match.Success)
            {
                var tag  = match.Value;
                var name = match.Groups["name"].Value;

                if (p == null)
                {
                    text = text.Replace(tag, "");
                }
                else
                {
                    text = text.Replace(tag, p.GetExtra(name));
                }

                match = match.NextMatch();
            }
            return(text);
        }
Esempio n. 2
0
        public static string DoReplaceForExtraValueCode(string text, Person p)
        {
            const string RE = @"{ev:(?<name>.+?)}";

            var re = new Regex(RE, RegexOptions.Singleline | RegexOptions.Multiline);
            var match = re.Match(text);
            while (match.Success)
            {
                var tag = match.Value;
                var name = match.Groups["name"].Value;

                if (p == null)
                    text = text.Replace(tag, "");
                else
                    text = text.Replace(tag, p.GetExtra(name));
                match = match.NextMatch();
            }
            return text;
        }