15 writes to Capacity
dotnet-svcutil-lib (1)
FrameworkFork\Microsoft.Xml\Xml\BufferBuilder.cs (1)
329_stringBuilder.Capacity = _length;
Microsoft.AspNetCore.Routing (2)
UriBuildingContext.cs (2)
202_path.Capacity = 128; 208_query.Capacity = 128;
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
177sb.Capacity = Threshold;
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
177sb.Capacity = Threshold;
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
177sb.Capacity = Threshold;
Microsoft.Extensions.Logging.Console (2)
ConsoleLogger.cs (2)
68sb.Capacity = 1024; 98sb.Capacity = 1024;
PresentationCore (4)
System\Windows\Media\Animation\Clock.cs (2)
4176Capacity = 1024 4204builder.Capacity = 1024;
System\Windows\Media\Animation\Timeline.cs (2)
966Capacity = 1024 985builder.Capacity = 1024;
System.ComponentModel.TypeConverter (1)
System\ComponentModel\MaskedTextProvider.cs (1)
428_testString.Capacity = _testString.Length;
System.Data.Odbc (1)
System\Data\Odbc\Odbc32.cs (1)
739message.Capacity = cchActual + 1;
System.Private.CoreLib (1)
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (1)
308Capacity = capacity;
88 references to Capacity
Microsoft.AspNetCore.Routing (2)
UriBuildingContext.cs (2)
199if (_path.Capacity > 128) 206if (_query.Capacity > 128)
Microsoft.Build (1)
Logging\BaseConsoleLogger.cs (1)
1218if (shared.Capacity < capacity)
Microsoft.Build.Framework (16)
ReuseableStringBuilder.cs (10)
192_borrowedWithCapacity = _borrowedBuilder.Capacity; 269else if (returned.Capacity < capacity) 275MSBuildEventSource.Log.ReusableStringBuilderFactoryStart(hash: returned.GetHashCode(), newCapacity: newCapacity, oldCapacity: returned.Capacity, type: "miss-need-bigger"); 284MSBuildEventSource.Log.ReusableStringBuilderFactoryStart(hash: returned.GetHashCode(), newCapacity: capacity, oldCapacity: returned.Capacity, type: "hit"); 315if (returningBuilder.Capacity > MaxBuilderSizeCapacity) 319MSBuildEventSource.Log.ReusableStringBuilderFactoryStop(hash: returningBuilder.GetHashCode(), returningCapacity: returningBuilder.Capacity, returningLength: returningLength, type: "discard"); 324if (returningBuilder.Capacity != returning._borrowedWithCapacity) 326Debug.Assert(returningBuilder.Capacity > returning._borrowedWithCapacity, "Capacity can only increase"); 333int newCapacity = SelectBracketedCapacity(returningBuilder.Capacity); 348MSBuildEventSource.Log.ReusableStringBuilderFactoryStop(hash: returningBuilder.GetHashCode(), returningCapacity: returningBuilder.Capacity, returningLength: returningLength, type: returning._borrowedBuilder != returningBuilder ? "return-new" : "return");
StringBuilderCache.cs (6)
50if (capacity <= sb.Capacity) 54MSBuildEventSource.Log.ReusableStringBuilderFactoryStart(hash: sb.GetHashCode(), newCapacity: capacity, oldCapacity: sb.Capacity, type: "sbc-hit"); 63MSBuildEventSource.Log.ReusableStringBuilderFactoryStart(hash: stringBuilder.GetHashCode(), newCapacity: capacity, oldCapacity: stringBuilder.Capacity, type: "sbc-miss"); 88if (sb.Capacity <= MAX_BUILDER_SIZE) 96MSBuildEventSource.Log.ReusableStringBuilderFactoryStop(hash: sb.GetHashCode(), returningCapacity: sb.Capacity, returningLength: sb.Length, type: sb.Capacity <= MAX_BUILDER_SIZE ? "sbc-return" : "sbc-discard");
Microsoft.CodeAnalysis (1)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (1)
39if (builder.Capacity <= 1024)
Microsoft.CodeAnalysis.CodeStyle (2)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (1)
39if (builder.Capacity <= 1024)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
175if (sb.Capacity > Threshold)
Microsoft.CodeAnalysis.Collections.Package (1)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (1)
39if (builder.Capacity <= 1024)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
SourceGeneration\GeneratorDriverTests.cs (1)
3407Assert.True(capacity >= builder.Capacity);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (2)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (1)
39if (builder.Capacity <= 1024)
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.cs (1)
196hr = importHolder.Value.GetFieldProps(fieldToken, out _, sb, sb.Capacity, out _, out _, out _, out _, out _, out _, out _);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (2)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (1)
39if (builder.Capacity <= 1024)
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.cs (1)
196hr = importHolder.Value.GetFieldProps(fieldToken, out _, sb, sb.Capacity, out _, out _, out _, out _, out _, out _, out _);
Microsoft.CodeAnalysis.PooledObjects.Package (1)
PooledStringBuilder.cs (1)
39if (builder.Capacity <= 1024)
Microsoft.CodeAnalysis.Threading.Package (1)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (1)
39if (builder.Capacity <= 1024)
Microsoft.CodeAnalysis.Workspaces (2)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (1)
39if (builder.Capacity <= 1024)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
175if (sb.Capacity > Threshold)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (1)
39if (builder.Capacity <= 1024)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (1)
175if (sb.Capacity > Threshold)
Microsoft.Extensions.Logging.Console (2)
ConsoleLogger.cs (2)
66if (sb.Capacity > 1024) 96if (sb.Capacity > 1024)
Microsoft.Extensions.ObjectPool (3)
ObjectPoolProviderExtensions.cs (1)
28/// <param name="maximumRetainedCapacity">The maximum value for <see cref="StringBuilder.Capacity"/> that is allowed to be
StringBuilderPooledObjectPolicy.cs (2)
20/// Gets or sets the maximum value for <see cref="StringBuilder.Capacity"/> that is allowed to be 35if (obj.Capacity > MaximumRetainedCapacity)
Microsoft.VisualBasic.Forms (2)
Microsoft\VisualBasic\Interaction.vb (2)
160appTitleLength = NativeMethods.GetWindowText(windowHandle, appTitleBuilder, appTitleBuilder.Capacity) 179appTitleLength = NativeMethods.GetWindowText(windowHandle, appTitleBuilder, appTitleBuilder.Capacity)
MSBuildTaskHost (2)
StringBuilderCache.cs (2)
50if (capacity <= sb.Capacity) 88if (sb.Capacity <= MAX_BUILDER_SIZE)
PresentationCore (2)
System\Windows\Automation\Peers\GenericRootAutomationPeer.cs (1)
45UnsafeNativeMethods.GetWindowText(new HandleRef(null, hwnd), sb, sb.Capacity);
System\Windows\Media\GlyphsSerializer.cs (1)
56* _glyphStringBuider.Capacity
PresentationFramework (18)
Microsoft\Win32\CommonItemDialog.cs (1)
672sb.Capacity /* max # of chars to copy before truncation occurs */
MS\Internal\AppModel\ShellProvider.cs (1)
955HRESULT hr = NativeMethods2.SHGetFolderPathEx(ref knownFolder, 0, IntPtr.Zero, pathBuilder, (uint)pathBuilder.Capacity);
MS\Win32\UxThemeWrapper.cs (2)
257if (UnsafeNativeMethods.GetCurrentThemeName(themeNameSB, themeNameSB.Capacity, 258themeColorSB, themeColorSB.Capacity,
System\Windows\Automation\Peers\WindowAutomationPeer.cs (1)
38UnsafeNativeMethods.GetWindowText(new HandleRef(null, window.Handle), sb, sb.Capacity);
System\Windows\Shell\JumpList.cs (7)
1017shellLink.GetPath(pathBuilder, pathBuilder.Capacity, null, SLGP.RAWPATH); 1019shellLink.GetArguments(argsBuilder, argsBuilder.Capacity); 1021shellLink.GetDescription(descBuilder, descBuilder.Capacity); 1024shellLink.GetIconLocation(iconBuilder, iconBuilder.Capacity, out iconIndex); 1026shellLink.GetWorkingDirectory(dirBuilder, dirBuilder.Capacity); 1065shellLink.GetPath(pathBuilder, pathBuilder.Capacity, null, SLGP.RAWPATH); 1081shellLink.GetArguments(argsBuilder, argsBuilder.Capacity);
System\Windows\Standard\NativeMethods.cs (6)
2660_GetCurrentThemeName(fileNameBuilder, fileNameBuilder.Capacity, 2661colorBuilder, colorBuilder.Capacity, 2662sizeBuilder, sizeBuilder.Capacity) 2685int size = _GetModuleFileName(hModule, buffer, buffer.Capacity); 2693if (size == buffer.Capacity) 2696buffer.EnsureCapacity(buffer.Capacity * 2);
ReachFramework (2)
MS\Internal\Printing\Configuration\COMPSTUISRID.cs (1)
38int charCount = UnsafeNativeMethods.LoadStringW(handle, srid, resString, resString.Capacity);
PrintSystemExceptions\PrintSystemException.cs (1)
275win32ErrorMessage.Capacity,
System.Data.Odbc (1)
System\Data\Odbc\Odbc32.cs (1)
737if ((SQLRETURN.SUCCESS_WITH_INFO == retcode) && (message.Capacity - 1 < cchActual))
System.Net.Http (2)
src\libraries\Common\src\System\Text\StringBuilderCache.cs (2)
29if (capacity <= sb.Capacity) 44if (sb.Capacity <= MaxBuilderSize)
System.Net.Primitives (2)
src\libraries\Common\src\System\Text\StringBuilderCache.cs (2)
29if (capacity <= sb.Capacity) 44if (sb.Capacity <= MaxBuilderSize)
System.Private.CoreLib (11)
src\libraries\Common\src\System\Text\StringBuilderCache.cs (2)
29if (capacity <= sb.Capacity) 44if (sb.Capacity <= MaxBuilderSize)
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (7)
229info.AddValue(CapacityField, Capacity); 279if (Capacity != value) 306if (Capacity < capacity) 310return Capacity; 417int capacityToPreserve = Math.Min(Capacity, Math.Max(Length * 6 / 5, m_ChunkChars.Length)); 840throw new ArgumentOutOfRangeException(nameof(Capacity), SR.ArgumentOutOfRange_Capacity); 2548Debug.Assert(Capacity == Length, nameof(ExpandByABlock) + " should only be called when there is no space left.");
src\System\StubHelpers.cs (1)
1031int pManagedHomeCapacity = pManagedHome.Capacity;
src\System\Text\StringBuilder.CoreCLR.cs (1)
17int newCapacity = Capacity;
System.Private.Xml (2)
src\libraries\Common\src\System\Text\StringBuilderCache.cs (2)
29if (capacity <= sb.Capacity) 44if (sb.Capacity <= MaxBuilderSize)
System.Private.Xml.Linq (2)
src\libraries\Common\src\System\Text\StringBuilderCache.cs (2)
29if (capacity <= sb.Capacity) 44if (sb.Capacity <= MaxBuilderSize)
System.Reflection.Metadata (1)
System\Reflection\Internal\Utilities\PooledStringBuilder.cs (1)
38if (builder.Capacity <= 1024)
UIAutomationClientSideProviders (2)
MS\Internal\AutomationProxies\Misc.cs (1)
1168ProxySendMessage(hwnd, NativeMethods.WM_GETTEXT, (IntPtr)str.Capacity, str);
MS\Internal\AutomationProxies\WindowsAltTab.cs (1)
240cchItemText = (uint)itemText.Capacity;