2 writes to sb
System.Private.CoreLib (2)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (2)
5307sb = new StringBuilder(); 5335sb = null;
64 references to sb
System.Private.CoreLib (64)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (64)
5310sb.AppendLine("<instrumentationManifest xmlns=\"http://schemas.microsoft.com/win/2004/08/events\">"); 5311sb.AppendLine(" <instrumentation xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:win=\"http://manifests.microsoft.com/win/2004/08/windows/events\">"); 5312sb.AppendLine(" <events xmlns=\"http://schemas.microsoft.com/win/2004/08/events\">"); 5313sb.Append($"<provider name=\"{providerName}\" guid=\"{{{providerGuid}}}\""); 5315sb.Append($" resourceFileName=\"{dllName}\" messageFileName=\"{dllName}\""); 5317sb.Append(" symbol=\""); 5318int pos = sb.Length; 5319sb.Append(providerName); // Period and dash are illegal; replace them. 5320sb.Replace('.', '_', pos, sb.Length - pos).Replace("-", "", pos, sb.Length - pos); 5321sb.AppendLine("\">"); 5646sb?.AppendLine(" <channels>"); 5670sb?.Append(" <channel chid=\"").Append(channelInfo.Name).Append("\" name=\"").Append(fullName).Append('"'); 5672WriteMessageAttrib(sb, "channel", channelInfo.Name, null); 5673sb?.Append(" value=\"").Append(channel).Append('"'); 5675sb?.Append(" type=\"").Append(channelType).Append('"'); 5676sb?.Append(" enabled=\"").Append(enabled ? "true" : "false").AppendLine("\"/>"); 5678sb?.AppendLine(" </channels>"); 5684sb?.AppendLine(" <tasks>"); 5690sb?.Append(" <task"); 5691WriteNameAndMessageAttribs(sb, "task", taskTab[task]); 5692sb?.Append(" value=\"").Append(task).AppendLine("\"/>"); 5694sb?.AppendLine(" </tasks>"); 5710sb?.AppendLine(" <maps>"); 5715sb?.Append(" <").Append(mapKind).Append(" name=\"").Append(enumType.Name).AppendLine("\">"); 5740sb?.Append(" <map value=\"0x").Append(hexValueFormatted).Append('"'); 5741WriteMessageAttrib(sb, "map", enumType.Name + "." + staticField.Name, staticField.Name); 5742sb?.AppendLine("/>"); 5751sb?.Append(" <map value=\"0x0\""); 5752WriteMessageAttrib(sb, "map", enumType.Name + ".None", "None"); 5753sb?.AppendLine("/>"); 5755sb?.Append(" </").Append(mapKind).AppendLine(">"); 5757sb?.AppendLine(" </maps>"); 5761sb?.AppendLine(" <opcodes>"); 5767sb?.Append(" <opcode"); 5768WriteNameAndMessageAttribs(sb, "opcode", opcodeTab[opcode]); 5769sb?.Append(" value=\"").Append(opcode).AppendLine("\"/>"); 5771sb?.AppendLine(" </opcodes>"); 5776sb?.AppendLine(" <keywords>"); 5782sb?.Append(" <keyword"); 5783WriteNameAndMessageAttribs(sb, "keyword", keywordTab[keyword]); 5786sb?.Append(" mask=\"0x").Append(keywordFormatted).AppendLine("\"/>"); 5788sb?.AppendLine(" </keywords>"); 5791sb?.AppendLine(" <events>"); 5792sb?.Append(events); 5793sb?.AppendLine(" </events>"); 5795sb?.AppendLine(" <templates>"); 5798sb?.Append(templates); 5804sb?.AppendLine(" <template tid=\"_empty\"></template>"); 5806sb?.AppendLine(" </templates>"); 5808sb?.AppendLine("</provider>"); 5809sb?.AppendLine("</events>"); 5810sb?.AppendLine("</instrumentation>"); 5813sb?.AppendLine("<localization>"); 5820sb?.Append(" <resources culture=\"").Append(ci.Name).AppendLine("\">"); 5821sb?.AppendLine(" <stringTable>"); 5825sb?.Append(" <string id=\"").Append(stringKey).Append("\" value=\"").Append(val).AppendLine("\"/>"); 5827sb?.AppendLine(" </stringTable>"); 5828sb?.AppendLine(" </resources>"); 5830sb?.AppendLine("</localization>"); 5831sb?.AppendLine("</instrumentationManifest>"); 5832return sb?.ToString() ?? ""; 5839WriteMessageAttrib(sb, elementName, name, name);