예제 #1
0
        /// <summary>
        /// Perform path expansion substitutions
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="model">The model.</param>
        /// <param name="host">View engine host</param>
        /// <returns>Template with paths expanded</returns>
        private static string PerformPathSubstitutions(string template, object model, IViewEngineHost host)
        {
            var result = template;

            result = PathExpansionRegEx.Replace(
                result,
                m =>
            {
                var path = m.Groups["Path"].Value;

                return(host.ExpandPath(path));
            });

            result = AttributeValuePathExpansionRegEx.Replace(
                result,
                m =>
            {
                var attribute = m.Groups["Attribute"];
                var quote     = m.Groups["Quote"].Value;
                var path      = m.Groups["Path"].Value;

                var expandedPath = host.ExpandPath(path);

                return(string.Format("{0}={1}{2}{1}", attribute, quote, expandedPath));
            });

            return(result);
        }
        /// <summary>
        /// Perform path expansion substitutions
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="model">The model.</param>
        /// <param name="host">View engine host</param>
        /// <returns>Template with paths expanded</returns>
        private static string PerformPathSubstitutions(string template, object model, IViewEngineHost host)
        {
            var result = template;

            result = PathExpansionRegEx.Replace(
                result,
                m =>
            {
                var path = m.Groups["Path"].Value;

                return(host.ExpandPath(path));
            });

            return(result);
        }
예제 #3
0
        /// <summary>
        /// Perform path expansion substitutions
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="model">The model.</param>
        /// <param name="host">View engine host</param>
        /// <returns>Template with paths expanded</returns>
        private static string PerformPathSubstitutions(string template, object model, IViewEngineHost host)
        {
            var result = template;

            result = PathExpansionRegEx.Replace(
                result,
                m =>
                {
                    var path = m.Groups["Path"].Value;

                    return host.ExpandPath(path);
                });

            return result;
        }
예제 #4
0
        /// <summary>
        /// Perform path expansion substitutions
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="model">The model.</param>
        /// <param name="host">View engine host</param>
        /// <returns>Template with paths expanded</returns>
        private static string PerformPathSubstitutions(string template, object model, IViewEngineHost host)
        {
            var result = template;

            result = PathExpansionRegEx.Replace(
                result,
                m =>
                {
                    var path = m.Groups["Path"].Value;

                    return host.ExpandPath(path);
                });

            result = AttributeValuePathExpansionRegEx.Replace(
                result,
                m =>
                {
                    var attribute = m.Groups["Attribute"];
                    var quote = m.Groups["Quote"].Value;
                    var path = m.Groups["Path"].Value;

                    var expandedPath = host.ExpandPath(path);

                    return string.Format("{0}={1}{2}{1}", attribute, quote, expandedPath);
                });

            return result;
        }