/// <summary> /// 属性格式化语法糖 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="value">字符串</param> /// <param name="source">资源</param> /// <returns></returns> public static string PropSugar <T>(this string value, T source) where T : class { if (source is null) { throw new ArgumentNullException(nameof(source)); } return(PatternProperty.Replace(value, match => { return Nested <T> .Invoke(source, match.Groups["name"].Value); })); }