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\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\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));
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\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);