Exemplo n.º 1
0
        private void ReplaceLink(string linkType, string regex, Func <string, Guid, string, string> transform)
        {
            var regEx = new Regex(regex);
            var links = regEx.Matches(_template);

            foreach (Match link in links)
            {
                var splitted = link.Value.Split(new string[] { "}}" }, StringSplitOptions.None);
                var value    = splitted[0].Split(':')[1].Replace("&lt;", "<").Replace("&gt;", ">");
                var guid     = _repository.GetGuidByIdentifier(value);

                _template = _template.Replace(splitted[0] + "}}", transform(linkType, guid, value));
            }
        }