/// <summary> /// 加载普通资源 /// </summary> /// <param name="name"></param> /// <param name="type"></param> /// <returns></returns> public Object LoadAsset(string name, Type type) { string realname = ""; if (!assetNameMap.TryGetValue(name, out realname)) { var fs = this.AssetBundle.GetAllAssetNames(); if (fs.Length == 1) { realname = fs[0]; } else { var lname = ZString.Concat(name, ".").ToLower(); realname = fs.FirstOrDefault((p) => p.Contains(lname)); } assetNameMap[name] = realname; } if (realname == null) { return(null); } return(this.AssetBundle.LoadAsset(realname, type)); }
/// <summary> /// 加载普通资源 /// </summary> /// <param name="name"></param> /// <param name="type"></param> /// <returns></returns> public Object LoadAsset(string name, Type type) { string fullName = ""; if (!assetNameMap.TryGetValue(name, out fullName)) { var fs = this.AssetBundle.GetAllAssetNames(); if (fs.Length == 1) { fullName = fs[0]; } else { var subPath = ZString.Concat("/", name, "."); fullName = fs.FirstOrDefault((p) => p.Contains(subPath, StringComparison.OrdinalIgnoreCase)); } assetNameMap[name] = fullName; } if (fullName == null) { return(null); } var go = this.AssetBundle.LoadAsset(fullName, type); return(go); }
/// <summary> /// 仿MyBatis CRUD 更符合nameof规范 /// </summary> public TableQueryCustom WhereEqual(string where, object value) { var query = ZString.Format("{0} = {1}", where, value); this.@where = ZString.Concat(this.@where, " ", query); return(this); }
/// <summary> /// 降序排序 /// </summary> public TableQueryForILRuntime OrderByDesc(string field) { var query = ZString.Format(" Order By {0} Desc", field); this.@where = ZString.Concat(this.@where, query); return(this); }
/// <summary> /// 升序排序 /// </summary> public TableQueryCustom OrderBy(string field) { var query = ZString.Format(" Order By {0}", field); this.@where = ZString.Concat(this.@where, query); return(this); }
// /// <summary> // /// 路径合并 // /// 这里是修复Mac下的 Path.Combine的Bug // /// </summary> // /// <param name="a"></param> // /// <param name="b"></param> // /// <returns></returns> // static public string Combine(params string[] paths) // { // var ret = ""; // // for (int i = 0; i < paths.Length-1; i++) // { // ret += Combine(paths[i], paths[i + 1]); // // // } // return ret; // } #endregion #region 路径纠正 /// <summary> /// 添加/ /// </summary> /// <param name="path"></param> /// <returns></returns> static public string AddEndSymbol(string path) { if (!path.EndsWith("/")) { path = ZString.Concat(path, "/"); } return(path); }
/// <inheritdoc/> public string FormatToLink(TypeWithComment thisType, EventInfoWithComment evt, string?displayFormat = null, string?anchorFormat = null) { string?fmt = anchorFormat ?? EventAnchorDefaultFormat; TypeWithComment declaringType = evt.GetDeclaringTypeInfo(); if (object.Equals(thisType, declaringType) || evt.Info.DeclaringType.IsAssignableFrom(thisType.Info) || declaringType.Comment.IsEmpty) { string anchor = evt.Info.Name; string displayText; if (string.IsNullOrEmpty(displayFormat)) { displayText = System.Web.HttpUtility.HtmlEncode(anchor); } else { displayText = ZString.Format(displayFormat, System.Web.HttpUtility.HtmlEncode(anchor)); } if (string.IsNullOrEmpty(fmt)) { return(ZString.Format("[{0}](#{1})", displayText, ToAnchor(anchor))); } else { return(ZString.Format("[{0}](#{1})", displayText, ToAnchor(ZString.Format(fmt, anchor)))); } } else { string anchor = ZString.Concat(declaringType.Info.FormatToReadableTypeName(false), ".", evt.Info.Name); string displayText; if (string.IsNullOrEmpty(displayFormat)) { displayText = System.Web.HttpUtility.HtmlEncode(anchor); } else { displayText = ZString.Format(displayFormat, System.Web.HttpUtility.HtmlEncode(anchor)); } string typeLink = ZString.Format("../{1}/{2}.md", FormatToReadableName(declaringType, false), declaringType.Namespace, declaringType.Name); if (string.IsNullOrEmpty(fmt)) { return(ZString.Format("[{0}]({1}#{2})", displayText, typeLink, ToAnchor(anchor))); } else { return(ZString.Format("[{0}]({1}#{2})", displayText, typeLink, ToAnchor(ZString.Format(fmt, anchor)))); } } }
/// <summary> /// Where语句 /// </summary> /// <param name="where"></param> /// <returns></returns> public TableQueryCustom Where(string where, object value) { if (value is string) { value = ZString.Format("'{0}'", value); } this.@where = ZString.Concat(this.@where, " ", ZString.Format(where, value)); return(this); }
public void ConcatStrings() { var values = new[] { "abc", null, "def" }; var expected = string.Concat(values); ZString.Concat(new ReadOnlySpan <string>(values)).Should().Be(expected); ZString.Concat(values).Should().Be(expected); ZString.Concat(values.ToList()).Should().Be(expected); ZString.Concat(values.AsEnumerable()).Should().Be(expected); }
public static string Concat(string self, params object[] args) { using (ZString.Block()) { if (args != null && args.Length > 0) { ZString @string = self; if (args.Length == 1) { @string = ZString.Concat(self, GetString(args[0])); } else if (args.Length == 2) { @string = ZString.Concat(self, GetString(args[0]), GetString(args[1])); } else if (args.Length == 3) { @string = ZString.Concat(self, GetString(args[0]), GetString(args[1]), GetString(args[2])); } else if (args.Length == 4) { @string = ZString.Concat(self, GetString(args[0]), GetString(args[1]), GetString(args[2]), GetString(args[3])); } else if (args.Length == 5) { @string = ZString.Concat(self, GetString(args[0]), GetString(args[1]), GetString(args[2]), GetString(args[3]), GetString(args[4])); } else if (args.Length == 6) { @string = ZString.Concat(self, GetString(args[0]), GetString(args[1]), GetString(args[2]), GetString(args[3]), GetString(args[4]), GetString(args[5])); } else if (args.Length == 7) { @string = ZString.Concat(self, GetString(args[0]), GetString(args[1]), GetString(args[2]), GetString(args[3]), GetString(args[4]), GetString(args[5]), GetString(args[6])); } else if (args.Length == 8) { @string = ZString.Concat(self, GetString(args[0]), GetString(args[1]), GetString(args[2]), GetString(args[3]), GetString(args[4]), GetString(args[5]), GetString(args[6]), GetString(args[7])); } else if (args.Length == 9) { @string = ZString.Concat(self, GetString(args[0]), GetString(args[1]), GetString(args[2]), GetString(args[3]), GetString(args[4]), GetString(args[5]), GetString(args[6]), GetString(args[7]), GetString(args[8])); } args = null; return(@string); } return(self); } }
/// <summary> /// 获取路径下所有资源 /// </summary> /// <param name="floder"></param> /// <param name="searchPattern"></param> /// <returns></returns> public string[] GetAssets(string floder, string searchPattern = null) { List <string> rets = new List <string>(); string str; str = ZString.Concat(floder, "/"); // if (!this.AssetConfigLoder.IsHashName) // { // str = ZString.Format(DEBUG_RUNTIME, str); // } foreach (var abItem in this.AssetConfigLoder.AssetbundleItemList) { if (abItem.LoadPath.StartsWith(str, StringComparison.OrdinalIgnoreCase)) { rets.Add(abItem.LoadPath); } } //寻找符合条件的 if (!string.IsNullOrEmpty(searchPattern)) { rets = rets.FindAll((r) => { var fileName = Path.GetFileName(r); if (fileName.StartsWith(searchPattern, StringComparison.OrdinalIgnoreCase)) { return(true); } return(false); }); } // if (!this.AssetConfigLoder.IsHashName) // { // var count = "runtime/".Length; // for (int i = 0; i < rets.Count; i++) // { // rets[i] = rets[i].Substring(count); // } // } return(rets.ToArray()); }
/// <summary> /// 获取路径下所有资源 /// </summary> /// <param name="floder"></param> /// <param name="searchPattern"></param> /// <returns></returns> public string[] GetAssets(string floder, string searchPattern = null) { List <string> rets = new List <string>(); string str; str = ZString.Concat(floder, "/"); if (!this.loder.Manifest.IsHashName) { str = ZString.Format(RUNTIME, str); } foreach (var key in this.loder.Manifest.ManifestMap.Keys) { if (key.StartsWith(str, StringComparison.OrdinalIgnoreCase)) { rets.Add(key); } } //寻找符合条件的 if (!string.IsNullOrEmpty(searchPattern)) { rets = rets.FindAll((r) => { var fileName = Path.GetFileName(r); if (fileName.StartsWith(searchPattern, StringComparison.OrdinalIgnoreCase)) { return(true); } return(false); }); } if (!this.loder.Manifest.IsHashName) { var count = "runtime/".Length; for (int i = 0; i < rets.Count; i++) { rets[i] = rets[i].Substring(count); } } return(rets.ToArray()); }
/// <summary> /// 初始化加载Assetbundle的环境 /// 该接口,一般用于测试 /// </summary> /// <param name="abModel"></param> /// <param name="callback"></param> static public void InitLoadAssetBundleEnv(string path, RuntimePlatform platform) { var key = ZString.Concat(path, "_", platform); if (!loaderCacheMap.TryGetValue(key, out var loder)) { ResLoader = new AssetBundleMgrV2(); ResLoader.Init(path, platform); loaderCacheMap[key] = ResLoader; } else { ResLoader = loder; } //初始化对象池 InitObjectPools(); }
/// <summary> /// 路径合并 /// 这里是修复Mac下的 Path.Combine的Bug /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> static public string Combine(string a, string b) { if (string.IsNullOrEmpty(a)) { return(b); } else if (string.IsNullOrEmpty(b)) { return(a); } else if (a.EndsWith("/") || b.StartsWith("/")) //目录格式 { return(ZString.Concat(a, b)); } else { return(ZString.Concat(a, "/", b)); } }
/// <summary> /// 获取资源全路径 /// </summary> /// <param name="loadPath"></param> /// <returns></returns> private string GetAssetLocalPath(string loadPath) { string assetLocalPath = ""; if (!assetLocalNameCacheMap.TryGetValue(loadPath, out assetLocalPath)) { var fs = this.AssetBundle.GetAllAssetNames(); if (fs.Length == 1) { assetLocalPath = fs[0]; } else { var subPath = ZString.Concat("/", loadPath, "."); assetLocalPath = fs.FirstOrDefault((p) => p.Contains(subPath, StringComparison.OrdinalIgnoreCase)); } assetLocalNameCacheMap[loadPath] = assetLocalPath; } return(assetLocalPath); }
/// <summary> /// static constructor /// </summary> static DatadogTracing() { // generate base tag for Kubernetes if (Pripod.Pod.Current.IsRunningOnKubernetes) { var kubeNs = Pripod.Pod.Current.Namespace; // kube_namespace var kubePod = Pripod.Pod.Current.Name; // pod_name var kubeNode = Pripod.Pod.Current.NodeName; // node var kubeStatefulset = Pripod.Pod.Current.StatefulSet.Name; // kube_stateful_set Pripod.Pod.Current.Labels.TryGetValue("app", out var kubeApp); // kube_app // get your annotation values var annotationsKey = "myapp.io"; Pripod.Pod.Current.Annotations.TryGetValue($"{annotationsKey}/build-id", out var kubeBuildId); // build_id Pripod.Pod.Current.Annotations.TryGetValue($"{annotationsKey}/git-branch", out var kubeGitBranch); // git_branch Pripod.Pod.Current.Annotations.TryGetValue($"{annotationsKey}/git-hash", out var kubeGitHash); // git_hash commonTags = new[] { ZString.Concat("is_kubernetes:", Pripod.Pod.Current.IsRunningOnKubernetes), ZString.Concat("kube_namespace:", kubeNs), ZString.Concat("pod_name:", kubePod), ZString.Concat("node:", kubeNode), ZString.Concat("kube_stateful_set:", kubeStatefulset), ZString.Concat("kube_app:", kubeApp), ZString.Concat("build_id:", kubeBuildId), ZString.Concat("git_branch:", kubeGitBranch), ZString.Concat("git_hash:", kubeGitHash), }; } else { commonTags = new[] { ZString.Concat("is_kubernetes:", Pripod.Pod.Current.IsRunningOnKubernetes), }; } }
private string GenerateCommand(string @select, string tablename) { string sqlCmdText = ""; //select where语句 if (string.IsNullOrEmpty(@sql)) { //基本语句 sqlCmdText = ZString.Format("select {0} from {1}", @select, tablename); //Where语句 if (!string.IsNullOrEmpty(@where)) { sqlCmdText = ZString.Concat(sqlCmdText, " where", @where); } //limit语句 if (!string.IsNullOrEmpty(this.limit)) { sqlCmdText = ZString.Concat(sqlCmdText, " Limit ", limit); } } else { //直接执行sql sqlCmdText = @sql; } #if UNITY_EDITOR Debug.Log("sql:" + sqlCmdText); #endif return(sqlCmdText); }
private SQLiteCommand GenerateCommand(string @select, string tablename) { string cmdText = ""; //select where语句 if (@sql == null) { if (!string.IsNullOrEmpty(@where)) { cmdText = ZString.Format("select {0} from {1} where {2}", @select, tablename, @where); //limit语句 if (!string.IsNullOrEmpty(this.limit)) { cmdText = ZString.Concat(cmdText, " Limit ", limit); } } else { cmdText = ZString.Format("select {0} from {1}", @select, tablename); } } else { //直接执行sql cmdText = @sql; } #if UNITY_EDITOR BDebug.Log("sql:" + cmdText); #endif return(Connection.CreateCommand(cmdText)); }
/// <summary> /// 路径合并 /// 这里是修复Mac下的 Path.Combine的Bug /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> static public string Combine(string a, string b) { return(ZString.Concat(a, "/", b)); }
public override int GetHashCode() { return(ZString.Concat(this.LocalPath, "|", this.HashName).GetHashCode()); }
/// <summary> /// Format it to a parameter type name in XML comment signature, like "System.Generic.Collection.IDictionary{`0,``0}". /// </summary> /// <param name="type"></param> /// <param name="typeGenericParameters">The generic arguments of the type in which the specified method is declared.</param> /// <param name="methodGenericParameters">The generic arguments of the specified method.</param> /// <param name="isFullName">A value whether to get the full type name with namespace.</param> /// <param name="inProsessingNesting">A value whether it is processing for a nested type.</param> /// <returns></returns> private static string FormatToXmlCommentTypeNameCore(Type type, Type[] typeGenericParameters, Type[] methodGenericParameters, bool isFullName, bool inProsessingNesting) { if (type.HasElementType) { return(ZString.Concat(FormatToXmlCommentTypeNameCore(type.GetElementType(), typeGenericParameters, methodGenericParameters, isFullName, inProsessingNesting), type.IsArray ? "[]" : "", type.IsByRef ? "@" : "", type.IsPointer ? "*" : "")); } if (type.IsGenericParameter) { int index = Array.IndexOf(typeGenericParameters, type); if (index >= 0) { return($"`{index}"); } index = Array.IndexOf(methodGenericParameters, type); if (index >= 0) { return($"``{index}"); } return(type.Name); } if (type.IsNested && !inProsessingNesting) { if (isFullName) { return(ZString.Concat(FormatToXmlCommentTypeNameCore(type.DeclaringType, typeGenericParameters, methodGenericParameters, true, false), ".", FormatToXmlCommentTypeNameCore(type, typeGenericParameters, methodGenericParameters, false, true))); } else { return(ZString.Concat(FormatToXmlCommentTypeNameCore(type.DeclaringType, typeGenericParameters, methodGenericParameters, false, false), ".", FormatToXmlCommentTypeNameCore(type, typeGenericParameters, methodGenericParameters, false, true))); } } if (!type.IsGenericType) { return(isFullName ? type.FullName : type.Name); } var genericArgs = type.GetGenericArguments().AsSpan(); if (type.IsNested && type.DeclaringType.IsGenericType) { genericArgs = genericArgs.Slice(type.DeclaringType.GetGenericArguments().Length); } var sb = ZString.CreateStringBuilder(); if (isFullName) { sb.Append(type.Namespace); sb.Append("."); } if (genericArgs.Length > 0) { sb.Append(type.Name.Substring(0, type.Name.IndexOf("`"))); } else { sb.Append(type.Name); } if (genericArgs.Length > 0) { if (type.IsConstructedGenericType) { sb.Append("{"); for (int i = 0; i < genericArgs.Length; ++i) { if (i > 0) { sb.Append(","); } sb.Append(genericArgs[i].FormatToXmlCommentParameterTypeName(typeGenericParameters, methodGenericParameters)); } sb.Append("}"); } else { sb.Append("`"); sb.Append(genericArgs.Length); } } return(sb.ToString()); }
/// <summary> /// Format it to a human-readable name, like "SampleClass<T>". /// </summary> /// <param name="type"></param> /// <param name="isFullName">A value whether to get the full type name with namespace.</param> /// <param name="inProsessingNesting">A value whether it is processing for a nested type.</param> /// <returns></returns> private static string FormatToReadableTypeNameCore(Type type, bool isFullName, bool inProsessingNesting) { if (type.HasElementType) { return(ZString.Concat(FormatToReadableTypeNameCore(type.GetElementType(), isFullName, inProsessingNesting), type.IsArray ? "[]" : "", type.IsByRef ? "" : "", type.IsPointer ? "" : "")); } if (type.IsGenericParameter) { return(type.Name); } if (type == typeof(void)) { return("void"); } if (type == typeof(string)) { return("string"); } if (type == typeof(char)) { return("char"); } if (type == typeof(bool)) { return("bool"); } if (type == typeof(byte)) { return("byte"); } if (type == typeof(short)) { return("short"); } if (type == typeof(int)) { return("int"); } if (type == typeof(long)) { return("long"); } if (type == typeof(float)) { return("float"); } if (type == typeof(double)) { return("double"); } if (type == typeof(decimal)) { return("decimal"); } if (type == typeof(sbyte)) { return("sbyte"); } if (type == typeof(ushort)) { return("ushort"); } if (type == typeof(uint)) { return("uint"); } if (type == typeof(ulong)) { return("ulong"); } if (type == typeof(char?)) { return("char?"); } if (type == typeof(bool?)) { return("bool?"); } if (type == typeof(byte?)) { return("byte?"); } if (type == typeof(short?)) { return("short?"); } if (type == typeof(int?)) { return("int?"); } if (type == typeof(long?)) { return("long?"); } if (type == typeof(float?)) { return("float?"); } if (type == typeof(double?)) { return("double?"); } if (type == typeof(decimal?)) { return("decimal?"); } if (type == typeof(sbyte?)) { return("sbyte?"); } if (type == typeof(ushort?)) { return("ushort?"); } if (type == typeof(uint?)) { return("uint?"); } if (type == typeof(ulong?)) { return("ulong?"); } if (type == typeof(object)) { return("object"); } if (type.IsNested && !inProsessingNesting) { if (isFullName) { return(ZString.Concat(FormatToReadableTypeNameCore(type.DeclaringType, true, false), ".", FormatToReadableTypeNameCore(type, false, true))); } else { return(ZString.Concat(FormatToReadableTypeNameCore(type.DeclaringType, false, false), ".", FormatToReadableTypeNameCore(type, false, true))); } } if (!type.IsGenericType) { return(isFullName ? type.FullName : type.Name); } var definition = type.GetGenericTypeDefinition(); if (definition == typeof(Nullable <>)) { return(ZString.Concat(FormatToReadableTypeName(type.GetGenericArguments()[0], isFullName), "?")); } if (!isFullName) { if (definition == typeof(ValueTuple <,>) || definition == typeof(ValueTuple <, ,>) || definition == typeof(ValueTuple <, , ,>) || definition == typeof(ValueTuple <, , , ,>) || definition == typeof(ValueTuple <, , , , ,>) || definition == typeof(ValueTuple <, , , , , ,>) || definition == typeof(ValueTuple <, , , , , , ,>) ) { string valueTypeToString(Type type) { var arguments = type.GetGenericArguments(); var sb = ZString.CreateStringBuilder(); sb.Append("("); for (int i = 0; i < arguments.Length; ++i) { if (i > 0) { sb.Append(", "); } sb.Append(FormatToReadableTypeName(arguments[i], false)); } sb.Append(")"); return(sb.ToString()); }; return(valueTypeToString(type)); } } var genericArgs = type.GetGenericArguments().AsSpan(); if (type.IsNested && type.DeclaringType.IsGenericType) { genericArgs = genericArgs.Slice(type.DeclaringType.GetGenericArguments().Length); } var sb = ZString.CreateStringBuilder(); if (isFullName) { sb.Append(type.Namespace); sb.Append("."); } if (genericArgs.Length > 0) { sb.Append(type.Name.Substring(0, type.Name.IndexOf("`"))); } else { sb.Append(type.Name); } if (genericArgs.Length > 0) { sb.Append("<"); for (int i = 0; i < genericArgs.Length; ++i) { if (i > 0) { sb.Append(", "); } sb.Append(genericArgs[i].FormatToReadableTypeName(isFullName)); } sb.Append(">"); } return(sb.ToString()); }
/// <summary> /// Where语句 /// </summary> /// <param name="where"></param> /// <returns></returns> public TableQueryCustom Where(string where) { this.@where = ZString.Concat(this.@where, " ", where); // string.Format((" " + where), where); return(this); }
public string ZStringConcat() { return(ZString.Concat("x:", x, " y:", y, " z:", z)); }
public void CooncatNullTest() { var str = ZString.Concat(default(string), "foo", "bar"); str.Should().Be(string.Concat(default(string), "foo", "bar")); }
/// <inheritdoc/> public string ReplaceReferenceTag(TypeWithComment thisType, string text) { if (string.IsNullOrEmpty(text)) { return(""); } if (text.Contains("<see")) { text = Regex.Replace(text, @"<see cref=""(?<cref>([T|F|P|M|E]:[^\""]*))""\s*(/>|>(?<text>[^<]*)</see>)", m => ZString.Concat(" ", ResolveSeeElement(thisType, m), " ")); } if (text.Contains("<seealso")) { text = Regex.Replace(text, @"<seealso cref=""(?<cref>([T|F|P|M|E]:[^\""]*))""\s*(/>|>(?<text>[^<]*)</seealso>)", m => ZString.Concat(" ", ResolveSeeElement(thisType, m), " ")); } if (text.Contains("<paramref")) { text = Regex.Replace(text, @"<paramref name=""(?<name>([^\""]*))""\s*(/>|>(?<text>[^<]*)</paramref>)", m => ZString.Concat(" ", ResolveNameElement(thisType, m), " ")); } if (text.Contains("<typeparamref")) { text = Regex.Replace(text, @"<typeparamref name=""(?<name>([^\""]*))""\s*(/>|>(?<text>[^<]*)</paramref>)", m => ZString.Concat(" ", ResolveNameElement(thisType, m), " ")); } return(text); }
/// <summary> /// 获取enum的key /// </summary> /// <param name="enum"></param> /// <returns></returns> private string GetEnumKey(Enum @enum) { var key = ZString.Concat(@enum.GetType().FullName, ".", @enum.ToString()); return(key); }
public string FullKey(string keySuffix) => KeyPrefix.IsNullOrEmpty() ? keySuffix : keySuffix.IsNullOrEmpty() ? KeyPrefix : ZString.Concat(KeyPrefix, '.', keySuffix);
/// <summary> /// 路径合并 /// 这里是修复Mac下的 Path.Combine的Bug /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> static public string Combine(string a, string b, string c, string d) { return(ZString.Concat(a, "/", b, "/", c, "/", d)); }
/// <summary> /// Creates a list that stores information for the properties. /// </summary> /// <returns></returns> private List <PropertyInfoWithComment> CreatePropertyList() { List <PropertyInfoWithComment> list = new List <PropertyInfoWithComment>(); Dictionary <string?, XmlComment> comments = new Dictionary <string?, XmlComment>(); if (m_CommentLookup != null) { foreach (var comment in m_CommentLookup[Info.FormatToXmlCommentTypeName()].Where(x => x.Kind == XmlCommentKind.Property)) { if (string.IsNullOrEmpty(comment.MethodArguments)) { comments.Add(comment.MemberName, comment); } else { // indexer comments.Add(ZString.Concat(comment.MemberName, comment.MethodArguments), comment); } } } foreach (var prop in Info.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.GetProperty | BindingFlags.SetProperty)) { if (Context.PropertyFilter != null && !Context.PropertyFilter(prop)) { continue; } var name = ZString.CreateStringBuilder(); name.Append(prop.Name); var parameters = prop.GetIndexParameters(); if (parameters != null && parameters.Length > 0) { name.Append("("); for (int i = 0; i < parameters.Length; ++i) { if (i > 0) { name.Append(","); } Type[] typeGenerigArgs = Type.EmptyTypes; if (prop.DeclaringType.IsGenericType) { typeGenerigArgs = prop.DeclaringType.GetGenericArguments(); } name.Append(parameters[i].ParameterType.FormatToXmlCommentParameterTypeName(typeGenerigArgs, Type.EmptyTypes)); } name.Append(")"); } comments.TryGetValue(name.ToString(), out var comment); list.Add(new PropertyInfoWithComment(prop, comment, Context)); } list.Sort((a, b) => a.Info.FormatToReadableSignature().CompareTo(b.Info.FormatToReadableSignature())); return(list); }