812 references to Min
mscorlib (17)
system\Collections\Concurrent\ConcurrentQueue.cs (2)
930return Math.Min(m_low, SEGMENT_SIZE); 944return Math.Min(m_high, SEGMENT_SIZE - 1);
system\collections\concurrent\PartitionerStatic.cs (1)
471requestedChunkSize = Math.Min(m_currentChunkSize.Value * 2, m_maxChunkSize);
system\diagnostics\eventing\eventsource.cs (2)
2148paramCount = Math.Min(paramCount, eventDataCount); 3095dataDescrs[1].Size = (uint)Math.Min(dataLeft, chunkSize);
system\io\bufferedstream.cs (2)
182Byte[] shadowBuffer = new Byte[Math.Min(_bufferSize + _bufferSize, MaxShadowBufferSize)]; 828Int32 bytesToWrite = Math.Min(_bufferSize - _writePos, count);
system\runtime\serialization\formatters\binary\binaryformatterwriter.cs (1)
407int numArrayItems = Math.Min(chunkSize/typeLength, array.Length-arrayOffset);
system\runtime\serialization\formatters\binary\binaryparser.cs (1)
1031int numArrayItems = Math.Min(chunkSize/typeLength, array.Length-arrayOffset);
system\string.cs (2)
274int length = Math.Min(strA.Length, strB.Length); 467int length = Math.Min(strA.Length, strB.Length);
system\text\stringbuilder.cs (5)
171capacity = Math.Min(DefaultCapacity, maxCapacity); 1644int endInChunk = Math.Min(chunk.m_ChunkLength, endIndexInChunk); 1825int lengthToCopy = Math.Min(lengthInChunk, count); 1977int newBlockLength = Math.Max(minBlockCharCount, Math.Min(Length, MaxChunkSize)); 2060int copyCount1 = Math.Min(count, indexInChunk);
system\threading\Tasks\Parallel.cs (1)
139rval = (rval == -1) ? schedulerMax : Math.Min(schedulerMax, rval);
PresentationBuildTasks (2)
Core\CSharp\System\Windows\Media\ParsersCommon.cs (2)
382_curIndex = Math.Min(_curIndex+8, _pathLength); // "Infinity" has 8 characters 392_curIndex = Math.Min(_curIndex+3, _pathLength); // "NaN" has 3 characters
PresentationCore (56)
Core\CSharp\MS\Internal\FontCache\FontCacheUtil.cs (1)
890int minLength = Math.Min(aLength, bLength);
Core\CSharp\MS\Internal\FontCache\FontFaceLayoutInfo.cs (1)
1021int smaller = Math.Min(lastChar, firstChar);
Core\CSharp\MS\Internal\Generic\Span.cs (1)
511_cp = Math.Min(cp, _dcp);
Core\CSharp\MS\Internal\IListConverters.cs (4)
111List<double> list = new List<double>(Math.Min(256, value.Length / EstimatedCharCountPerItem + 1)); 154List<ushort> list = new List<ushort>(Math.Min(256, value.Length / EstimatedCharCountPerItem + 1)); 195List<bool> list = new List<bool>(Math.Min(256, value.Length / EstimatedCharCountPerItem + 1)); 237List<Point> list = new List<Point>(Math.Min(256, value.Length / EstimatedCharCountPerItem + 1));
Core\CSharp\MS\Internal\Ink\Renderer.cs (1)
586i = Math.Min(_visuals.Count, _strokes.Count); //not -1, we're about to decrement
Core\CSharp\MS\Internal\IO\Packaging\NetStream.cs (2)
167count = Math.Min(bytesAvailable, count); // don't return more than they requested, and don't return more than is available 795bytesAvailable = Math.Min(block.Length, (int)(data.End - block.Offset));
Core\CSharp\MS\Internal\Shaping\TypefaceMap.cs (3)
193cch = Math.Min(cch, itemSpanRider.Length); 194cch = Math.Min(cch, typefaceIndexSpanRider.Length); 405int cch = Math.Min(unicodeString.Length - ich, typefaceSpanRider.Length);
Core\CSharp\MS\Internal\TextFormatting\Bidi.cs (3)
1629((Math.Min(startOfNeutrals, startOfDelayed) == PositionInvalid) ? 1631(Math.Min(startOfNeutrals, startOfDelayed))); 1862cchText = Math.Min(cchText, index);
Core\CSharp\MS\Internal\TextFormatting\FormatSettings.cs (1)
181formatWidth = Math.Min(formatWidth, Constants.IdealInfiniteWidth);
Core\CSharp\MS\Internal\TextFormatting\FullTextLine.cs (5)
1417offsetToNextCaretStopIndex = Math.Min(Length, lsrun.Length - caretStopIndex + lsrun.OffsetToFirstCp + _cpFirst); 1459lscpVisisble = Math.Min(lscpVisisble, _metrics._lscpLim - 1); 1694int lscpEndInSubline = Math.Min( 2037int cch = Math.Min(plsrunSpanRider.Length, cchLeft); 2123cch = Math.Min(cch, cchLeft);
Core\CSharp\MS\Internal\TextFormatting\FullTextState.cs (1)
292return Math.Min(0, TextFormatterImp.RealToIdeal(_markerStore.Pap.TextMarkerProperties.Offset) - _store.Settings.TextIndent);
Core\CSharp\MS\Internal\TextFormatting\LexicalChunk.cs (2)
88return ich - cchLast + Math.Min(cchLast, lsdcp - lsdcpLast); 96return ich - cchLast + Math.Min(cchLast, lsdcp - lsdcpLast);
Core\CSharp\MS\Internal\TextFormatting\SimpleTextLine.cs (2)
864int afterLast = Math.Min(ich + run.Length, dcp + textLength) + _cpFirst; 1267cpVisible = Math.Min(cpRunEnd, cp);
Core\CSharp\MS\Internal\TextFormatting\TextMarkerSource.cs (1)
187Math.Min(_characterArray.Length, textSourceCharacterIndexLimit)
Core\CSharp\MS\Internal\TextFormatting\TextRunCacheImp.cs (2)
235int lookAheadLimit = Math.Min(runLength, looseCharLength + TextStore.TypicalCharactersPerLine); 261looseCharLength = Math.Min(runLength, endOffset);
Core\CSharp\MS\Internal\TextFormatting\TextStore.cs (5)
531int effectedRangeEnd = Math.Min(cpFetched - offset + runInfo.Length, bounds[bounds.Length - 1].Position); 541int currentRangeEnd = Math.Min(bounds[i].Position, effectedRangeEnd); 1236int first = limit - Math.Min(charRange.Length, limitCp - firstCp); 1319int spanLength = Math.Min(runInfoSpanRider.Length, textEffectsSpanRider.Length); 1320int ichEnd = Math.Min(ichRun + spanLength, cchUniform);
Core\CSharp\System\Windows\DataObject.cs (1)
2705_current = _current + (int)Math.Min(celt, Int32.MaxValue - _current);
Core\CSharp\System\Windows\Media\ArcSegment.cs (1)
111count = Math.Min(count, 4);
Core\CSharp\System\Windows\Media\FormattedText.cs (13)
354i = Math.Min(limit, i + formatRider.Length); 430i = Math.Min(limit, i + formatRider.Length); 485i = Math.Min(limit, i + formatRider.Length); 538i = Math.Min(limit, i + formatRider.Length); 597i = Math.Min(limit, i + formatRider.Length); 656i = Math.Min(limit, i + formatRider.Length); 708i = Math.Min(limit, i + formatRider.Length); 761i = Math.Min(limit, i + formatRider.Length); 814i = Math.Min(limit, i + formatRider.Length); 866i = Math.Min(limit, i + formatRider.Length); 1007return _that._maxTextWidths[Math.Min(line, _that._maxTextWidths.Length - 1)]; 1152Math.Min(textSourcePosition + line.Length - 1, _that._text.Length - 1) 1668int x1 = Math.Min(enumerator.Position + enumerator.Length, startIndex + count);
Core\CSharp\System\Windows\Media\GlyphsSerializer.cs (1)
277lastCaretStop = Math.Min(i | 3, _caretStops.Count - 1);
Core\CSharp\System\Windows\Media\Imaging\BitmapPalette.cs (1)
321int numColors = Math.Min(256, _colors.Count);
Core\CSharp\System\Windows\Media\MediaContext.cs (1)
841_animationRenderRate = Math.Min(_animationRenderRate, 1000);
Core\CSharp\System\Windows\Media\ParsersCommon.cs (2)
382_curIndex = Math.Min(_curIndex+8, _pathLength); // "Infinity" has 8 characters 392_curIndex = Math.Min(_curIndex+3, _pathLength); // "NaN" has 3 characters
Core\CSharp\System\Windows\Media\VisualProxy.cs (1)
581Array.Copy(_tail, reallocatedTail, Math.Min(_tail.Length, newLength));
PresentationFramework (128)
src\Framework\MS\Internal\Data\RBTree.cs (1)
401int n = Math.Min(mid-left, right-mid);
src\Framework\MS\Internal\Documents\DocumentGrid.cs (2)
2274maxColumns = Math.Min(maxColumns, _pageCache.PageCount); 2275maxColumns = Math.Min(maxColumns, DocumentViewerConstants.MaximumMaxPagesAcross);
src\Framework\MS\Internal\Documents\IFlowDocumentViewer.cs (1)
843GoToPage(Math.Min(PageCount, MasterPageNumber + 2));
src\Framework\MS\Internal\Documents\RowCache.cs (1)
566_layoutColumns = Math.Min(_layoutColumns, PageCache.PageCount);
src\Framework\MS\Internal\Documents\TextBoxLine.cs (1)
126int runLength = Math.Min(128, position.GetTextRunLength(LogicalDirection.Backward));
src\Framework\MS\Internal\Documents\TextBoxView.cs (12)
701int startOffset = Math.Min(_lineMetrics[_lineMetrics.Count-1].EndOffset, startPosition.Offset); 702int endOffset = Math.Min(_lineMetrics[_lineMetrics.Count - 1].EndOffset, endPosition.Offset); 710lastLineIndex = Math.Min(lastLineIndex, GetLineIndexFromOffset(endOffset, LogicalDirection.Backward)); 779int nextLineIndex = Math.Max(0, Math.Min(_lineMetrics.Count - 1, lineIndex + count)); 1936int endOffset = Math.Min(range.StartIndex + range.PositionsAdded, _host.TextContainer.SymbolCount); 2046int endOffset = Math.Min(_lineMetrics[lineIndex].EndOffset, unclippedEndOffset); 2142int endOffset = Math.Min(lineEndOffset, unclippedEndOffset); 2204firstLineIndex = Math.Max(0, Math.Min(firstLineIndex, _lineMetrics.Count - 1)); 2205lastLineIndex = Math.Max(0, Math.Min(lastLineIndex, _lineMetrics.Count - 1)); 2711int lineCount = Math.Min(oldLastLineIndex, firstLineIndex + count - 1) - lineIndex + 1; 2811count = Math.Min(count, _viewportLineVisuals.Count - start); 2971int rangeSize = Math.Min(viewportEnd, selectionEnd) - rangeStart;
src\Framework\MS\Internal\Documents\TextContainerHelper.cs (3)
207_cpFirst = Math.Min(_cpFirst, cpFirst); 232_ranges[i * 2] = Math.Min(_ranges[i * 2], cpFirst); 480int depth = Math.Min(ancestorsStart.Count, ancestorsEnd.Count);
src\Framework\MS\Internal\Documents\TextParagraphView.cs (2)
187lineIndex = Math.Min(lines.Count - 1, lineIndex); 603lineIndex = Math.Max(Math.Min((int)(point.Y / approximatedLineHeight), lines.Count - 1), 0);
src\Framework\MS\Internal\Globalization\LocalizableResourceBuilder.cs (2)
580Readability readability = (Readability) Math.Min( 586Modifiability modifiability = (Modifiability) Math.Min(
src\Framework\MS\Internal\PtsHost\ContainerParagraph.cs (5)
540fsrcToFillSubtrack.u = Math.Max(Math.Min(fsrcToFillSubtrack.u, fsrcToFill.u + fsrcToFill.du - 1), fsrcToFill.u); 554fsrcToFillSubtrack.v = Math.Max(Math.Min(fsrcToFillSubtrack.v, fsrcToFill.v + fsrcToFill.dv - 1), fsrcToFill.v); 615dvrUsed = Math.Min(fsrcToFill.dv, dvrUsed); 705urSubtrack = Math.Max(Math.Min(urTrack + mbp.MBPLeft, urTrack + durTrack - 1), urTrack); 842urSubtrack = Math.Max(Math.Min(urTrack + mbp.MBPLeft, urTrack + durTrack - 1), urTrack);
src\Framework\MS\Internal\PtsHost\DtrList.cs (2)
108int adjust = Math.Min(_dtrs[i].PositionsAdded, dtr.PositionsRemoved - delta); 122int adjust = Math.Min(dtr.PositionsRemoved, _dtrs[i].PositionsAdded - delta);
src\Framework\MS\Internal\PtsHost\FloaterParagraph.cs (2)
224dvrAvailable = Math.Min(dvrAvailable, PTS.dvBottomUndefined / 2); 230dvrAvailable = Math.Min(dvrAvailable, TextDpi.ToTextDpi(StructuralCache.CurrentFormatContext.PageHeight));
src\Framework\MS\Internal\PtsHost\MarginCollapsingState.cs (1)
171_minNegative = Math.Min(_minNegative, mcs._minNegative);
src\Framework\MS\Internal\PtsHost\PtsHelper.cs (1)
939return Math.Max(1, Math.Min(PTS.Restrictions.tscColumnRestriction-1, columns)); // at least 1 column is required
src\Framework\MS\Internal\PtsHost\PtsHost.cs (1)
1599for(int breakIndex = 0; breakIndex < Math.Min(textBreakpoints.Count, nLineVariantsAlloc); breakIndex++)
src\Framework\MS\Internal\PtsHost\TableParaClient.cs (3)
701int du = Math.Min(Math.Abs(rect.u - u), Math.Abs(rect.u + rect.du - u)); 702int dv = Math.Min(Math.Abs(rect.v - v), Math.Abs(rect.v + rect.dv - v)); 2055Math.Min(_calculatedColumns.Length, columns));
src\Framework\MS\Internal\PtsHost\TextParaClient.cs (8)
858int dcpEnd = Math.Min(cpEndTextPointer, cpParagraphEnd) - cpParagraphStart; 1597int countVisualsShiftBeforeChange = Math.Min(Math.Max(lineIndexToBeginRemoval - _lineIndexFirstVisual, 0), lineVisuals.Count); 1614int actualLinesToRemove = Math.Min(Math.Max(lineIndexToBeginRemoval - _lineIndexFirstVisual + cLinesToRemove, 0), lineVisuals.Count); 1642int actualLinesToRemove = Math.Min(cLinesToRemove, lineVisuals.Count - (lineIndexToBeginRemoval - _lineIndexFirstVisual)); 2091int cchRangeForThisLine = Math.Max(Math.Min(lineDesc.dcpLim, dcpEnd) - dcpRangeStartForThisLine, 1); 2206int cchRangeForThisElem = Math.Max(Math.Min(elemDesc.dcpLim, dcpEnd) - dcpRangeStartForThisElem, 1); 3381line.GetGlyphRuns(glyphRuns, Math.Max(dcpStart, lineDesc.dcpFirst), Math.Min(dcpEnd, lineDesc.dcpLim)); 3448line.GetGlyphRuns(glyphRuns, Math.Max(dcpStart, element.dcpFirst), Math.Min(dcpEnd, element.dcpLim));
src\Framework\MS\Internal\PtsHost\TextParagraph.cs (2)
840ddcpOld = Math.Min(ddcpOld, (LastFormatCch - dcpStart) + 1); 841ddcpNew = Math.Min(ddcpNew, (Cch - dcpStart) + 1);
src\Framework\MS\Internal\Text\ComplexLine.cs (1)
570offset = Math.Min(_dcp + this.Length, offset);
src\Framework\MS\Internal\Text\SimpleLine.cs (1)
92Math.Min(dcp, _content.Length)
src\Framework\System\Windows\Controls\DataGrid.cs (7)
2655indexToSelect = Math.Min(Items.Count - numSelected - 1, indexToSelect); 5097int previousStartIndex = Math.Min(startIndex, currentCellIndex); 5099int previousStartColumnIndex = Math.Min(startColumnIndex, currentCellColumnIndex); 5140_selectedCells.AddRegion(Math.Min(startIndex, endIndex), Math.Min(startColumnIndex, endColumnIndex), newRowCount, newColumnCount); 6004index = Math.Max(0, Math.Min(numItems - 1, index + (shiftModifier ? -1 : 1))); 6149targetIndex = Math.Max(0, Math.Min(targetIndex, Items.Count - 1));
src\Framework\System\Windows\Controls\DataGridColumnCollection.cs (2)
755int columnCount = Math.Min(newFrozenCount, Count); 763int columnCount = Math.Min(oldFrozenCount, Count);
src\Framework\System\Windows\Controls\Grid.cs (4)
980cell.ColumnIndex = Math.Min(GetColumn(child), DefinitionsU.Length - 1); 983cell.RowIndex = Math.Min(GetRow(child), DefinitionsV.Length - 1); 988cell.ColumnSpan = Math.Min(GetColumnSpan(child), DefinitionsU.Length - cell.ColumnIndex); 992cell.RowSpan = Math.Min(GetRowSpan(child), DefinitionsV.Length - cell.RowIndex);
src\Framework\System\Windows\Controls\ItemContainerGenerator.cs (1)
2772int index = Math.Min(oldIndex, newIndex);
src\Framework\System\Windows\Controls\PasswordTextNavigator.cs (2)
202finalCount = Math.Min(count, _container.SymbolCount - _offset); 206finalCount = Math.Min(count, _offset);
src\Framework\System\Windows\Controls\Primitives\DataGridCellsPresenter.cs (1)
135dirtyCount = Math.Min(newColumnCount, oldColumnCount);
src\Framework\System\Windows\Controls\PrintDialog.cs (1)
367Math.Min((int)dlg.MaxPage, _pageRange.PageTo));
src\Framework\System\Windows\Controls\Stack.cs (1)
1007iNewOffset = Math.Max(Math.Min(numberOfItems - 1, iNewOffset), 0);
src\Framework\System\Windows\Controls\TextBlock.cs (1)
2420int dcpEnd = Math.Min(dcpLineEnd, dcpPositionEnd);
src\Framework\System\Windows\Controls\TextBox.cs (1)
1722if ( 2*(prefix + suffix) >= Math.Min(oldText.Length, newText.Length))
src\Framework\System\Windows\Controls\VirtualizedCellInfoCollection.cs (6)
618int right = Math.Min(Right, region.Right); 619int bottom = Math.Min(Bottom, region.Bottom); 689Left = Math.Min(Left, region.Left); 690Top = Math.Min(Top, region.Top); 733int bottom = Math.Min(Bottom, region.Bottom); 741int bottom = Math.Min(Bottom, region.Bottom);
src\Framework\System\Windows\Controls\VirtualizingStackPanel.cs (1)
9398return Math.Min(ItemCount, _firstItemInExtendedViewportIndex + _actualItemsInExtendedViewportCount);
src\Framework\System\Windows\Documents\Block.cs (2)
513double maxLineHeight = Math.Min(1000000, PTS.MaxFontSize); 557double maxThickness = Math.Min(1000000, PTS.MaxPageSize);
src\Framework\System\Windows\Documents\Figure.cs (1)
300double maxOffset = Math.Min(1000000, PTS.MaxPageSize);
src\Framework\System\Windows\Documents\FixedPageStructure.cs (1)
142line = Math.Max(0, Math.Min(line, _lineResults.Length - 1));
src\Framework\System\Windows\Documents\Floater.cs (1)
133double maxWidth = Math.Min(1000000, PTS.MaxPageSize);
src\Framework\System\Windows\Documents\FlowDocument.cs (5)
1538double maxSize = Math.Min(1000000, PTS.MaxPageSize); 1553double maxSize = Math.Min(1000000, PTS.MaxPageSize); 1568double maxSize = Math.Min(1000000, PTS.MaxPageSize); 1589double maxRuleWidth = Math.Min(1000000, PTS.MaxPageSize); 1600double maxGap = Math.Min(1000000, PTS.MaxPageSize);
src\Framework\System\Windows\Documents\FlowPosition.cs (1)
225maxLength = Math.Min(maxLength, remainingLength);
src\Framework\System\Windows\Documents\ImmComposition.cs (1)
1260_caretOffset = Math.Min(_caretOffset, text.Length);
src\Framework\System\Windows\Documents\List.cs (1)
337double maxOffset = Math.Min(1000000, PTS.MaxPageSize);
src\Framework\System\Windows\Documents\Paragraph.cs (1)
310double maxIndent = Math.Min(1000000, PTS.MaxPageSize);
src\Framework\System\Windows\Documents\Speller.cs (5)
1072int timeOutOffset = Math.Min(data.TextMap.ContentEndOffset, sentenceEndOffset); 1264contextOffset = Math.Min(sTextRange.Start, contentOffset); 1269sTextRange = (SpellerInteropBase.ITextRange)segments[Math.Min(i, segments.Count-1)]; 1821runCount = Math.Min(runCount, _text.Length - _textLength); 1822runCount = Math.Min(runCount, position.GetOffsetToPosition(contextEnd));
src\Framework\System\Windows\Documents\Table.cs (1)
395double maxSpacing = Math.Min(1000000, PTS.MaxPageSize);
src\Framework\System\Windows\Documents\TableColumn.cs (1)
210double maxPixel = Math.Min(1000000, PTS.MaxPageSize);
src\Framework\System\Windows\Documents\TextContainerChangedEventArgs.cs (1)
408int cancelledCount = Math.Min(overlap, newChange.RemovedLength);
src\Framework\System\Windows\Documents\TextElement.cs (1)
1657double maxFontSize = Math.Min(1000000, PTS.MaxFontSize);
src\Framework\System\Windows\Documents\TextFindEngine.cs (3)
682runCount = Math.Min(runCount, findText.Length - findTextLength); 686runCount = Math.Min(runCount, navigator.GetOffsetToPosition(endPosition)); 696runCount = Math.Min(runCount, startPosition.GetOffsetToPosition(navigator));
src\Framework\System\Windows\Documents\TextPointer.cs (1)
1812finalCount += Math.Min(count - finalCount, textNode.SymbolCount - skipCount);
src\Framework\System\Windows\Documents\TextPointerBase.cs (5)
106maxCount = Math.Min(count, thisPointer.GetOffsetToPosition(limit)); 110maxCount = Math.Min(count, limit.GetOffsetToPosition(thisPointer)); 112maxCount = Math.Min(count, maxCount); 1431runLength = Math.Min(navigator.GetTextRunLength(LogicalDirection.Backward), SelectionWordBreaker.MinContextLength - preceedingCount); 1450runLength = Math.Min(navigator.GetTextRunLength(LogicalDirection.Forward), SelectionWordBreaker.MinContextLength - followingCount);
src\Framework\System\Windows\Documents\TextRangeEdit.cs (2)
2350new DoublePropertyRange (Paragraph.TextIndentProperty, -Math.Min(1000000, PTS.MaxPageSize), Math.Min(1000000, PTS.MaxPageSize))
src\Framework\System\Windows\Documents\TextRangeEditTables.cs (2)
338int firstRowIndex = Math.Min(anchorCell.Row.Index, movingCell.Row.Index); 340int firstColumnIndex = Math.Min(anchorCell.ColumnIndex, movingCell.ColumnIndex);
src\Framework\System\Windows\Documents\TextStore.cs (1)
2325runCount = TextPointerBase.GetTextWithLimit(navigator, LogicalDirection.Forward, text, charsCopied, Math.Min(cchReq, text.Length - charsCopied), limit);
src\Framework\System\Windows\Documents\TextTreeText.cs (4)
109firstCount = Math.Min(count, firstBlock.Count - firstBlockLocalOffset); 306count = Math.Min(rightBlock.FreeCapacity, length - textOffset); 348count = Math.Min(neighborBlock.FreeCapacity, textEndOffset - textOffset); 362count = Math.Min(rightBlock.FreeCapacity, textEndOffset - textOffset);
src\Framework\System\Windows\Documents\TextTreeTextBlock.cs (4)
100newText = new char[Math.Min(this.Count + count, MaxBlockSize)]; 115count = Math.Min(count, _gapSize); 254copyCount = Math.Min(count, _gapOffset - logicalOffset); 269copyCount = Math.Min(count, _text.Length - logicalOffset);
src\Framework\System\Windows\FigureLength.cs (1)
104double maxPixel = Math.Min(1000000, PTS.MaxPageSize);
src\Framework\System\Windows\Standard\NativeMethods.cs (2)
2146Left = Math.Min(rect1.Left, rect2.Left), 2147Top = Math.Min(rect1.Top, rect2.Top),
System (46)
compmod\system\componentmodel\Container.cs (1)
245for (int i = 0; i < Math.Min(siteCount,sites.Length); i++) {
net\System\Net\_ChunkParser.cs (5)
325readSize = Math.Min(chunkLengthBuffer, readSize); 396int newBufferLength = Math.Min(maxBufferLength, buffer.Length * 2); 466int bufferedBytesToRead = Math.Min(Math.Min(userBufferCount, bufferFillLength - bufferCurrentPos), 493int bytesToRead = Math.Min(userBufferCount - currentOperationBytesRead,
net\System\Net\_ConnectStream.cs (2)
750int BytesTransferred = Math.Min(size, m_ReadBufferSize); 1877if(Logging.On)Logging.Dump(Logging.Web, thisConnectStream, "ReadCallback", castedAsyncResult.Buffer, castedAsyncResult.Offset, Math.Min(castedAsyncResult.Size, bytesTransferred));
net\System\Net\_SecureChannel.cs (1)
1117GlobalLog.Print("SecureChannel#" + ValidationHelper.HashString(this) + "::Encrypt() buffer:[" + Encoding.ASCII.GetString(buffer, 0, Math.Min(buffer.Length,128)) + "]");
net\System\Net\Cache\_SingleItemRequestCache.cs (1)
373count = Math.Min(count, _Bytes.Length - chkOffset);
net\System\Net\cookiecontainer.cs (3)
426int min_count = Math.Min((int)(domain_count*remainingFraction), Math.Min(m_maxCookiesPerDomain, m_maxCookies)-1); 969int length = Math.Min(ll, lr);
net\System\Net\HttpWebRequest.cs (1)
6151while ((bytesTransferred = stream.Read(buffer, 0, Math.Min(buffer.Length, maxBytesToBuffer))) > 0)
net\System\Net\Internal.cs (2)
1466this.offset = data == null || offset < 0 ? 0 : Math.Min(offset, data.Length); 1467this.size = data == null || size < 0 ? 0 : Math.Min(size, data.Length - this.offset);
net\System\Net\Logging.cs (1)
607int n = Math.Min(length, 16);
net\System\Net\mail\BufferedReadStream.cs (3)
64read = Math.Min(count, this.storedLength - this.storedOffset); 85read = Math.Min(count, this.storedLength - this.storedOffset); 229this.read = Math.Min(count, parent.storedLength - parent.storedOffset);
net\System\Net\mail\SmtpReplyReaderFactory.cs (2)
335int left = Math.Min(4-statusRead, actual); 469int left = Math.Min(4-statusRead, actual);
net\System\Net\SecureProtocols\_NegoStream.cs (1)
165int chunkBytes = Math.Min(count, NegoState.c_MaxWriteDataSize);
net\System\Net\SecureProtocols\_SslState.cs (1)
540int toCopy = Math.Min(_QueuedReadCount, count);
net\System\Net\SecureProtocols\_SslStream.cs (3)
475int chunkBytes = Math.Min(buffer.Size, _SslState.MaxDataSize); 503chunkBytes = Math.Min(buffer.Size, _SslState.MaxDataSize); 583int chunkBytes = Math.Min(count, _SslState.MaxDataSize);
net\System\Net\Sockets\_OverlappedAsyncResult.cs (2)
194Logging.Dump(Logging.Sockets, AsyncObject, "PostCompletion", wsaBuffer.Pointer, Math.Min(wsaBuffer.Length, size)); 200Logging.Dump(Logging.Sockets, AsyncObject, "PostCompletion", m_SingleBuffer.Pointer, Math.Min(m_SingleBuffer.Length, size));
net\System\Net\Sockets\_ReceiveMessageOverlappedAsyncResult.cs (1)
197Logging.Dump(Logging.Sockets, AsyncObject, "PostCompletion", m_WSABuffer->Pointer, Math.Min(m_WSABuffer->Length, size));
net\System\Net\Sockets\Socket.cs (2)
9684Logging.Dump(Logging.Sockets, m_CurrentSocket, "FinishOperation(" + m_CompletedOperation + "Async)", wsaBuffer.Pointer, Math.Min(wsaBuffer.Length, size)); 9699Logging.Dump(Logging.Sockets, m_CurrentSocket, "FinishOperation(" + m_CompletedOperation + "Async)Buffer", spe.m_Buffer, spe.m_Offset, Math.Min(spe.m_Count, size));
net\System\Net\WebHeaderCollection.cs (1)
1566GlobalLog.Enter("WebHeaderCollection::ParseHeadersStrict(): size:" + size.ToString() + ", unparsed:" + unparsed.ToString() + " buffer:[" + Encoding.ASCII.GetString(buffer, unparsed, Math.Min(256, size-unparsed)) + "]");
net\System\Net\WebSockets\WebSocketBase.cs (2)
2037bytesTransferred = Math.Min(payload.Count, (int)buffer.Value.Count); 2172ArraySegment<byte> closeBuffer = new ArraySegment<byte>(blob, 0, Math.Min(WebSocketHelpers.MaxControlFramePayloadLength, blob.Length));
net\System\Net\WebSockets\WebSocketBuffer.cs (1)
348int bytesTransferred = Math.Min(buffer.Count, m_BufferedPayloadReceiveResult.Count);
net\System\UriHelper.cs (1)
144short maxSize = (short)Math.Min(end - i, (int)c_MaxUnicodeCharsReallocate-1);
sys\System\IO\compression\CopyEncoder.cs (1)
26count = Math.Min(input.Count, output.FreeBytes - PaddingSize - output.BitsInBuffer);
sys\System\IO\compression\FastEncoder.cs (1)
72bytesToCopy = Math.Min(bytesToCopy, maxBytesToCopy - bytesConsumedFromInput);
sys\System\IO\compression\OutputWindow.cs (2)
67length = Math.Min(Math.Min(length, WindowSize - bytesUsed), input.AvailableBytes);
sys\system\io\ports\SerialPort.cs (3)
870bytesReadToBuffer = Math.Min(CachedBytesToRead, count); 1079int bytesToRead = Math.Min(count, CachedBytesToRead); 1111currentBytesToExamine = Math.Min(count - totalCharsFound, readLen - readPos - totalBytesExamined);
sys\system\threading\Barrier.cs (2)
901int waitTime = totalTimeout == Timeout.Infinite ? maxWait : Math.Min(maxWait, totalTimeout); 913maxWait = maxWait >= waitTimeCeiling ? waitTimeCeiling : Math.Min(maxWait << 1, waitTimeCeiling);
System.Activities.DurableInstancing (1)
System\Activities\DurableInstancing\LoadRetryExponentialBackoffStrategy.cs (1)
27int power = Math.Min(retryAttempt, this.expLimit);
System.Activities.Presentation (1)
System.Activities.Presentation\System\Activities\Presentation\View\DataGridHelper.cs (1)
210int index = Math.Max(0, Math.Min(numItems - 1, items.IndexOf(currentCell.Item) + (shiftModifier ? -1 : 1)));
System.Core (7)
Microsoft\Scripting\Actions\RuleCache.cs (1)
53int max = Math.Min(_rules.Length, i + count);
System\IO\Pipes\Pipe.cs (1)
1299waitTime = Math.Min(CancellationCheckIntervalInMilliseconds, timeLeft);
System\Linq\Parallel\QueryOperators\Binary\ZipQueryOperator.cs (1)
185m_count = Math.Min(m_leftChildResults.Count, m_rightChildResults.Count);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (1)
376return Math.Min(m_childCount, m_takeOrSkipOp.m_count);
System\Linq\Parallel\Scheduling\Scheduling.cs (1)
41internal static int DefaultDegreeOfParallelism = Math.Min(Environment.ProcessorCount, MAX_SUPPORTED_DOP);
System\Linq\Parallel\Utils\Sorting.cs (1)
389m_sharedBarriers[phase, Math.Min(m_partitionIndex, partnerIndex)].SignalAndWait(cancelToken);
System\Security\Cryptography\NCryptNative.cs (1)
1322Buffer.BlockCopy(key, 0, fullKey, 0, Math.Min(key.Length, fullKey.Length));
System.Data (92)
fx\src\data\Microsoft\SqlServer\Server\ValueUtilsSmi.cs (2)
2841length = Math.Min( length, bufferLength - bufferOffset ); 2846length = Math.Min( length, TdsEnums.TYPE_SIZE_LIMIT );
fx\src\data\System\Data\Common\AdapterUtil.cs (1)
2405startIndex = Math.Min(startIndex, index);
fx\src\data\System\Data\Common\BigIntegerStorage.cs (1)
131Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\BooleanStorage.cs (1)
147Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\ByteStorage.cs (1)
213Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\CharStorage.cs (1)
151Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\DateTimeOffsetStorage.cs (1)
147Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\DateTimeStorage.cs (1)
181Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\DbDataAdapter.cs (1)
827int maxBatchCommands = Math.Min(UpdateBatchSize, dataRows.Length);
fx\src\data\System\Data\Common\DecimalStorage.cs (1)
204Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\DoubleStorage.cs (1)
211Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\Int16Storage.cs (1)
217Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\Int32Storage.cs (2)
101min=Math.Min(values[record], min); 216Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\Int64Storage.cs (1)
211Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\ObjectStorage.cs (1)
260Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SByteStorage.cs (1)
213Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SingleStorage.cs (1)
212Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLBinaryStorage.cs (1)
86Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQlBooleanStorage.cs (1)
115Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLBytesStorage.cs (1)
85Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLByteStorage.cs (1)
184Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLCharsStorage.cs (1)
86Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLDateTimeStorage.cs (1)
117Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLDecimalStorage.cs (1)
182Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLDoubleStorage.cs (1)
183Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLGuidStorage.cs (1)
86Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLInt16Storage.cs (1)
183Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLInt32Storage.cs (1)
183Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLInt64Storage.cs (1)
184Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLMoneyStorage.cs (1)
183Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLSingleStorage.cs (1)
184Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLStringStorage.cs (1)
140Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SqlUDTStorage.cs (1)
131Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SqlXmlStorage.cs (1)
86Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\StringStorage.cs (1)
160Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\TimeSpanStorage.cs (1)
221Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\UInt16Storage.cs (1)
216Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\UInt32Storage.cs (1)
216Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\UInt64Storage.cs (1)
210Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\DataError.cs (1)
130int newCapacity = Math.Min(count*2, column.Table.Columns.Count);
fx\src\data\System\Data\DataTableReader.cs (2)
338int byteCount = Math.Min(tempBuffer.Length - srcIndex, length); 388int charCount = Math.Min(tempBuffer.Length - srcIndex, length);
fx\src\data\System\Data\Odbc\OdbcConnection.cs (2)
363value = Encoding.Unicode.GetString(buffer, 0, Math.Min(cbActual, buffer.Length)); 448value = Encoding.Unicode.GetString(buffer, 0, Math.Min(cbActual, buffer.Length));
fx\src\data\System\Data\Odbc\OdbcDataReader.cs (8)
504int nValues = Math.Min(values.Length, FieldCount); 830string strdata = buffer.PtrToStringUni(0, Math.Min(lengthOrIndicator, cbMaxData) / 2); 868cbActual = Math.Min(lengthOrIndicator, cbMaxData); 1020int lengthOfCopy = Math.Min(lengthFromDataIndex, length); 1023lengthOfCopy = Math.Min(lengthOfCopy, buffer.Length - bufferIndex); 1133length = Math.Min(length, buffer.Length - bufferIndex); 1292Buffer.ReadBytes(0, rgBytes, cbOffset, Math.Min(cbActual, cbBufferLen)); 1304buffer.ReadBytes(0, rgBytes, cbOffset, Math.Min(cbActual, cbBufferLen));
fx\src\data\System\Data\Odbc\OdbcParameter.cs (2)
299return Math.Min((int)_internalPrecision,ADP.DecimalMaxPrecision); 384return Math.Min((int)_internalPrecision,ADP.DecimalMaxPrecision);
fx\src\data\System\Data\Odbc\OdbcUtils.cs (2)
41cb = Math.Min(cb/2, (Length-2)/2); 49cb = Math.Min(cb, Length);
fx\src\data\System\Data\OleDb\ColumnBinding.cs (8)
627LengthValue(((0 < ValueBindingSize) ? Math.Min(ValueBindingSize, length) : length)); 667LengthValue(((0 < ValueBindingSize) ? Math.Min(ValueBindingSize, length) : length) * 2); /* charcount->bytecount*/ 684LengthValue(((0 < ValueBindingSize) ? Math.Min(ValueBindingSize, length) : length) * 2); /* charcount->bytecount*/ 699int byteCount = Math.Min(LengthValue(), ColumnBindingMaxLen); 707int bytecount = ((ValueBindingOffset < value.Length) ? Math.Min(value.Length - ValueBindingOffset, ColumnBindingMaxLen) : 0); // 70232 1056int byteCount = Math.Min(LengthValue(), ColumnBindingMaxLen-2); 1063int charCount = ((ValueBindingOffset < value.Length) ? Math.Min(value.Length - ValueBindingOffset, (ColumnBindingMaxLen-2)/2) : 0); // 70232 1076int charCount = ((ValueBindingOffset < value.Length) ? Math.Min(value.Length - ValueBindingOffset, (ColumnBindingMaxLen-2)/2) : 0); // 70232
fx\src\data\System\Data\OleDb\OleDbDataReader.cs (3)
797int byteCount = Math.Min(value.Length - srcIndex, length); 827int charCount = Math.Min(value.Length - srcIndex, length); 1042int count = Math.Min(values.Length, _visibleFieldCount);
fx\src\data\System\Data\OleDb\OleDbParameter.cs (2)
330bytecount = Math.Min(size, 0x3FFFFFFE) * 2 + 2; 340size = Math.Min(size, 0x3FFFFFFE) * 2;
fx\src\data\System\Data\ProviderBase\SchemaMapping.cs (2)
255Debug.Assert(_mappedLength == Math.Min(_readerDataValues.Length, _mappedDataValues.Length), "incorrect precomputed length"); 1062_mappedLength = Math.Min(count, mappingCount);
fx\src\data\System\Data\RecordManager.cs (1)
40Array.Copy(rows, 0, newRows, 0, Math.Min(lastFreeRecord, rows.Length));
fx\src\data\System\Data\SqlClient\SqlDataReader.cs (1)
3562int bytesRemaining = Math.Min(checked(_stateObj._inBytesRead - _stateObj._inBytesUsed), _stateObj._inBytesPacket);
fx\src\data\System\Data\SqlClient\SqlSequentialTextReader.cs (1)
525charsUsed = Math.Min(charCount, byteCount / 2);
fx\src\data\System\Data\SqlClient\TdsParser.cs (3)
10302count = Math.Min(_size - _written, count); 10324count = Math.Min(_size - _written, count); 11177buff = new char[(int)Math.Min((int)stateObj._longlen, len)];
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (5)
470int bytesRemaining = Math.Min(_inBytesPacket, _inBytesRead - _inBytesUsed) - 1; 985int copy = Math.Min(_inBytesRead - _inBytesUsed, _inputHeaderLen - _partialHeaderBytesRead); 1232int bytesToRead = Math.Min(len, Math.Min(_inBytesPacket, _inBytesRead - _inBytesUsed)); 1774buff = new byte[(int)Math.Min((int)_longlen, len)];
fx\src\data\System\Data\SQLTypes\SQLDecimal.cs (8)
1232ResPrec = Math.Min(MaxPrecision, ResPrec); 1433ResScale = Math.Min((ResPrec - ResInteger),ResScale); 1435ResScale = Math.Max(ResScale, Math.Min(ActualScale,x_cNumeDivScaleMin)); 1652MinScale = Math.Min(ResScale, x_cNumeDivScaleMin); 1654ResInteger = Math.Min(ResInteger, NUMERIC_MAX_PRECISION); 1661ResScale = Math.Min((ResPrec - ResInteger), ResScale); 2236bNewPrec = (byte) (Math.Min(NUMERIC_MAX_PRECISION,Math.Max(1,lAdjust + m_bPrec))); 3059lPosition = Math.Min(NUMERIC_MAX_PRECISION, lPosition);
System.Data.Entity (19)
System\Data\Common\CommandTrees\Internal\ExpressionPrinter.cs (1)
492appendLength = Math.Min(stringVal.Length, _maxStringLength);
System\Data\Common\DataRecord.cs (1)
407int copyLen = Math.Min(values.Length, FieldCount);
System\Data\Common\EntitySql\CqlParserHelpers.cs (2)
159errorPosition = Math.Min(errorPosition, errorPosition - term.Length); 166errorPosition = Math.Min(errorPosition, errorPosition - term.Length);
System\Data\Common\Internal\Materialization\RecordState.cs (2)
152byteCount = Math.Min(byteCount, length); 185charCount = Math.Min(charCount, length);
System\Data\Common\Utils\ByValueEqualityComparer.cs (1)
77for (int i = 0, n = Math.Min(bytes.Length, 7); i < n; i++)
System\Data\Common\Utils\StringUtil.cs (1)
193length = Math.Min(value.Length, length);
System\Data\Mapping\ViewGeneration\QueryRewriting\RewritingProcessor.cs (1)
253int numPermutations = Math.Min(MAX_PERMUTATIONS, Math.Max(MIN_PERMUTATIONS, (int)(usedViews.Count * PERMUTE_FRACTION)));
System\Data\Objects\ELinq\OrderByLifter.cs (1)
233DbExpression newCount = CombineIntegers(limit.Limit, k, Math.Min);
System\Data\Objects\ObjectContext.cs (1)
2205int batchSize = Math.Min(maxBatch, (targetKeys.Count - startFrom));
System\Data\Objects\ObjectStateEntryBaseUpdatableDataRecord.cs (4)
119int byteCount = Math.Min(tempBuffer.Length - srcIndex, length); 174int charCount = Math.Min(tempBuffer.Length - srcIndex, length); 364int minValue = Math.Min(values.Length, FieldCount); 513int minValue = Math.Min(values.Length, FieldCount);
System\Data\Objects\ObjectStateEntryDbDataRecord.cs (3)
103int byteCount = Math.Min(tempBuffer.Length - srcIndex, length); 142int charCount = Math.Min(tempBuffer.Length - srcIndex, length); 244int minValue = Math.Min(values.Length, FieldCount);
System\Data\Query\ResultAssembly\BridgeDataRecord.cs (1)
492int copy = Math.Min(values.Length, FieldCount);
System.Data.Entity.Design (2)
System\Data\Entity\Design\Common\MetadataUtil.cs (1)
125length = Math.Min(value.Length, length);
System\Data\EntityModel\Emitters\CommentEmitter.cs (1)
257int minLength = Math.Min(leadingBlanks.Length, leadingBlanks2.Length);
System.Data.Linq (2)
SqlClient\SqlTypeSystemProvider.cs (2)
828int end = (paren != -1 && space != -1) ? Math.Min(space, paren) 1351int precision = Math.Min(bestLeft + bestRight, 38);
System.Data.Services (9)
parent\Client\System\Data\Services\Client\BatchStream.cs (9)
246int count = Math.Min(checked((int)offset), Math.Min(this.byteLength, this.batchLength)); 954int end = i + Math.Min(this.byteLength, this.batchLength); 1117int size = Math.Min(Math.Min(count, this.byteLength), this.batchLength) + this.bytePosition; 1276int size = Math.Min(Math.Min(count, this.byteLength), this.batchLength); 1290int size = this.reader.Read(buffer, offset, Math.Min(count, this.batchLength)); 1568int result = this.target.ReadLength(buffer, offset, Math.Min(count, this.length));
System.Data.Services.Client (10)
System\Data\Services\Client\ArraySet.cs (1)
72Array.Resize<T>(ref this.items, Math.Min(Math.Max(index, 16), Int32.MaxValue / 2) * 2);
System\Data\Services\Client\BatchStream.cs (9)
246int count = Math.Min(checked((int)offset), Math.Min(this.byteLength, this.batchLength)); 954int end = i + Math.Min(this.byteLength, this.batchLength); 1117int size = Math.Min(Math.Min(count, this.byteLength), this.batchLength) + this.bytePosition; 1276int size = Math.Min(Math.Min(count, this.byteLength), this.batchLength); 1290int size = this.reader.Read(buffer, offset, Math.Min(count, this.batchLength)); 1568int result = this.target.ReadLength(buffer, offset, Math.Min(count, this.length));
System.Data.Services.Design (2)
System\Data\Common\Utils\StringUtil.cs (1)
53length = Math.Min(value.Length, length);
System\Data\EntityModel\Emitters\CommentEmitter.cs (1)
254int minLength = Math.Min(leadingBlanks.Length, leadingBlanks2.Length);
System.Drawing (18)
commonui\System\Drawing\Graphics.cs (2)
2897int width = Math.Min(rect.Width, image.Width); 2898int height = Math.Min(rect.Height, image.Height);
commonui\System\Drawing\Icon.cs (1)
903for (int i = 0; i < Math.Min(sourceData.Height, targetData.Height); i++) {
commonui\System\Drawing\Rectangle.cs (4)
440int x2 = Math.Min(a.X + a.Width, b.X + b.Width); 442int y2 = Math.Min(a.Y + a.Height, b.Y + b.Height); 473int x1 = Math.Min(a.X, b.X); 475int y1 = Math.Min(a.Y, b.Y);
misc\GDI\UnsafeNativeMethods.cs (11)
381lpRect.top = Math.Min( Int16.MaxValue, lpRect.top ); 382lpRect.left = Math.Min( Int16.MaxValue, lpRect.left ); 383lpRect.right = Math.Min( Int16.MaxValue, lpRect.right ); 384lpRect.bottom = Math.Min( Int16.MaxValue, lpRect.bottom ); 392byteCount = Math.Min( byteCount, IntNativeMethods.MaxTextLengthInWin9x ); 420lpRect.top = Math.Min(Int16.MaxValue, lpRect.top); 421lpRect.left = Math.Min(Int16.MaxValue, lpRect.left); 422lpRect.right = Math.Min(Int16.MaxValue, lpRect.right); 423lpRect.bottom = Math.Min(Int16.MaxValue, lpRect.bottom); 431byteCount = Math.Min( byteCount, IntNativeMethods.MaxTextLengthInWin9x); 466byteCount = Math.Min( text.Length, IntNativeMethods.MaxTextLengthInWin9x);
System.IdentityModel (1)
System\IdentityModel\XmlBuffer.cs (1)
62int initialBufferSize = Math.Min(512, maxBufferSize);
System.IO.Log (1)
System\IO\Log\FileLogRecordStream.cs (1)
60int streamSize = Math.Min(this.recordSize,
System.Net (1)
net\Logging.cs (1)
123int n = Math.Min(length, 16);
System.Numerics (4)
System\Numerics\BigIntegerBuilder.cs (2)
302Array.Copy(_rgu, rgu, Math.Min(cu, _iuLast + 1)); 1101int cbitMin = Math.Min(cbit1, cbit2);
System\Numerics\BigNumber.cs (1)
625int maxDigits = Math.Min(ichDst + 50, cchMax);
System\Numerics\NumericsHelpers.cs (1)
134int n = System.Math.Min(v.Length, len);
System.Runtime.Caching (3)
System\Caching\CacheMemoryMonitor.cs (1)
194percent = Math.Min(100, (int)((cacheSize - _memoryLimit) * 100L / cacheSize));
System\Caching\MemoryCacheStatistics.cs (1)
67int newPollingInterval = Math.Min(_configPollingInterval, MEMORYSTATUS_INTERVAL_30_SECONDS);
System\Caching\PhysicalMemoryMonitor.cs (1)
133percent = Math.Min(50, (int)((lastTrimPercent * TARGET_TOTAL_MEMORY_TRIM_INTERVAL_TICKS) / ticksSinceTrim));
System.Runtime.Remoting (13)
channels\core\chunkedmemorystream.cs (2)
237int readCount = Math.Min(count, chunkSize - _readOffset); 316int copyCount = Math.Min(count, chunkSize - _writeOffset);
channels\core\socketmanager.cs (2)
429int readCount = Math.Min(_dataCount, count); 449int readCount = Math.Min(_dataCount, count);
channels\core\socketstream.cs (4)
67return _socket.Receive(buffer, offset, Math.Min(size, maxSocketRead), SocketFlags.None); 71IAsyncResult ar = _socket.BeginReceive(buffer, offset, Math.Min(size, maxSocketRead), SocketFlags.None, null, null); 89count = Math.Min(bytesToWrite, maxSocketWrite); 121Math.Min(size, maxSocketRead),
channels\http\httpstreams.cs (3)
159int writeCount = Math.Min(_chunkSize - _chunkOffset, count); 310int readCount = _inputStream.Read(buffer, offset, Math.Min(_bytesLeft, count)); 423int readCount = Math.Min(_bytesLeft, count);
channels\tcp\tcpstreams.cs (2)
101int readCount = _inputStream.Read(buffer, offset, Math.Min(_bytesLeft, count)); 169int readCount = Math.Min(_bytesLeft, count);
System.Runtime.Serialization (42)
System\Runtime\Serialization\CodeExporter.cs (1)
1521length = Math.Min(MaxIdentifierLength, length);
System\Runtime\Serialization\Json\XmlJsonReader.cs (1)
793actual = Math.Min(count, value.Length);
System\Runtime\Serialization\XmlReaderDelegator.cs (1)
838return Math.Min(context.RemainingItemCount, dictionaryReader.Quotas.MaxArrayLength);
System\Xml\ArrayHelper.cs (1)
69count = Math.Min(count, 256);
System\Xml\EncodingStreamWrapper.cs (2)
338int max = offset + Math.Min(count, BufferLength); 506int inputCount = Math.Min(count, BufferLength * 2);
System\Xml\ValueHandle.cs (4)
675actual = Math.Min(this.length, count); 685int charCount = Math.Min(count / 3 * 4, this.length); 755actualByteCount = Math.Min(charCount, byteCount); 820int charCount = Math.Min(count, this.length / sizeof(char));
System\Xml\XmlBaseReader.cs (6)
1252actual = Math.Min(count, value.Length); 1284return ReadBytes(Base64Encoding, 3, 4, buffer, offset, Math.Min(count, 512), false); 1478return ReadBytes(Base64Encoding, 3, 4, buffer, offset, Math.Min(count, 512), true); 1525return ReadBytes(BinHexEncoding, 1, 2, buffer, offset, Math.Min(count, 512), true); 1533int actual = Math.Min(trailByteCount, byteCount); 1601int actual = Math.Min(trailByteCount, byteCount);
System\Xml\XmlBinaryReader.cs (10)
1256int actual = Math.Min(count, arrayCount); 1286int actual = Math.Min(count, arrayCount); 1316int actual = Math.Min(count, arrayCount); 1346int actual = Math.Min(count, arrayCount); 1376int actual = Math.Min(count, arrayCount); 1406int actual = Math.Min(count, arrayCount); 1436int actual = Math.Min(count, arrayCount); 1463int actual = Math.Min(count, arrayCount); 1490int actual = Math.Min(count, arrayCount); 1517int actual = Math.Min(count, arrayCount);
System\Xml\XmlBinaryReaderSession.cs (1)
49XmlDictionaryString[] newStrings = new XmlDictionaryString[Math.Min(Math.Max(id + 1, strings.Length * 2), MaxArrayEntries)];
System\Xml\XmlBufferReader.cs (4)
162TryEnsureBytes(Math.Min(count, windowOffsetMax - offset)); 983int length = Math.Min(byteLength, charLength); 997int length = Math.Min(byteLength, charLength); 1029int length = Math.Min(length1, length2);
System\Xml\XmlC14NWriter.cs (1)
910int length = Math.Min(length1, length2);
System\Xml\XmlMtomReader.cs (5)
1101this.chunkSize = Math.Min(reader.Quotas.MaxBytesPerRead, chunkSize); 1172count = Math.Min(count, this.valueCount); 1219count = Math.Min(count, this.valueCount); 1325count = Math.Min(stringValue.Length - stringOffset, count); 2908read = Math.Min(count, this.storedLength - this.storedOffset);
System\Xml\XmlSigningNodeWriter.cs (1)
355int byteCount = Math.Min(base64Chars.Length / 4 * 3, count - count % 3);
System\Xml\XmlUTF8TextWriter.cs (4)
732int byteCount = Math.Min(bufferLength / 4 * 3, count - count % 3); 889int byteCount = Math.Min(bufferLength / 4 * 3, writerArgs.Count - writerArgs.Count % 3); 959int byteCount = Math.Min(bufferLength / 4 * 3, writerArgs.Count - writerArgs.Count % 3); 1160int byteCount = Math.Min(bufferLength / 4 * 3, count - count % 3);
System.ServiceModel (30)
System\ServiceModel\Channels\Connection.cs (3)
213int bytesToCopy = Math.Min(size, this.preReadCount); 229int bytesToCopy = Math.Min(size, this.preReadCount); 500AsyncCompletionResult readResult = connection.BeginRead(0, Math.Min(count, connection.AsyncReadBufferSize),
System\ServiceModel\Channels\FramingChannels.cs (2)
1111if (connection.BeginRead(0, Math.Min(FaultStringDecoder.FaultSizeQuota, connection.AsyncReadBufferSize), 1146if (connection.BeginRead(0, Math.Min(FaultStringDecoder.FaultSizeQuota, connection.AsyncReadBufferSize),
System\ServiceModel\Channels\HttpChannelHelpers.cs (2)
978return BaseStream.BeginRead(buffer, offset, Math.Min(count, maxSocketRead), callback, state); 1018return BaseStream.Read(buffer, offset, Math.Min(count, maxSocketRead));
System\ServiceModel\Channels\MaxMessageSizeStream.cs (1)
108return Math.Min(bytesToRead, (int)(maxMessageSize - totalBytesRead));
System\ServiceModel\Channels\MessageEncoder.cs (2)
56int currentBufferSize = Math.Min(buffer.Length, maxBufferSize); 75currentBufferSize = Math.Min(currentBufferSize * 2, maxBufferSize);
System\ServiceModel\Channels\MsmqInputMessage.cs (1)
170int availableSize = Math.Min(desiredSize, this.remainingSize);
System\ServiceModel\Channels\PeerMaintainer.cs (1)
450int count = Math.Min(this.config.MaxReferrals, neighbors.Count);
System\ServiceModel\Channels\PipeConnection.cs (1)
1991this.maxInstances = Math.Min(maxConnections, UnsafeNativeMethods.PIPE_UNLIMITED_INSTANCES);
System\ServiceModel\Channels\SingletonConnectionReader.cs (4)
1487int bytesToCopy = Math.Min(chunkBytesRemaining, 1488Math.Min(this.chunkBufferSize, count)); 1513bytesToRead = Math.Min(count, chunkBytesRemaining + IntEncoder.MaxEncodedSize); 1519DecodeData(buffer, offset, Math.Min(bytesRead, this.chunkBytesRemaining));
System\ServiceModel\Channels\SocketConnection.cs (1)
1039size = Math.Min(bytesToWrite, maxSocketWrite);
System\ServiceModel\Channels\TransmissionStrategy.cs (8)
307int count = Math.Min(this.windowSize, this.quotaRemaining) - this.window.Count; 311count = Math.Min(count, this.waitQueue.Count); 697this.quotaRemaining = quotaRemaining - Math.Min(this.windowSize, this.window.Count); 736int inFlightAfterAck = Math.Min(this.windowSize, this.window.Count) - (int)slide; 748this.windowSize = Math.Min(this.maxWindowSize, Math.Min(this.slowStartThreshold + 1, this.windowSize + (int)slide)); 766this.windowSize = Math.Min(this.maxWindowSize, this.windowSize + 1); 772int sendEndIndex = Math.Min(this.windowSize, this.window.Count);
System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (1)
542this.receiveBufferSize = Math.Min(WebSocketHelper.GetReceiveBufferSize(this.maxReceivedMessageSize), this.maxBufferSize);
System\ServiceModel\Description\DispatcherBuilder.cs (1)
783transactedBatchSize = System.Math.Min(transactedBatchSize, batchBehavior.MaxBatchSize);
System\ServiceModel\Transactions\WsatProxy.cs (1)
432int copyDescriptionBytes = Math.Min(descriptionBytes.Length, MaxDescriptionLength);
System\ServiceModel\XmlBuffer.cs (1)
63int initialBufferSize = Math.Min(512, maxBufferSize);
System.ServiceModel.Channels (3)
System\ServiceModel\Channels\UdpOutputChannel.cs (1)
551this.CurrentDelay = Math.Min(this.CurrentDelay * 2, this.maxDelay);
System\ServiceModel\Channels\UdpUtility.cs (1)
578return Math.Min(UdpConstants.MaxMessageSizeOverIPv4, maxReceivedMessageSize);
System\ServiceModel\Channels\XmlBufferedByteStreamReader.cs (1)
47int bytesToCopy = Math.Min(bufferedMessageData.Buffer.Count - this.offset, count);
System.ServiceModel.Internals (2)
System\Runtime\IOThreadScheduler.cs (2)
179new IOThreadScheduler(Math.Min(this.slots.Length * 2, MaximumCapacity), this.slotsLowPri.Length); 237new IOThreadScheduler(this.slots.Length, Math.Min(this.slotsLowPri.Length * 2, MaximumCapacity));
System.ServiceModel.Web (1)
System\ServiceModel\Description\WCFServiceClientProxyGenerator.cs (1)
212length = Math.Min(MaxIdentifierLength, length);
System.Web (14)
Compilation\BuildProvidersCompiler.cs (2)
212int maxConcurrent = Math.Min(_satelliteAssemblyBuilders.Count, CompilationUtil.MaxConcurrentCompilations); 758int maxConcurrent = Math.Min(assemblyBuilders.Count, CompilationUtil.MaxConcurrentCompilations);
Configuration\MachineKeySection.cs (1)
670int bytesToCopy = Math.Min(_HashSize, bytesToWrite);
HttpBufferlessInputStream.cs (1)
277int bytesRead = Math.Min(count, preloadedRemaining);
Management\AppDomainResourcePerfCounters.cs (1)
124_CPUUsageLastReported = Math.Min(100, Math.Max(0, cpuPercent)); // Make sure it's within 0 and 100
Management\MailWebEventProvider.cs (1)
200int chunkSize = Math.Min(MaxEventsPerMessage, eventsInNotification - eventsSent);
Management\webeventbuffer.cs (1)
401toFlush = Math.Min(_buffer.Count, max);
Security\Cryptography\CryptoUtil.cs (1)
118int bytesToCopy = Math.Min(bytesRemaining, hashed.Length);
Security\Cryptography\SP800_108.cs (1)
100int numBytesToCopy = Math.Min(numBytesRemaining, K_i.Length);
Security\SQLMembershipProvider.cs (1)
1923int len = Math.Min(bSalt.Length, bKey.Length - iter);
UI\WebControls\GridView.cs (1)
2933_pageIndex = Math.Min(_pageIndex, expectedPageCount - 1);
UI\WebControls\TreeView.cs (1)
3366populatedNodes = new Dictionary<int, TreeNode>(Math.Min(logLength, 16)); // don't eagerly allocate the maximum dictionary size
Util\CultureUtil.cs (1)
35int lastIndex = Math.Min(cultureNames.Length, maxCount) - 1;
Util\ReadWriteSpinLock.cs (1)
263baseSpins = Math.Min(LOCK_MAXIMUM_SPINS, baseSpins);
System.Web.DataVisualization (15)
Common\Formulas\Oscillator.cs (1)
124 int period = Math.Min(ExpAvg.Length,ExpAvgDistribution.Length);
Common\General\Axis.cs (2)
3720 _minLabelFontSize = Math.Min(this.LabelAutoFitMinFontSize, this.LabelAutoFitMaxFontSize); 4760 _minLabelFontSize = Math.Min(this.LabelAutoFitMinFontSize, this.LabelAutoFitMaxFontSize);
Common\General\ChartGraphics3D.cs (4)
2495 leftPoint = ChartGraphics.FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index) - 1, (multiSeries) ? secondPoint : null, ref pointArrayIndex); 2496 leftPointAttr = ChartGraphics.FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index), (multiSeries) ? secondPoint : null, ref pointArrayIndex); 2556 rightPoint = ChartGraphics.FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index) - 1, (multiSeries) ? secondPoint : null, ref pointArrayIndex); 2557 rightPointAttr = ChartGraphics.FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index), (multiSeries) ? secondPoint : null, ref pointArrayIndex);
Common\General\Legend.cs (7)
477 Math.Min(legendPosition.Height, titleSize.Height)); 514 Math.Min(legendPosition.Height - this._titlePosition.Height, highestHeader.Height)); 632 Math.Min(this._numberOfLegendItemsToProcess, this._numberOfRowsPerColumn[0]); 639 Math.Min(this._numberOfLegendItemsToProcess, this._itemColumns); 1027 horizSpaceLeft -= Math.Min(4, horizSpaceLeft); 1028 vertSpaceLeft -= Math.Min(2, vertSpaceLeft); 2537 step = (int)Math.Min(step, 10);
Common\General\LegendColumns.cs (1)
2407 int markerSize = (int)Math.Min(seriesMarkerPosition.Width, seriesMarkerPosition.Height);
System.Web.Mobile (3)
UI\MobileControls\Form.cs (1)
529int page = Math.Max(Math.Min(_currentPage, _pageCount), 1);
UI\MobileControls\ItemPager.cs (2)
104_firstPageItemCount = Math.Min(_fullPageItemCount, itemCount); 110_lastPageItemCount = Math.Min(_fullPageItemCount, itemCount);
System.Windows.Forms (167)
misc\GDI\UnsafeNativeMethods.cs (11)
381lpRect.top = Math.Min( Int16.MaxValue, lpRect.top ); 382lpRect.left = Math.Min( Int16.MaxValue, lpRect.left ); 383lpRect.right = Math.Min( Int16.MaxValue, lpRect.right ); 384lpRect.bottom = Math.Min( Int16.MaxValue, lpRect.bottom ); 392byteCount = Math.Min( byteCount, IntNativeMethods.MaxTextLengthInWin9x ); 420lpRect.top = Math.Min(Int16.MaxValue, lpRect.top); 421lpRect.left = Math.Min(Int16.MaxValue, lpRect.left); 422lpRect.right = Math.Min(Int16.MaxValue, lpRect.right); 423lpRect.bottom = Math.Min(Int16.MaxValue, lpRect.bottom); 431byteCount = Math.Min( byteCount, IntNativeMethods.MaxTextLengthInWin9x); 466byteCount = Math.Min( text.Length, IntNativeMethods.MaxTextLengthInWin9x);
misc\GDI\WindowsGraphics2.cs (1)
91int sideLength = Math.Min(bounds.Width, bounds.Height);
winforms\Managed\System\WinForms\ButtonInternal\ButtonBaseAdapter.cs (10)
505size = System.Math.Min(size, System.Math.Min(r.Width, r.Height)); 1374int textBottom = Math.Min(layout.textBounds.Bottom, layout.field.Bottom); 1375layout.textBounds.Y = Math.Max(Math.Min(layout.textBounds.Y, layout.field.Y + (layout.field.Height - layout.textBounds.Height)/2), layout.field.Y); 1380int textRight = Math.Min(layout.textBounds.Right, layout.field.Right); 1381layout.textBounds.X = Math.Max(Math.Min(layout.textBounds.X, layout.field.X + (layout.field.Width - layout.textBounds.Width)/2), layout.field.X); 1386layout.imageBounds.Width = Math.Max(0, Math.Min(maxBounds.Width - layout.textBounds.Width, layout.imageBounds.Width)); 1391layout.imageBounds.Height = Math.Max(0, Math.Min(maxBounds.Height - layout.textBounds.Height, layout.imageBounds.Height)); 1421bottom = Math.Min(layout.textBounds.Bottom, maxBounds.Bottom); 1427bottom = Math.Min(layout.textBounds.Bottom, layout.field.Bottom);
winforms\Managed\System\WinForms\ColorDialog.cs (1)
145int length = value == null? 0: Math.Min(value.Length, 16);
winforms\Managed\System\WinForms\ColumnHeader.cs (1)
136int lowDI = Math.Min(this.DisplayIndexInternal, value);
winforms\Managed\System\WinForms\ComboBox.cs (1)
3372int count = Math.Min(Math.Max(itemCount, 1), maxDropDownItems);
winforms\Managed\System\WinForms\Command.cs (1)
75icmdLim = Math.Min(idLim - idMin, 2 * icmd);
winforms\Managed\System\WinForms\Control.cs (2)
6167int width = Math.Min(this.Width, targetBounds.Width); 6168int height = Math.Min(this.Height, targetBounds.Height);
winforms\Managed\System\WinForms\ControlPaint.cs (3)
1910int minDim = Math.Min(width, height); 2826min = Math.Min( Math.Min(r,g), b);
winforms\Managed\System\WinForms\CurrencyManager.cs (3)
377this.listposition = Math.Min(newPosition, Count - 1); 660ChangeRecordState(Math.Min(listposition,list.Count - 1), true, false, true, false); 703ChangeRecordState(Math.Min(listposition, Count - 1), true, false, true, false);
winforms\Managed\System\WinForms\DataGrid.cs (18)
2768int rowCount = Math.Min(currentDataGridRows.Length, dataGridRows.Length); 2987return Math.Min(numVisibleCols, this.myGridTable == null ? 0 : this.myGridTable.GridColumnStyles.Count); 3138currentRow = Math.Min(currentRow, this.listManager.Count); 3661se.NewValue = Math.Min(se.NewValue, DataGridRowsLength - numTotallyVisibleRows); 4125int lowerRow = Math.Min(lastRowSelected, location.row); 4270int lowerRow = Math.Min(lastRowSelected, rowOver); 4386newRow = Math.Max(0, Math.Min(newRow, DataGridRowsLength - numTotallyVisibleRows)); 4704r.Y = Math.Min(inside.Bottom - 3, r.Y); 4712r.X = Math.Min(inside.Right - 3, r.X); 4932int x = rightToLeft ? Math.Max(e.X, layout.Data.X) : Math.Min(e.X, layout.Data.Right + 1); 5135int y = Math.Min(e.Y, layout.Data.Y + layout.Data.Height + 1); 6227int lastCol = Math.Min(col, columns.Count); 6344int lastRow = Math.Min(row, DataGridRowsLength); 6901for (int i = 0; i < Math.Min(newDataGridRowsLength, DataGridRowsLength); i++) { 7908CurrentRow = Math.Min(DataGridRowsLength - (policy.AllowAdd ? 2:1), currentRow + numTotallyVisibleRows); 7929CurrentRow = Math.Min(DataGridRowsLength - (policy.AllowAdd ? 2:1), 8607int newFirstRow = Math.Max(0, Math.Min(firstVisibleRow + rows, this.DataGridRowsLength -1)); 8664newCol = Math.Min(newCol, nGridCols - 1);
winforms\Managed\System\WinForms\DataGridCaption.cs (1)
482Math.Min(textWidthLeft, 2 * textPadding + textSize.Width),
winforms\Managed\System\WinForms\DataGridParentRows.cs (4)
880paintBounds.Width = Math.Min(paintBounds.Width, tableNameBoxWidth); 924paintBounds.Width = Math.Min(bounds.Width - cx, colsNameWidths[i]); 943paintBounds.Width = Math.Min(bounds.Width - cx, colsDataWidths[i]); 970paintBounds.Width = Math.Min(bounds.Width - cx, 3);
winforms\Managed\System\WinForms\DataGridViewComboBoxCell.cs (5)
761dropHeight = Math.Min(GetDropDownButtonHeight(g, cellStyle), adjustedSize.Height - 2); 764int dropWidth = Math.Min(SystemInformation.HorizontalScrollBarThumbWidth, adjustedSize.Width - 2 * DATAGRIDVIEWCOMBOBOXCELL_margin - 1); 2226int dropWidth = Math.Min(SystemInformation.HorizontalScrollBarThumbWidth, valBounds.Width - 2 * DATAGRIDVIEWCOMBOBOXCELL_margin - 1); 2233dropHeight = Math.Min(GetDropDownButtonHeight(g, cellStyle), paintPostXPThemes ? valBounds.Height : valBounds.Height - 2); 2237dropHeight = Math.Min(GetDropDownButtonHeight(g, cellStyle), valBounds.Height - 4);
winforms\Managed\System\WinForms\DataGridViewDataConnection.cs (1)
706int lo = Math.Min(e.OldIndex, e.NewIndex);
winforms\Managed\System\WinForms\DataGridViewImageCell.cs (4)
501preferredSize = new Size(0, Math.Min(img.Height, Decimal.ToInt32((decimal)img.Height * imgWidthAllowed / img.Width))); 513preferredSize = new Size(0, Math.Min(ico.Height, Decimal.ToInt32((decimal)ico.Height * icoWidthAllowed / ico.Width))); 536preferredSize = new Size(Math.Min(img.Width, Decimal.ToInt32((decimal)img.Width * imgHeightAllowed / img.Height)), 0); 548preferredSize = new Size(Math.Min(ico.Width, Decimal.ToInt32((decimal)ico.Width * icoHeightAllowed / ico.Height)), 0);
winforms\Managed\System\WinForms\DataGridViewMethods.cs (19)
1121int widthLoss = Math.Min(stepDownAvailableWidthForFillColumns - availableWidth, Math.Max(1, (int)(stepDownAvailableWidthForFillColumns * 0.1F))); 1152mostDeservingDataGridViewColumn.DesiredFillWidth = Math.Min(oldDesiredWidth, (int)Math.Round(floatDesiredWidth, MidpointRounding.AwayFromZero)); 2494cursorClip.Width = Math.Min(frozenWidth, this.layout.Data.Width); 2507cursorClip.Width = Math.Min(scrollingWidth, this.layout.Data.Width); 3027r.X = Math.Min(r.X, inside.Right - r.Width); 3032r.X = Math.Min(inside.Right - r.Width, r.X); 3048r.X = Math.Min(inside.Right - 3, r.X); 3058r.Y = Math.Min(inside.Bottom - 3, r.Y); 4358colHeaders.Height = Math.Min(this.columnHeadersHeight, colHeaders.Height); 4372rowHeaders.Width = Math.Min(this.rowHeadersWidth, rowHeaders.Width); 4390topLeft.Width = Math.Min(this.rowHeadersWidth, topLeft.Width); 5727rectInsertionBar.X = Math.Min(GetColumnXFromIndex(this.trackColumnEdge) + this.Columns[this.trackColumnEdge].Width - offsetFromCenter, 6085int y = Math.Min(e.Y + this.mouseBarOffset, this.layout.Data.Bottom - 1); 6155newX = Math.Min(x + this.mouseBarOffset, this.layout.Data.Right - 1); 6329x = Math.Min(e.X + this.mouseBarOffset, this.layout.Data.Right - 1); 6356int y = Math.Min(e.Y + this.mouseBarOffset, this.layout.Data.Bottom - 1); 9080int preferredWidth = Math.Min(minimumWidth + this.Columns.GetColumnsWidth(DataGridViewElementStates.Visible), proposedConstraints.Width); 9095int preferredHeight = Math.Min(minimumHeight + this.Rows.GetRowsHeight(DataGridViewElementStates.Visible), proposedConstraints.Height); 18165rowIndex = Math.Min(rowIndex, this.Rows.Count - 1);
winforms\Managed\System\WinForms\Form.cs (2)
1608Size = new Size(Math.Min(size.Width, value.Width), Math.Min(size.Height, value.Height));
winforms\Managed\System\WinForms\GroupBox.cs (1)
622int textRight = Math.Min( textLeft + textSize.Width, Width - 6);
winforms\Managed\System\WinForms\Layout\CommonProperties.cs (2)
214bounds.Width = Math.Min(bounds.Width, value.Width); 215bounds.Height = Math.Min(bounds.Height, value.Height);
winforms\Managed\System\WinForms\Layout\LayoutUtils.cs (2)
204Math.Min(a.Width, b.Width), 205Math.Min(a.Height, b.Height));
winforms\Managed\System\WinForms\Layout\TableLayout.cs (15)
258containerInfo.ColumnStyles[0].SetSize(Math.Max(oldWidth, Math.Min(proposedConstraints.Width, containerSize.Width))); 442rowStop = Math.Min(currentRow + flowElement.RowSpan, maxRows); 459fixedElement.RowStart = Math.Min(fixedElement.RowPosition, maxRows - 1); 460fixedElement.ColumnStart = Math.Min(fixedElement.ColumnPosition, maxColumns - 1); 496colStop = Math.Min(fixedElement.ColumnStart + fixedElement.ColumnSpan, maxColumns); 497rowStop = Math.Min(fixedElement.RowStart + fixedElement.RowSpan, maxRows); 624colStop = Math.Min(layoutInfo.ColumnSpan, maxColumns); 745int colStop = Math.Min(layoutInfo.ColumnStart + layoutInfo.ColumnSpan, containerInfo.Columns.Length); 780int stealAmount = Math.Min(currentOverflow, totalPercentAllocatedSpace); 848int rowStop = Math.Min(layoutInfo.RowStart + layoutInfo.RowSpan, containerInfo.Rows.Length); 867for(int i = start; i < Math.Min(start + span, strips.Length); i++) { 933int offset = Math.Min(sizeProxy.Size, missingLength); 1135int delta = Math.Min(strip.MaxSize - strip.MinSize, remainingSpace); 1238elementBounds.Width = Math.Min(cellBounds.Width, elementBounds.Width); 1239elementBounds.Height = Math.Min(cellBounds.Height, elementBounds.Height);
winforms\Managed\System\WinForms\LinkLabel.cs (2)
765int length = (int) Math.Min(link.Length, textLen - link.Start); 1847int minEnd = Math.Min(left.Start + left.Length, right.Start + right.Length);
winforms\Managed\System\WinForms\LinkUtilities.cs (1)
54int nMax = Math.Min(rgb.Length, rgbs.Length);
winforms\Managed\System\WinForms\ListView.cs (5)
1840topIndex = Math.Min(topIndex, this.VirtualListSize - 1); 3905lvItem.cColumns = this.columnHeaders != null ? Math.Min(MAXTILECOLUMNS, this.columnHeaders.Length) : 0; 5681int lowDI = Math.Min(from, to); 6156Marshal.Copy(byteBuf, 0, infoTip.lpszText, Math.Min(byteBuf.Length, infoTip.cchTextMax)); 6161Marshal.Copy(charBuf, 0, infoTip.lpszText, Math.Min(charBuf.Length, infoTip.cchTextMax));
winforms\Managed\System\WinForms\Printing\PrintPreviewControl.cs (3)
286value = Math.Min(value, pageInfo.Length - (rows * columns)); 743position.X = Math.Min(position.X, virtualSize.Width - Width); 744position.Y = Math.Min(position.Y, virtualSize.Height - Height);
winforms\Managed\System\WinForms\PropertyGrid.cs (4)
2334cyNew = Math.Min((rectTarget.Y + rectTarget.Height - 15),cyNew); 3071height = Math.Min(dcRequestedHeight, maxSpace); 3079height = Math.Min(dcRequestedHeight, maxSpace / 2 - 1); 3106height = Math.Min(hcRequestedHeight, maxSpace);
winforms\Managed\System\WinForms\PropertyGridInternal\DocComment.cs (1)
150Math.Min(lineHeight, size.Height),
winforms\Managed\System\WinForms\PropertyGridInternal\GridEntry.cs (1)
1918int maxSpace = Math.Min(rect.Width-stringX-1, labelWidth + PropertyGridView.GDIPLUS_SPACE);
winforms\Managed\System\WinForms\PropertyGridInternal\PropertyGridView.cs (10)
1641loc.X = Math.Min(rectScreen.X + rectScreen.Width - size.Width, 1720loc.X = Math.Min(rectScreen.X + rectScreen.Width - size.Width, 2349int pos = Math.Max(Math.Min(xpos,widthPS-10),GetOutlineIconSize() * 2); 3370newOffset = Math.Min(newOffset, totalProps - visibleRows+1); 3401newOffset = Math.Min(newOffset, totalProps - visibleRows+1); 3471int cPropsVisible = Math.Min(totalProps - GetScrollOffset(),1+visibleRows); 3503cPropsVisible = Math.Min(cPropsVisible, endRow+1); 3907DropDownListBox.Height = Math.Max(tm.tmHeight + 2, Math.Min(maxListBoxHeight, DropDownListBox.PreferredHeight)); 4665int posNew = Math.Max(0, Math.Min(totalProps - visibleRows + 1, cOffset)); 5389m.Result = (IntPtr)Math.Min(visibleRows, totalProps);
winforms\Managed\System\WinForms\RichTextBox.cs (1)
2166txrg.chrg.cpMax = Math.Min(txrg.chrg.cpMax, end);
winforms\Managed\System\WinForms\ScrollableControl.cs (4)
714pos = Math.Min(pos, maxPos); 729pos = Math.Min(pos, maxPos); 847int minX = Math.Min(client.Width - displayRectangle.Width, 0); 848int minY = Math.Min(client.Height - displayRectangle.Height, 0);
winforms\Managed\System\WinForms\ScrollBar.cs (4)
323return Math.Min(largeChange, maximum - minimum + 1); 416return Math.Min(smallChange, LargeChange); 880newValue = Math.Min(value + SmallChange, maximum - LargeChange + 1); // max - lChange + 1); 888newValue = Math.Min(value + LargeChange, maximum - LargeChange + 1); // si.nPos + si.nPage,si.nMax - si.nPage + 1);
winforms\Managed\System\WinForms\ScrollProperties.cs (2)
110return Math.Min(largeChange, maximum - minimum + 1); 230return Math.Min(smallChange, LargeChange);
winforms\Managed\System\WinForms\SplitContainer.cs (4)
1276x = Math.Max(Math.Min(x, Width - Panel2MinSize), Panel1MinSize); 1280y = Math.Max(Math.Min(y, Height - Panel2MinSize), Panel1MinSize); 1678return Math.Max(Math.Min(size, Width - Panel2MinSize), Panel1MinSize); 1681return Math.Max(Math.Min(size, Height - Panel2MinSize), Panel1MinSize);
winforms\Managed\System\WinForms\Splitter.cs (1)
859return Math.Max(Math.Min(size, maxSize), minSize);
winforms\Managed\System\WinForms\StatusStrip.cs (1)
228int gripHeight = Math.Min(DefaultSize.Height, statusStripSize.Height);
winforms\Managed\System\WinForms\ThreadExceptionDialog.cs (1)
292scaledMessageTopPadding + (scaledMaxTextHeight - Math.Min(textSize.Height, scaledMaxTextHeight)) / 2,
winforms\Managed\System\WinForms\ToolStripDropDownMenu.cs (1)
818minY = Math.Min(minY, item.Bounds.Top);
winforms\Managed\System\WinForms\ToolStripManager.cs (3)
2019int insertIndex = Math.Min(destinationItems.Count, source.MergeIndex); 2127historyItem.PreviousIndexCollection.Insert(Math.Min(historyItem.PreviousIndex, historyItem.PreviousIndexCollection.Count), historyItem.TargetItem); 2130historyItem.IndexCollection.Insert(Math.Min(historyItem.Index, historyItem.IndexCollection.Count), historyItem.TargetItem);
winforms\Managed\System\WinForms\ToolStripOverflowButton.cs (2)
110preferredSize.Width = Math.Min(constrainingSize.Width, maxWidth); 113preferredSize.Height = Math.Min(constrainingSize.Height, maxHeight);
winforms\Managed\System\WinForms\ToolStripSplitButton.cs (1)
372dropDownButtonBounds = new Rectangle(Point.Empty, new Size(Math.Min(this.Width, DropDownButtonWidth), this.Height));
winforms\Managed\System\WinForms\ToolTip.cs (2)
2337Math.Min(currentTooltipSize.Width-2*XBALLOONOFFSET, screen.WorkingArea.Width): 2338Math.Min(currentTooltipSize.Width, screen.WorkingArea.Width);
winforms\Managed\System\WinForms\TrackBar.cs (1)
1007Value = Math.Min(absScrollBands+Value, Maximum);
winforms\Managed\System\WinForms\UnsafeNativeMethods.cs (2)
6570int count = Math.Min(bytes.Length, buffer.Length - offset); 6613int count = Math.Min(s.Length, buffer.Length - offset);
winforms\Managed\System\WinForms\WinFormsUtils.cs (2)
104bounds.Size = new Size(Math.Min(constrainingBounds.Width -2, bounds.Width), 105Math.Min(constrainingBounds.Height -2, bounds.Height));
System.Windows.Forms.DataVisualization (15)
Common\Formulas\Oscillator.cs (1)
124 int period = Math.Min(ExpAvg.Length,ExpAvgDistribution.Length);
Common\General\Axis.cs (2)
3720 _minLabelFontSize = Math.Min(this.LabelAutoFitMinFontSize, this.LabelAutoFitMaxFontSize); 4760 _minLabelFontSize = Math.Min(this.LabelAutoFitMinFontSize, this.LabelAutoFitMaxFontSize);
Common\General\ChartGraphics3D.cs (4)
2495 leftPoint = ChartGraphics.FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index) - 1, (multiSeries) ? secondPoint : null, ref pointArrayIndex); 2496 leftPointAttr = ChartGraphics.FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index), (multiSeries) ? secondPoint : null, ref pointArrayIndex); 2556 rightPoint = ChartGraphics.FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index) - 1, (multiSeries) ? secondPoint : null, ref pointArrayIndex); 2557 rightPointAttr = ChartGraphics.FindPointByIndex(points, Math.Min(firstPoint.index, secondPoint.index), (multiSeries) ? secondPoint : null, ref pointArrayIndex);
Common\General\Legend.cs (7)
477 Math.Min(legendPosition.Height, titleSize.Height)); 514 Math.Min(legendPosition.Height - this._titlePosition.Height, highestHeader.Height)); 632 Math.Min(this._numberOfLegendItemsToProcess, this._numberOfRowsPerColumn[0]); 639 Math.Min(this._numberOfLegendItemsToProcess, this._itemColumns); 1027 horizSpaceLeft -= Math.Min(4, horizSpaceLeft); 1028 vertSpaceLeft -= Math.Min(2, vertSpaceLeft); 2537 step = (int)Math.Min(step, 10);
Common\General\LegendColumns.cs (1)
2407 int markerSize = (int)Math.Min(seriesMarkerPosition.Width, seriesMarkerPosition.Height);
System.Workflow.Activities (8)
Designers\StateDesigner.cs (1)
1434freeSpaceHeight = Math.Min(freeSpaceHeight, stateDesigner.Location.Y - minimumY);
Designers\StateMachineDesignerPaint.cs (4)
123capSize = Math.Min(Math.Min(capSize, maxCapSize.Width), maxCapSize.Height); 150capSize = Math.Min(Math.Min(capSize, maxCapSize.Width), maxCapSize.Height);
Rules\Design\Dialogs\BasicBrowserDialog.cs (1)
231int newSelectionIndex = Math.Min(selectionIndex, this.rulesListView.Items.Count - 1);
Rules\Design\Dialogs\RuleSetDialog.cs (1)
329int newSelectionIndex = Math.Min(selectionIndex, this.rulesListView.Items.Count - 1);
Rules\RuleValidation.cs (1)
2902int len = Math.Min(test.Length, reference.Length);
System.Workflow.ComponentModel (58)
AuthoringOM\Design\ActivityDesigner.cs (3)
1715requestedLineSize.Width *= Math.Min(Text.Length, ActivityDesigner.MaximumCharsPerLine - 1); 1720this.textSize.Width = Math.Min(this.textSize.Width, actualTextSize.Width); 1727textLines = Math.Min(textLines, ActivityDesigner.MaximumTextLines);
AuthoringOM\Design\CommandSet.cs (1)
290this.workflowView.Zoom = Math.Min(Math.Max(newZoom, AmbientTheme.MinZoom), AmbientTheme.MaxZoom);
AuthoringOM\Design\CompositeActivityDesigner.cs (3)
341requestedLineSize.Width *= Math.Min(Text.Length, CompositeActivityDesigner.MaximumCharsPerLine - 1); 344textSize.Width = Math.Min(maxAvailableWidth, this.actualTextSize.Width); 350textLines = Math.Min(textLines, CompositeActivityDesigner.MaximumTextLines);
AuthoringOM\Design\Connector.cs (8)
1819begin.X = Math.Min(Math.Max(begin.X, enclosingRectangle.Left + 1), enclosingRectangle.Right - 1); 1820begin.Y = Math.Min(Math.Max(begin.Y, enclosingRectangle.Top + 1), enclosingRectangle.Bottom - 1); 2618return (this.orientation == Orientation.Horizontal) ? (p.X >= Math.Min(this.point1.X, this.point2.X) && p.X <= Math.Max(this.point1.X, this.point2.X)) : (p.Y >= Math.Min(this.point1.Y, this.point2.Y) && p.Y <= Math.Max(this.point1.Y, this.point2.Y)); 2632if (vertical.A.X < Math.Min(horizontal.A.X, horizontal.B.X) || vertical.A.X > Math.Max(horizontal.A.X, horizontal.B.X)) 2635if (horizontal.A.Y < Math.Min(vertical.A.Y, vertical.B.Y) || horizontal.A.Y > Math.Max(vertical.A.Y, vertical.B.Y)) 2656return k >= Math.Min(k1, k2) && k <= Math.Max(k1, k2); 2712if (k == Math.Min(k1, k2))
AuthoringOM\Design\DesignerHelpers.cs (8)
203rectangle.Width = Math.Min(size.Width, destination.Width); 204rectangle.Height = Math.Min(size.Height, destination.Height); 602capSize = Math.Min(Math.Min(capSize, maxCapSize.Width), maxCapSize.Height); 632capSize = Math.Min(Math.Min(capSize, maxCapSize.Width), maxCapSize.Height); 1888leftTop.X = Math.Min(leftTop.X, point.X); 1889leftTop.Y = Math.Min(leftTop.Y, point.Y);
AuthoringOM\Design\DesignerWidgets.cs (14)
370this.itemStrip.Size = new Size(Math.Min(availableSize, reqdSize.Width), Math.Min(this.bounds.Height, reqdSize.Height)); 378this.itemStrip.Size = new Size(Math.Min(this.bounds.Width, reqdSize.Width), Math.Min(availableSize, reqdSize.Height)); 1265textRectangle.Height = Math.Min(textRectangle.Height, this.maxTextHeight); 1346maxTextSize.Width = Math.Min(maxTextSize.Width, this.maximumTextWidth); 2533int maxItems = Math.Min(this.items.Count - this.scrollMarker, VisibleItemCount) + 1; 2711int selectionSize = Math.Max(Math.Min(itemMargin.Width / 4, itemMargin.Height / 2), 1); 2846scrollButtonSize.Height = Math.Min(scrollButtonSize.Width, Math.Min(scrollButtonSize.Height, ItemSize.Height)); 2847scrollButtonSize.Width = Math.Min(scrollButtonSize.Width, scrollButtonSize.Height); 3114index = Math.Max(Math.Min(accessibleObjects.Length - 1, index), 0); 3387this.previewDescTextSize.Width = Math.Min(this.canvasBounds.Size.Width - margin.Width - this.previewModeButtonRectangle.Size.Width, this.previewDescTextSize.Width); 3390this.previewModeButtonRectangle.Height = Math.Min(designerTheme.PreviewButtonSize.Height, this.previewDescTextSize.Height);
AuthoringOM\Design\FreeFormDesigner.cs (4)
791newLocation.X = Math.Min(newLocation.X, childRectangle.Left); 792newLocation.Y = Math.Min(newLocation.Y, childRectangle.Top); 935bounds.X = Math.Min(minRectangle.Left, e.Bounds.Left); 936bounds.Y = Math.Min(minRectangle.Top, e.Bounds.Top);
AuthoringOM\Design\MessageFilters\DragSelectionMessageFilter.cs (2)
134return new Rectangle(Math.Min(this.startDrag.X, this.endDrag.X), Math.Min(this.startDrag.Y, this.endDrag.Y), Math.Abs(this.endDrag.X - this.startDrag.X), Math.Abs(this.endDrag.Y - this.startDrag.Y));
AuthoringOM\Design\MessageFilters\WindowManager.cs (1)
426newZoom = Math.Min(newZoom, AmbientTheme.MaxZoom);
AuthoringOM\Design\MessageFilters\ZoomingMessageFilter.cs (1)
185parentView.Zoom = Math.Min(Math.Max(zoomLevel, AmbientTheme.MinZoom), AmbientTheme.MaxZoom);
AuthoringOM\Design\Themes.cs (6)
2883Color minorGridColor = Color.FromArgb(this.gridColor.A, Math.Min(this.gridColor.R + 32, 255), Math.Min(this.gridColor.G + 32, 255), Math.Min(this.gridColor.B + 32, 255)); 2899Color minorGridColor = Color.FromArgb(this.gridColor.A, Math.Min(this.gridColor.R + 32, 255), Math.Min(this.gridColor.G + 32, 255), Math.Min(this.gridColor.B + 32, 255));
AuthoringOM\Design\WorkflowPrinting.cs (2)
256for (int i = 0; i < Math.Min(headerFooterLines.Length, MaxHeaderFooterLines); i++) 267layoutRectangle.Width = Math.Min(headerFooterPrintData.PageBoundsWithoutMargin.Width, layoutRectangle.Width);
AuthoringOM\Design\WorkflowView.cs (5)
466value.X = Math.Min(value.X, hScrollBar.Maximum - hScrollBar.LargeChange + 1); 474value.Y = Math.Min(value.Y, vScrollBar.Maximum - vScrollBar.LargeChange + 1); 946Zoom = Math.Min(Math.Max(newZoom, AmbientTheme.MinZoom), AmbientTheme.MaxZoom); 1798Size largeChangeSize = new Size(Math.Min(maximumScrollSize.Width, currentSize.Width), Math.Min(maximumScrollSize.Height, currentSize.Height));
System.Workflow.Runtime (3)
Hosting\DefaultWorkflowSchedulerService.cs (1)
153int nToStart = Math.Min(maxSimultaneousWorkflows, waitingQueue.Count);
Tracking.cs (1)
1894Array.Copy(result, result16, Math.Min(result16.Length, result.Length));
WorkflowDefinitionDispenser.cs (1)
166Array.Copy(xomlHashCode256, xomlHashCode, Math.Min(xomlHashCode.Length, xomlHashCode256.Length));
System.Xml (4)
System\Xml\BinaryXml\SqlUtils.cs (1)
204bNewPrec = (byte)(Math.Min(NUMERIC_MAX_PRECISION, Math.Max(1, lAdjust + m_bPrec)));
System\Xml\Schema\BitSet.cs (1)
188int i = Math.Min(this.bits.Length, other.bits.Length);
System\Xml\Serialization\XmlSerializationReader.cs (2)
486currentSize = Math.Min(currentSize*2, MAX_ALLOC_SIZE); 504currentSize = Math.Min(block.Length, total);
UIAutomationClientsideProviders (10)
MS\Internal\AutomationProxies\WindowsEditBox.cs (2)
405clientLocation.x = Math.Min(clientLocation.x, clientRect.right); 407clientLocation.y = Math.Min(clientLocation.y, clientRect.bottom);
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (5)
141End = Math.Min(Math.Max(End, Start + 1), text.Length); 175End = Math.Min(Math.Max(End, Start + 1), text.Length); 321return text.Substring(Start, maxLength >= 0 ? Math.Min(Length, maxLength) : Length); 849moved = Math.Min(count, limit - index); 894moved = Math.Min(count, lineMax - line - 1);
MS\Internal\AutomationProxies\WindowsListViewItem.cs (1)
961clickPoint.x = Math.Min ((itemRectangle.left + 5), (itemRectangle.left + itemRectangle.right) / 2);
MS\Internal\AutomationProxies\WindowsRichEditRange.cs (2)
89_range.SetRange(Math.Max(charRange.Start, paraRange.Start), Math.Min(charRange.End, paraRange.End)); 185int end = Math.Min(_range.End, visibleRange.End);
WindowsBase (2)
Shared\MS\Win32\NativeMethodsCLR.cs (2)
6215int count = Math.Min(bytes.Length, buffer.Length - offset); 6277int count = Math.Min(s.Length, buffer.Length - offset);