37 references to Clamp
aspire (6)
Commands\ApiSearchCommand.cs (1)
67var limit = Math.Clamp(parseResult.GetValue(s_limitOption) ?? 5, 1, 10);
Commands\DocsSearchCommand.cs (1)
59var limit = Math.Clamp(parseResult.GetValue(s_limitOption) ?? 5, 1, 10);
Mcp\Tools\SearchDocsTool.cs (1)
76topK = Math.Clamp(topKValue, 1, 10);
Utils\ConsoleActivityLogger.cs (3)
699var pointIndex = Math.Clamp((int)Math.Round((startPosition + endPosition) / 2, MidpointRounding.AwayFromZero), 0, width - 1); 704var startIndex = Math.Clamp((int)Math.Floor(startPosition), 0, width - 1); 705var endIndex = Math.Clamp((int)Math.Ceiling(endPosition), startIndex, width - 1);
aspire-tray (8)
TrayApplication.SettingsAppearance.cs (4)
94_settingsScrollPosition = Math.Clamp(_settingsScrollPosition, 0, _settingsScrollMaximum); 105var x = Math.Clamp(window.Left, monitor.Work.Left, Math.Max(monitor.Work.Left, monitor.Work.Right - width)); 106var y = Math.Clamp(window.Top, monitor.Work.Top, Math.Max(monitor.Work.Top, monitor.Work.Bottom - height)); 150position = Math.Clamp(position, 0, _settingsScrollMaximum);
TrayApplication.Tooltips.cs (4)
110var x = Math.Clamp(bounds.Left, monitor.Work.Left, Math.Max(monitor.Work.Left, monitor.Work.Right - (bounds.Right - bounds.Left))); 111var y = Math.Clamp(bounds.Top, monitor.Work.Top, Math.Max(monitor.Work.Top, monitor.Work.Bottom - (bounds.Bottom - bounds.Top))); 138var x = Math.Clamp(last.Left, monitor.Work.Left, Math.Max(monitor.Work.Left, monitor.Work.Right - width)); 145y = Math.Clamp(y, monitor.Work.Top, Math.Max(monitor.Work.Top, monitor.Work.Bottom - height));
Aspire.Dashboard (3)
Components\Layout\TerminalDock.razor.cs (3)
217_maximumHeightPx = Math.Clamp(viewportHeightPx, 1, MaximumHeightPx); 218_heightPx = Math.Clamp(heightPx, EffectiveMinimumHeightPx, _maximumHeightPx); 444? _terminals[Math.Clamp(previousActiveIndex, 0, _terminals.Count - 1)].TerminalId
Aspire.Hosting (1)
ApplicationModel\ResourceAnnotationCollection.cs (1)
126index = Math.Clamp(index, 0, _items.Length);
ILCompiler.ReadyToRun (1)
parent\parent\Common\CallingConvention\ArgIterator.cs (1)
932align = Math.Clamp(_argTypeHandle.GetFieldAlignment(), 8, 16);
Microsoft.AspNetCore.Components.AI (1)
Components\MessageListContext.cs (1)
122$"h{Math.Clamp(heading.Level, 1, 6)}",
Microsoft.Diagnostics.DataContractReader.Contracts (1)
parent\parent\parent\parent\coreclr\tools\Common\CallingConvention\ArgIterator.cs (1)
932align = Math.Clamp(_argTypeHandle.GetFieldAlignment(), 8, 16);
System.Diagnostics.TextWriterTraceListener (1)
System\Diagnostics\XmlWriterTraceListener.cs (1)
231InternalWrite(Math.Clamp((int)eventType, 0, 255));
System.Private.CoreLib (5)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
649public static int Clamp(int value, int min, int max) => Math.Clamp(value, min, max);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.DecimalIeee754.cs (1)
3895return new decimal(0, 0, 0, decoded.Signed, (byte)Math.Clamp(-decoded.UnbiasedExponent, 0, 28));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Parsing.cs (1)
834value = new decimal(0, 0, 0, sign, (byte)Math.Clamp(-e, 0, 28));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (2)
484int rentalLength = Math.Clamp(buffer.Length, MinWriteRentedArraySize, MaxWriteRentedArraySize); 560int rentalLength = Math.Clamp(remainingOuterEncodedBytes.Length, MinWriteRentedArraySize, MaxWriteRentedArraySize);
System.Windows.Forms (8)
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\PopupButtonDarkModeRenderer.cs (1)
202int radius = Math.Clamp(
System\Windows\Forms\Controls\ComboBox\ComboBox.ModernComboAdapter.cs (1)
497=> Math.Clamp(
System\Windows\Forms\Controls\GroupBox\GroupBox.Modern.cs (1)
529=> Math.Clamp(
System\Windows\Forms\Printing\PrintPreviewControl.cs (2)
788_hScrollBar.Value = Math.Clamp(value.X, _hScrollBar.Minimum, _hScrollBar.Maximum); 789_vScrollBar.Value = Math.Clamp(value.Y, _vScrollBar.Minimum, _vScrollBar.Maximum);
System\Windows\Forms\Rendering\Button\PopupButtonKeyCapRenderer.cs (3)
755int borderWidth = Math.Clamp(context.BorderWidth + defaultBorderIncrease, 0, maxBorder); 870int innerShadowAlpha = Math.Clamp( 872int innerLightAlpha = Math.Clamp(
System.Windows.Forms.Primitives (1)
System\Windows\Forms\Internals\ScaleHelper.cs (1)
283textScale = Math.Clamp(
Terminals.AppHost (1)
TerminalInteractionCommands.cs (1)
319limit = Math.Clamp(limit, 2, 1_000_000);