예제 #1
0
        /// <summary>
        /// Interpolates the text with the named instance
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="namedInstance">The named instance.</param>
        /// <param name="ignoreErrors">if set to <c>true</c> [ignore errors].</param>
        /// <returns>System.String.</returns>
        public static string InterpolateWith(this string text, NamedInstance namedInstance, bool ignoreErrors = false)
        {
            var namedInstances = new List <NamedInstance>()
            {
                namedInstance
            };

            return(InterpolateWithAll(text, namedInstances, ignoreErrors));
        }
예제 #2
0
        /// <summary>
        /// Interpolates the text with the optionally named instance
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="instance">The instance.</param>
        /// <param name="namePrefix">The name prefix.</param>
        /// <param name="ignoreErrors">if set to <c>true</c> [ignore errors].</param>
        /// <returns>System.String.</returns>
        public static string InterpolateWith(this string text, object instance, string namePrefix = null, bool ignoreErrors = false)
        {
            var namedInstance = new NamedInstance(instance, namePrefix);

            return(InterpolateWith(text, namedInstance, ignoreErrors));
        }