Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="replaceInfo"></param>
        /// <param name="value"></param>
        private void ReplaceWithFormat(ObjectMessageReplaceInfo replaceInfo, object value)
        {
            if (value is IFormattable formattable)
            {
                var text = formattable.ToString(replaceInfo.Format, null);
                InternalReplace(replaceInfo, text);
                return;
            }

            InternalReplace(replaceInfo, value.ToSafeString());
        }
Beispiel #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="replaceInfo"></param>
 /// <param name="value"></param>
 private void InternalReplace(ObjectMessageReplaceInfo replaceInfo, string value)
 {
     Builder.Message = Builder.Message.Replace(replaceInfo.Replacement, value);
 }