6071 references to Math
mscorlib (95)
parent\parent\parent\parent\InternalApis\NDP_Common\inc\PinnableBufferCache.cs (2)
297m_restockSize = Math.Max(m_restockSize, m_minBufferCount - m_buffersUnderManagement); 391m_restockSize = Math.Max(newRestockSize, DefaultNumberOfBuffers);
system\Collections\Concurrent\ConcurrentDictionary.cs (2)
624m_budget = Math.Max(1, newTables.m_buckets.Length / newTables.m_locks.Length); 1924m_budget = Math.Max(1, newBuckets.Length / newLocks.Length);
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 (4)
471requestedChunkSize = Math.Min(m_currentChunkSize.Value * 2, m_maxChunkSize); 1152long newSharedIndex = Math.Min(SourceCount - 1, oldSharedIndex + requestedChunkSize); 1429quotient = Math.DivRem(SourceCount, partitionCount, out remainder); 1717chunkSize = Math.Max(1, DEFAULT_BYTES_PER_CHUNK / Marshal.SizeOf(typeof(TSource)));
system\collections\hashtable.cs (1)
1705int limit = (int)Math.Sqrt (candidate);
system\convert.cs (2)
1313return checked((long)Math.Round(value)); 1418return checked((ulong)Math.Round(value));
system\diagnostics\eventing\eventsource.cs (5)
2148paramCount = Math.Min(paramCount, eventDataCount); 3095dataDescrs[1].Size = (uint)Math.Min(dataLeft, chunkSize); 3448string.Compare(eventName, taskName.Length, s_ActivityStartSuffix, 0, Math.Max(eventName.Length - taskName.Length, s_ActivityStartSuffix.Length)) == 0) 3469string.Compare(startEventMetadata.Name, taskName.Length, s_ActivityStartSuffix, 0, Math.Max(startEventMetadata.Name.Length - taskName.Length, s_ActivityStartSuffix.Length)) == 0) 3642EventMetadata[] newValues = new EventMetadata[Math.Max(eventData.Length + 16, eventAttribute.EventId + 1)];
System\Diagnostics\Eventing\TraceLogging\NameInfo.cs (1)
28newIdentity = Math.Max(newIdentity, snapshot); // Should be redundant. as we only create descriptors once.
system\globalization\CalendricalCalculationsHelper.cs (16)
43return degree * Math.PI / 180; 48return Math.Sin(RadiansFromDegrees(degree)); 53return Math.Cos(RadiansFromDegrees(degree)); 57return Math.Tan(RadiansFromDegrees(degree)); 77return new DateTime(Math.Min((long)(Math.Floor(numberOfDays) * GregorianCalendar.TicksPerDay), DateTime.MaxValue.Ticks)).Year; 116double whole = Math.Floor(divisor / dividend); 161return ((Math.Pow(x, 2) / 41048480) - 15) / SecondsPerDay; 232return Math.Sign(value) == -1; 260- (0.5 * Math.Pow(y, 2) * SinOfDegree(4 * lambda)) 261- (1.25 * Math.Pow(eccentricity, 2) * SinOfDegree(2 * anomaly))); 262double divisor = 2 * Math.PI; 267return CopySign(Math.Min(Math.Abs(equation), TwelveHours), equation); 386return Math.Min(time, timeSunLastAtLongitude - (MeanSpeedOfSun * longitudeErrorDelta)); 397long lowerBoundNewYearDay = (long) Math.Floor(approx) - 1;
system\globalization\datetimeformat.cs (1)
484fraction = fraction / (long)Math.Pow(10, 7 - tokenLen);
system\globalization\datetimeparse.cs (4)
2529time = time.AddTicks((long)Math.Round(raw.fraction * Calendar.TicksPerSecond)); 2837time = time.AddTicks((long)Math.Round(partSecond * Calendar.TicksPerSecond)); 2947result = ((double)result / Math.Pow(10, digitLen)); 4152result.parsedDate = result.parsedDate.AddTicks((long)Math.Round(result.fraction * Calendar.TicksPerSecond));
system\globalization\Persiancalendar.cs (1)
228int y = (int)(Math.Floor(((yearStart - PersianEpoch) / CalendricalCalculationsHelper.MeanTropicalYearInDays) + 0.5)) + 1;
system\globalization\timespanformat.cs (3)
97fraction = (int)((long)fraction / (long)Math.Pow(10, DateTimeFormat.MaxSecondsFractionDigits - literal.ff)); 198tmp /= (long)Math.Pow(10, DateTimeFormat.MaxSecondsFractionDigits - tokenLen); 210tmp /= (long)Math.Pow(10, DateTimeFormat.MaxSecondsFractionDigits - tokenLen);
system\globalization\timespanparse.cs (2)
154return (num >= (maxValue/(long)Math.Pow(10, zeroes-1))); 533long divisor = (long)Math.Pow(10, fraction.zeroes);
system\io\bufferedstream.cs (2)
182Byte[] shadowBuffer = new Byte[Math.Min(_bufferSize + _bufferSize, MaxShadowBufferSize)]; 828Int32 bytesToWrite = Math.Min(_bufferSize - _writePos, count);
system\math.cs (9)
224alternativeResult = regularMod - (Math.Abs(y) * Math.Sign(x)); 225if (Math.Abs(alternativeResult) == Math.Abs(regularMod)) { 227double roundedResult = Math.Round(divisionResult); 228if (Math.Abs(roundedResult) > Math.Abs(divisionResult)) { 235if (Math.Abs(alternativeResult) < Math.Abs(regularMod)) {
system\random.cs (1)
62int subtraction = (Seed == Int32.MinValue) ? Int32.MaxValue : Math.Abs(Seed);
system\rttype.cs (2)
601newSize = Math.Max(Math.Max(4, 2 * cachedMembers.Length), list.Length);
system\runtime\interopservices\windowsruntime\ireadonlylisttoivectorviewadapter.cs (1)
109uint itemCount = Math.Min((uint)items.Length, (uint)_this.Count - startIndex);
system\runtime\interopservices\windowsruntime\listtovectoradapter.cs (1)
240uint itemCount = Math.Min((uint)items.Length, (uint)sourceList.Count - startIndex);
system\runtime\memoryfailpoint.cs (3)
181ulong segmentSize = (ulong) (Math.Ceiling((double)size / GCSegmentSize) * GCSegmentSize); 185ulong requestedSizeRounded = (ulong)(Math.Ceiling((double)sizeInMegabytes / MemoryCheckGranularity) * MemoryCheckGranularity); 383largestFreeRegion = Math.Max(largestFreeRegion, regionSize);
system\runtime\remoting\soapinteroptypes.cs (7)
249months = Math.Max(0, inDays - yearDays)/30; 251days = Math.Max(0, inDays - (yearDays+monthDays)); 271CarryOver(Math.Abs(timeSpan.Days), out years, out months, out days); 280sb.Append(Math.Abs(timeSpan.Hours)); 282sb.Append(Math.Abs(timeSpan.Minutes)); 284sb.Append(Math.Abs(timeSpan.Seconds)); 285long timea = Math.Abs(timeSpan.Ticks % TimeSpan.TicksPerDay);
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\runtime\serialization\formatters\binary\binaryutilclasses.cs (4)
448int size = Math.Max(negObjects.Length * 2, (-index)+1); 455int size = Math.Max(objects.Length * 2, index+1); 538int size = Math.Max(negObjects.Length * 2, (-index)+1); 545int size = Math.Max(objects.Length * 2, index+1);
system\runtime\serialization\formatterservices.cs (1)
162RuntimeType[] tempParentTypes = new RuntimeType[Math.Max(parentTypeCount*2, 12)];
system\security\permissionset.cs (1)
1440int maxIndex = Math.Max( this.m_permSet.GetMaxUsedIndex(), other.m_permSet.GetMaxUsedIndex() );
system\security\policy\policystatement.cs (1)
19using Math = System.Math;
system\security\util\tokenbasedset.cs (1)
204int iMax = Math.Max(m_maxIndex, index);
system\string.cs (2)
274int length = Math.Min(strA.Length, strB.Length); 467int length = Math.Min(strA.Length, strB.Length);
system\text\stringbuilder.cs (8)
171capacity = Math.Min(DefaultCapacity, maxCapacity); 1643int curInChunk = Math.Max(startIndexInChunk, 0); 1644int endInChunk = Math.Min(chunk.m_ChunkLength, endIndexInChunk); 1825int lengthToCopy = Math.Min(lengthInChunk, count); 1977int newBlockLength = Math.Max(minBlockCharCount, Math.Min(Length, MaxChunkSize)); 2056StringBuilder newChunk = new StringBuilder(Math.Max(count, DefaultCapacity), chunk.m_MaxCapacity, chunk.m_ChunkPrevious); 2060int copyCount1 = Math.Min(count, indexInChunk);
system\threading\Tasks\Parallel.cs (1)
139rval = (rval == -1) ? schedulerMax : Math.Min(schedulerMax, rval);
system\threading\thread.cs (1)
850maxStackSize = (int)Math.Min(defaultStackSize, (ulong)(uint)int.MaxValue);
system\threading\timer.cs (1)
140uint actualDuration = Math.Min(requestedDuration, maxPossibleDuration);
PresentationBuildTasks (3)
Core\CSharp\MS\internal\Media\XamlSerializationHelper.cs (1)
451scaledInteger = Math.Floor( scaledValue ) ;
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 (473)
Core\CSharp\MS\Internal\AnimatedTypeHelpers.cs (17)
368return Math.Abs((Int32)to - (Int32)from); 385return Math.Abs(to.ScA - from.ScA) 386+ Math.Abs(to.ScR - from.ScR) 387+ Math.Abs(to.ScG - from.ScG) 388+ Math.Abs(to.ScB - from.ScB); 396return (Double)Math.Abs(to - from); 401return Math.Abs(to - from); 406return Math.Abs(to - from); 411return Math.Abs(to - from); 416return Math.Abs(to - from); 438return Math.Abs((to - from).Length); 443return Math.Abs((to - from).Length); 463return Math.Sqrt((a * a) + (b * b)); 473return Math.Abs(to - from); 478return Math.Abs(((System.Windows.Vector)to - (System.Windows.Vector)from).Length); 495return Math.Abs((to - from).Length); 500return Math.Abs((to - from).Length);
Core\CSharp\MS\Internal\FontCache\FontCacheUtil.cs (1)
890int minLength = Math.Min(aLength, bLength);
Core\CSharp\MS\Internal\FontCache\FontFaceLayoutInfo.cs (2)
1021int smaller = Math.Min(lastChar, firstChar); 1022int larger = Math.Max(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\Bezier.cs (5)
389bool accept = (Math.Abs(det) > Math.Abs(s) * DoubleUtil.DBL_EPSILON && 390Math.Abs(det) > Math.Abs(u) * DoubleUtil.DBL_EPSILON); 537nPoints = (int)(Math.Sqrt(rCurv / tolerance)) + 3;
Core\CSharp\MS\Internal\Ink\CuspData.cs (4)
474rMin = Math.Min(rMin, a); 475rMax = Math.Max(a, rMax); 503_dist = Math.Abs(rR) + Math.Abs(rB);
Core\CSharp\MS\Internal\Ink\EllipticalNodeOperations.cs (12)
35_radius = Math.Max(_radii.Width, _radii.Height); 122double distance = Math.Sqrt(distanceSquared); 143rad *= Math.Sqrt(1 - rSinSquared); 144spine *= Math.Sqrt(rSinSquared); 625radius = Math.Abs(nearest.Y); 629radius = Math.Abs(nearest.X); 728double tmp = Math.Sqrt(B*B-4.0f * A * C); 735findex = Math.Min(s1, s2); 762findex = Math.Abs(Math.Min(s1, s2) - 0d) < Math.Abs(Math.Max(s1, s2) - 1d) ? 0d : 1d;
Core\CSharp\MS\Internal\Ink\ErasingStroke.cs (2)
186Math.Min(lastFragment.BeginFIndex, fragment.BeginFIndex), 187Math.Max(lastFragment.EndFIndex, fragment.EndFIndex));
Core\CSharp\MS\Internal\Ink\InkSerializedFormat\GorillaCodec.cs (8)
164uint ulAbsMaxDelDel = (uint)Math.Max(MathHelper.AbsNoThrow(minDelDel), MathHelper.AbsNoThrow(maxDelDel)); 166uint ulAbsMax = (uint)Math.Max(MathHelper.AbsNoThrow(minVal), MathHelper.AbsNoThrow(maxVal)); 237maxByte = Math.Max(input[n], maxByte); 238maxShort = Math.Max((ushort)shortReader.ReadUInt16Reverse(Native.BitsPerShort), maxShort); 248maxByte = Math.Max(input[n], maxByte); 249maxShort = Math.Max((ushort)shortReader.ReadUInt16Reverse(Native.BitsPerShort), maxShort); 255maxByte = Math.Max(input[n], maxByte); 297ulAbsMax = (uint)Math.Max(MathHelper.AbsNoThrow(minInt), MathHelper.AbsNoThrow(maxInt));
Core\CSharp\MS\Internal\Ink\InkSerializedFormat\InkSerializer.cs (3)
1422double dAngle = (tdrd.Transform[0] / 100) * (Math.PI / 180); 1424M00 = M11 = Math.Cos(dAngle); 1425M01 = Math.Sin(dAngle);
Core\CSharp\MS\Internal\Ink\InkSerializedFormat\SerializationHelper.cs (1)
108ull = (ulong)Math.Abs(Value);
Core\CSharp\MS\Internal\Ink\Lasso.cs (6)
156DoubleUtil.GreaterThanOrClose(point.X, Math.Min(prevLassoPoint.X, lassoPoint.X)) && 157DoubleUtil.LessThanOrClose(point.X, Math.Max(prevLassoPoint.X, lassoPoint.X))) 166if (DoubleUtil.GreaterThanOrClose(point.X, Math.Max(prevLassoPoint.X, lassoPoint.X))) 171else if (DoubleUtil.GreaterThanOrClose(point.X, Math.Min(prevLassoPoint.X, lassoPoint.X))) 523return (Math.Abs(vector.X) < MinDistance && Math.Abs(vector.Y) < MinDistance);
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\Ink\StrokeNode.cs (17)
783line1XMin = Math.Floor(line1Start.X); 784line1XMax = Math.Ceiling(line1End.X); 788line1XMin = Math.Floor(line1End.X); 789line1XMax = Math.Ceiling(line1Start.X); 794line2XMin = Math.Floor(line2Start.X); 795line2XMax = Math.Ceiling(line2End.X); 799line2XMin = Math.Floor(line2End.X); 800line2XMax = Math.Ceiling(line2Start.X); 805line1YMin = Math.Floor(line1Start.Y); 806line1YMax = Math.Ceiling(line1End.Y); 810line1YMin = Math.Floor(line1End.Y); 811line1YMax = Math.Ceiling(line1Start.Y); 816line2YMin = Math.Floor(line2Start.Y); 817line2YMax = Math.Ceiling(line2End.Y); 821line2YMin = Math.Floor(line2End.Y); 822line2YMax = Math.Ceiling(line2Start.Y); 1069double floor = Math.Floor(findex);
Core\CSharp\MS\Internal\Ink\StrokeNodeOperations.cs (2)
752double r = (Math.Abs(nextNode.X) < Math.Abs(nextNode.Y)) //DoubleUtil.IsZero(nextNode.X)
Core\CSharp\MS\Internal\Ink\StrokeNodeOperations2.cs (1)
512return Math.Sqrt(nearestOnFirst.LengthSquared / shortest.LengthSquared);
Core\CSharp\MS\Internal\Ink\StrokeRenderer.cs (27)
95double delta = Math.Abs(GetAngleDeltaFromLast(strokeNode.PreviousPosition, strokeNode.Position, ref lastAngle)); 115if ((Math.Min(prevArea, currArea) / Math.Max(prevArea, currArea)) <= 0.70d) 258double maxExtent = Math.Max(drawingAttributes.Height, drawingAttributes.Width); 259percentIntersect += Math.Min(4.99999d, ((maxExtent / 20d) * 5d)); 528bool directionChangedOverAbsoluteThreshold = Math.Abs(delta) > 90d && Math.Abs(delta) < (360d - 90d); 529bool directionChangedOverOverlapThreshold = overlap && !(ignorePressure || strokeNode.PressureFactor == 1f) && Math.Abs(delta) > 30d && Math.Abs(delta) < (360d - 30d); 538if ((Math.Min(prevArea, currArea) / Math.Max(prevArea, currArea)) <= 0.90d) 848double intersectLeft = Math.Max(rect1.Left, rect2.Left); 849double intersectTop = Math.Max(rect1.Top, rect2.Top); 850double intersectWidth = Math.Max((double)(Math.Min(rect1.Right, rect2.Right) - intersectLeft), (double)0); 851double intersectHeight = Math.Max((double)(Math.Min(rect1.Bottom, rect2.Bottom) - intersectTop), (double)0); 861double minArea = Math.Min(rect1Area, rect2Area); 1065angle = Math.PI / 2.0; 1069angle = Math.PI * 3.0 / 2.0; 1080angle = Math.PI; 1087angle = Math.Atan(dy / dx) + Math.PI; 1091angle = Math.Atan(dy / dx) + (2 * Math.PI); 1095angle = Math.Atan(dy / dx); 1100angle = angle * 180 / Math.PI;
Core\CSharp\MS\Internal\IO\Packaging\DeobfuscatingStream.cs (1)
298int bytesToXor = (int) (Math.Min(ObfuscatedLength, unchecked (readPosition + (long) count)) - readPosition);
Core\CSharp\MS\Internal\IO\Packaging\NetStream.cs (7)
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)); 960_length = (int)(Math.Max(_offset + _length, b._offset + b._length) - _offset); 1017bytesAvailable = (int)Math.Min(block.Length, _highWaterMark - block.Offset); 1081dataAvailable = (int)Math.Min(block.Length, _highWaterMark - block.Offset); 1120dataAvailable = (int)Math.Min(block.Length, _highWaterMark - block.Offset); 1218block.Length = (int)Math.Min(block.Length, _fullStreamLength - block.Offset);
Core\CSharp\MS\Internal\Media\XamlSerializationHelper.cs (1)
451scaledInteger = Math.Floor( scaledValue ) ;
Core\CSharp\MS\Internal\Media3D\GeneralTransform2Dto3Dto2D.cs (19)
515if (!((Math.Max(visEdgeStart.X, visEdgeEnd.X) < Math.Min(uv1.X, uv2.X)) || 516(Math.Min(visEdgeStart.X, visEdgeEnd.X) > Math.Max(uv1.X, uv2.X)) || 517(Math.Max(visEdgeStart.Y, visEdgeEnd.Y) < Math.Min(uv1.Y, uv2.Y)) || 518(Math.Min(visEdgeStart.Y, visEdgeEnd.Y) > Math.Max(uv1.Y, uv2.Y)))) 619if (Math.Abs(visUV1.X - visUV2.X) > Math.Abs(visUV1.Y - visUV2.Y)) 933if (!((Math.Max(visEdgeStart.X, visEdgeEnd.X) < Math.Min(uv1.X, uv2.X)) || 934(Math.Min(visEdgeStart.X, visEdgeEnd.X) > Math.Max(uv1.X, uv2.X)) || 935(Math.Max(visEdgeStart.Y, visEdgeEnd.Y) < Math.Min(uv1.Y, uv2.Y)) || 936(Math.Min(visEdgeStart.Y, visEdgeEnd.Y) > Math.Max(uv1.Y, uv2.Y)))) 1103closestIntersection = ((currClosest - edges[i]._p1Transformed).Length / Math.Sqrt(denom) *
Core\CSharp\MS\Internal\Media3D\LineUtil.cs (4)
288maxvalue = Math.Max(maxvalue,m[i,j]*m[i,j]); 291maxvalue = Math.Sqrt(maxvalue); 340double root = Math.Sqrt(1+tau*tau); 343_c = 1/Math.Sqrt(1+t*t);
Core\CSharp\MS\Internal\Media3D\M3DUtil.cs (2)
379return radians*(180.0/Math.PI); 384return degrees*(Math.PI/180.0);
Core\CSharp\MS\Internal\Shaping\CompositeFontFamily.cs (2)
134return Math.Round(_fontInfo.Baseline * emSize); 166return Math.Round(_fontInfo.LineSpacing * emSize);
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 (9)
1627lengthResolved = Math.Max(startOfNeutrals, startOfDelayed) == PositionInvalid ? 1629((Math.Min(startOfNeutrals, startOfDelayed) == PositionInvalid) ? 1630(Math.Max(startOfNeutrals, startOfDelayed)) : 1631(Math.Min(startOfNeutrals, startOfDelayed))); 1862cchText = Math.Min(cchText, index); 2430sor = Helper.IsOdd(Math.Max(baseLevel, levels[runStart])) ? 2435sor = Helper.IsOdd(Math.Max(lastRunLevel, levels[runStart])) ? 2445eor = Helper.IsOdd(Math.Max(levels[runStart], baseLevel)) ? 2460eor = Helper.IsOdd(Math.Max(levels[runStart], levels[runLimits[runNumber-1] + 1])) ?
Core\CSharp\MS\Internal\TextFormatting\FormatSettings.cs (3)
143_maxLineWidth = Math.Max(maxLineWidth, 0); 180formatWidth = Math.Max(formatWidth, 0); 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\LineServicesCallbacks.cs (14)
492lstTextMetrics.dvAscent = (int)Math.Round(typeface.Baseline(store.Pap.EmSize, Constants.DefaultIdealToReal, store.Settings.TextSource.PixelsPerDip, fullText.TextFormattingMode)); 493lstTextMetrics.dvMultiLineHeight = (int)Math.Round(typeface.LineSpacing(store.Pap.EmSize, Constants.DefaultIdealToReal, store.Settings.TextSource.PixelsPerDip, fullText.TextFormattingMode)); 768ulInfo.dvpFirstUnderlineOffset = (int)Math.Round(lsrun.EmSize * -underlinePositionInEm); 769ulInfo.dvpFirstUnderlineSize = (int)Math.Round(lsrun.EmSize * underlineThicknessInEm); 826stInfo.dvpLowerStrikethroughOffset = (int)Math.Round(lsrun.EmSize * strikeThroughPositionInEm); 827stInfo.dvpLowerStrikethroughSize = (int)Math.Round(lsrun.EmSize * strikeThroughThicknessInEm); 1038int baselineTop = ptOrigin.y + (int)Math.Round(lsrun.EmSize * strikeThroughPositionInEm); 1039int overlineTop = baselineTop - (lsrun.BaselineOffset - (int)Math.Round(lsrun.EmSize * strikeThroughThicknessInEm)); 1362penThickness = Math.Abs(penThickness); 1438drawingPenThickness = drawingPenThickness / Math.Abs(unitValue); 2147int expandedBy = Math.Max(0, interWordAdjustTo - adjustedCharWidth); 2154pplsAdjustRight[0][i] = Math.Max(0, adjustedCharWidth - interWordAdjustTo); 2289pplsCompressionRight[0][igi + i] = Math.Max(0, glyphAdvance - interWordCompressTo); 2431int expandedBy = Math.Max(0, interWordExpandTo - glyphAdvance);
Core\CSharp\MS\Internal\TextFormatting\LineServicesRun.cs (2)
82(shapeable != null ? (int)Math.Round(shapeable.Baseline * realToIdeal) : 0), 83(shapeable != null ? (int)Math.Round(shapeable.Height * realToIdeal) : 0),
Core\CSharp\MS\Internal\TextFormatting\SimpleTextLine.cs (10)
302realHeight = Math.Max(realHeight, run.Height); 303realAscent = Math.Max(realAscent, run.Baseline); 304realDescent = Math.Max(realDescent, run.Height - run.Baseline); 339_height = formatter.IdealToReal((int)Math.Round(pap.DefaultTypeface.LineSpacing(pap.EmSize, Constants.DefaultIdealToReal, PixelsPerDip, _settings.TextFormattingMode)), PixelsPerDip); 340_baselineOffset = formatter.IdealToReal((int)Math.Round(pap.DefaultTypeface.Baseline(pap.EmSize, Constants.DefaultIdealToReal, PixelsPerDip, _settings.TextFormattingMode)), PixelsPerDip); 374_idealOffsetUnRounded = (int)Math.Round((paragraphWidth - idealWidthAtTrailing) * 0.5); 863int first = Math.Max(ich, dcp) + _cpFirst; 864int afterLast = Math.Min(ich + run.Length, dcp + textLength) + _cpFirst; 1235cpVisible = Math.Max(cpRunStart, cp); 1267cpVisible = Math.Min(cpRunEnd, cp);
Core\CSharp\MS\Internal\TextFormatting\TextFormatterImp.cs (6)
702return Math.Round(value * pixelsPerDip, midpointRounding) / pixelsPerDip; 745value = Math.Max(value, Constants.DefaultIdealToReal); 756int value = (int)Math.Round(i * ToIdeal); 760value = Math.Max(value, 1); 777int value = (int)Math.Floor(i * ToIdeal); 781value = Math.Max(value, 1);
Core\CSharp\MS\Internal\TextFormatting\TextMarkerSource.cs (1)
187Math.Min(_characterArray.Length, textSourceCharacterIndexLimit)
Core\CSharp\MS\Internal\TextFormatting\TextMetrics.cs (5)
191int lscpFirstIndependence = Math.Max( 211_baselineOffset = (int)Math.Round( 222_textAscent = (int)Math.Round(pap.DefaultTypeface.Baseline(pap.EmSize, Constants.DefaultIdealToReal, _pixelsPerDip, fullText.TextFormattingMode)); 223_textHeight = (int)Math.Round(pap.DefaultTypeface.LineSpacing(pap.EmSize, Constants.DefaultIdealToReal, _pixelsPerDip, fullText.TextFormattingMode)); 274_paragraphToText = (int)Math.Round((paragraphWidth + _textStart - _textWidthAtTrailing) * 0.5);
Core\CSharp\MS\Internal\TextFormatting\TextProperties.cs (1)
396return (int)Math.Round(properties.FontRenderingEmSize * 0.75 * _textRunLength * realToIdeal);
Core\CSharp\MS\Internal\TextFormatting\TextRunCacheImp.cs (3)
212looseCharLength = (int)Math.Round(TextStore.TypicalCharactersPerLine * 0.25); 235int lookAheadLimit = Math.Min(runLength, looseCharLength + TextStore.TypicalCharactersPerLine); 261looseCharLength = Math.Min(runLength, endOffset);
Core\CSharp\MS\Internal\TextFormatting\TextShapeableCharacters.cs (2)
366advanceWidthsUnshaped[i] = (int)Math.Round(TextFormatterImp.RoundDipForDisplayMode(glyphMetrics[i].AdvanceWidth * designToEm, pixelsPerDip) * scalingFactor); 378advanceWidthsUnshaped[i] = (int)Math.Round(glyphMetrics[i].AdvanceWidth * designToEm);
Core\CSharp\MS\Internal\TextFormatting\TextStore.cs (16)
530int effectedRangeStart = Math.Max(cpFetched - offset, bounds[0].Position); 531int effectedRangeEnd = Math.Min(cpFetched - offset + runInfo.Length, bounds[bounds.Length - 1].Position); 541int currentRangeEnd = Math.Min(bounds[i].Position, effectedRangeEnd); 575currentPosition = Math.Max(currentPosition, bounds[i + 1].Position); 1148int runLength = Math.Min(span.length, cchToAdd - ichRun); 1236int first = limit - Math.Min(charRange.Length, limitCp - firstCp); 1319int spanLength = Math.Min(runInfoSpanRider.Length, textEffectsSpanRider.Length); 1320int ichEnd = Math.Min(ichRun + spanLength, cchUniform); 1590(int)Math.Round(realToIdeal * runInfo.TextRun.Properties.FontRenderingEmSize), 1742(int)Math.Round(realToIdeal * runInfo.TextRun.Properties.FontRenderingEmSize), 1981textTop = Math.Max(textTop, lsrun.BaselineOffset); 1982textBottom = Math.Max(textBottom, lsrun.Descent); 2002textBottom = Math.Max(textBottom, lsrun.Height + top); 2006textBottom = Math.Max(textBottom, lsrun.Height + textTop); 2070cellAscent = Math.Max(cellAscent, lsrun.BaselineOffset - move); 2071cellDescent = Math.Max(cellDescent, lsrun.Descent + move);
Core\CSharp\MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (1)
300thousandthOfEm = (short) Math.Round(scaled);
Core\CSharp\System\Windows\DataObject.cs (1)
2705_current = _current + (int)Math.Min(celt, Int32.MaxValue - _current);
Core\CSharp\System\Windows\Ink\IncrementalHitTester.cs (4)
848weight += Math.Sqrt(da.Width*da.Width + da.Height*da.Height) / 2.0f; 853weight += Math.Sqrt(spine.LengthSquared) / 2.0f; 858weight += Math.Sqrt(da.Width*da.Width + da.Height*da.Height) / 2.0f; 863weight += Math.Sqrt(spine.LengthSquared) / 2.0f;
Core\CSharp\System\Windows\Ink\Stroke.cs (8)
253double min = Math.Min(shapeBoundingBox.Width, shapeBoundingBox.Height); 254tolerance = Math.Log10(min + min); 378return Math.Sqrt(spine.LengthSquared); 780Math.Ceiling(cutAt[cutAt.Length - 1].EndFIndex) > sourceStylusPoints.Count - 1)); 836Math.Ceiling(cutAt[cutAt.Length - 1].EndFIndex) > sourceStylusPoints.Count - 1)); 888? 0 : (int)Math.Floor(beginFIndex); 892? (sourceStylusPoints.Count - 1) : (int)Math.Ceiling(endFIndex); 947double ceiling = Math.Ceiling(endFIndex);
Core\CSharp\System\Windows\Ink\Stroke2.cs (4)
431selectedDA.Height = Math.Max(selectedDA.Height, DrawingAttributes.DefaultHeight); 432selectedDA.Width = Math.Max(selectedDA.Width, DrawingAttributes.DefaultWidth); 736double newWidth = Math.Sqrt(w.X * w.X + w.Y * w.Y); 737double newHeight = Math.Sqrt(h.X * h.X + h.Y * h.Y);
Core\CSharp\System\Windows\Input\AngleUtil.cs (2)
12return degrees * Math.PI / 180.0; 20return radians * 180.0 / Math.PI;
Core\CSharp\System\Windows\Input\ManipulationLogic.cs (1)
550Radius = (float)Math.Max(1.0, pivot.Radius)
Core\CSharp\System\Windows\Input\MouseDevice.cs (2)
2274return (Math.Abs(newPosition.X - _lastClick.X) < doubleClickDeltaX) && 2275(Math.Abs(newPosition.Y - _lastClick.Y) < doubleClickDeltaY);
Core\CSharp\System\Windows\Interop\HwndSource.cs (2)
1074size = new Point(Math.Ceiling(size.X), Math.Ceiling(size.Y));
Core\CSharp\System\Windows\Interop\HwndTarget.cs (4)
857(float)(Math.Ceiling((double)(_hwndClientRectInScreenCoords.right - _hwndClientRectInScreenCoords.left))), 858(float)(Math.Ceiling((double)(_hwndClientRectInScreenCoords.bottom - _hwndClientRectInScreenCoords.top)))); 1750(float)(Math.Ceiling((double)(_hwndClientRectInScreenCoords.right - _hwndClientRectInScreenCoords.left))), 1751(float)(Math.Ceiling((double)(_hwndClientRectInScreenCoords.bottom - _hwndClientRectInScreenCoords.top))));
Core\CSharp\System\Windows\Markup\XmlLanguage.cs (1)
439specificity = Math.Max(GetSubtagCount(languageTag), 1 + GetSpecificity(culture.Parent, maxDepth - 1));
Core\CSharp\System\Windows\Media\Animation\BackEase.cs (4)
46double amp = Math.Max(0.0, Amplitude); 47return Math.Pow(normalizedTime, 3.0) - normalizedTime * amp * Math.Sin(Math.PI * normalizedTime);
Core\CSharp\System\Windows\Media\Animation\BounceEase.cs (7)
83double bounces = Math.Max(0.0, (double)Bounces); 93double pow = Math.Pow(bounciness, bounces); 106double bounceAtT = Math.Log(-unitAtT * (1.0-bounciness) + 1.0, bounciness); 107double start = Math.Floor(bounceAtT); 112double startTime = (1.0 - Math.Pow(bounciness, start)) / (oneMinusBounciness * sumOfUnits); 113double endTime = (1.0 - Math.Pow(bounciness, end)) / (oneMinusBounciness * sumOfUnits); 119double amplitude = Math.Pow(1.0 / bounciness, (bounces - start));
Core\CSharp\System\Windows\Media\Animation\CircleEase.cs (3)
16normalizedTime = Math.Max(0.0, Math.Min(1.0, normalizedTime)); 17return 1.0 - Math.Sqrt(1.0 - normalizedTime * normalizedTime);
Core\CSharp\System\Windows\Media\Animation\Clock.cs (3)
2163timeUntilNextBoundary = DivideTimeSpan(_currentDuration.TimeSpan, Math.Abs(parentSpeed)); 4190long error = (long)Math.Max(_appliedSpeedRatio, 1.0); 4199Debug.Assert(Math.Abs(optimizedInputTime - inputTime) <= error,
Core\CSharp\System\Windows\Media\Animation\ClockGroup.cs (1)
207desiredFrameRate = Math.Max(desiredFrameRate, currentDesiredFrameRate.Value);
Core\CSharp\System\Windows\Media\Animation\DoubleAnimationUsingPath.cs (2)
306double angle = Math.Acos(x) * (180.0 / Math.PI);
Core\CSharp\System\Windows\Media\Animation\ElasticEase.cs (7)
73double oscillations = Math.Max(0.0, (double)Oscillations); 74double springiness = Math.Max(0.0, Springiness); 82expo = (Math.Exp(springiness * normalizedTime) - 1.0) / (Math.Exp(springiness) - 1.0); 85return expo * (Math.Sin((Math.PI * 2.0 * oscillations + Math.PI * 0.5) * normalizedTime));
Core\CSharp\System\Windows\Media\Animation\ExponentialEase.cs (2)
55return (Math.Exp(factor * normalizedTime) - 1.0) / (Math.Exp(factor) - 1.0);
Core\CSharp\System\Windows\Media\Animation\KeySpline.cs (2)
364absdx = Math.Abs(dx); 379if (Math.Abs(x - time) < accuracy * absdx)
Core\CSharp\System\Windows\Media\Animation\PowerEase.cs (2)
48double power = Math.Max(0.0, Power); 49return Math.Pow(normalizedTime, power);
Core\CSharp\System\Windows\Media\Animation\SineEase.cs (2)
16return 1.0 - Math.Sin(Math.PI * 0.5 * (1 - normalizedTime));
Core\CSharp\System\Windows\Media\ArcSegment.cs (1)
111count = Math.Min(count, 4);
Core\CSharp\System\Windows\Media\ByteStreamGeometryContext.cs (2)
556int cbDataForThisChunk = Math.Min(cbDataSize, 592int newChunkSize = Math.Min(2*_chunkList[_chunkList.Count-1].Length, c_maxChunkSize);
Core\CSharp\System\Windows\Media\Color.cs (2)
1063return (float)Math.Pow(((double)val + 0.055) / 1.055, 2.4); 1087return ((byte)((255.0f * ((1.055f * (float)Math.Pow((double)val, (1.0 / 2.4))) - 0.055f)) + 0.5f));
Core\CSharp\System\Windows\Media\Effects\DropShadowEffect.cs (3)
49double direction = Math.PI/180 * Direction; 50double offsetX = depth * Math.Cos(direction); 51double offsetY = depth * Math.Sin(direction);
Core\CSharp\System\Windows\Media\EllipseGeometry.cs (14)
106currentCenter.X - Math.Abs(currentRadiusX), 107currentCenter.Y - Math.Abs(currentRadiusY), 1082.0 * Math.Abs(currentRadiusX), 1092.0 * Math.Abs(currentRadiusY)); 181strokeThickness = Math.Abs(pen.Thickness); 185center.X - Math.Abs(radiusX)-0.5*strokeThickness, 186center.Y - Math.Abs(radiusY)-0.5*strokeThickness, 1872.0 * Math.Abs(radiusX)+strokeThickness, 1882.0 * Math.Abs(radiusY)+strokeThickness); 271double area = Math.Abs(RadiusX * RadiusY) * Math.PI; 277area *= Math.Abs(transform.Value.Determinant); 390radiusX = Math.Abs(radiusX); 391radiusY = Math.Abs(radiusY);
Core\CSharp\System\Windows\Media\FamilyTypeface.cs (1)
323pAdvances[i] = Math.Max(0, (int)((metrics.BlackBoxWidth + metrics.LeftSideBearing + metrics.RightSideBearing) * emSize));
Core\CSharp\System\Windows\Media\FormattedText.cs (21)
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) 1667int x0 = Math.Max(enumerator.Position, startIndex); 1668int x1 = Math.Min(enumerator.Position + enumerator.Length, startIndex + count); 1819accBlackBoxLeft = Math.Min(accBlackBoxLeft, blackBoxLeft); 1820accBlackBoxRight = Math.Max(accBlackBoxRight, blackBoxRight); 1821accBlackBoxBottom = Math.Max(accBlackBoxBottom, blackBoxBottom); 1822accBlackBoxTop = Math.Min(accBlackBoxTop, blackBoxTop); 1828metrics.Width = Math.Max(metrics.Width, currentLine.Width); 1829metrics.WidthIncludingTrailingWhitespace = Math.Max(metrics.WidthIncludingTrailingWhitespace, currentLine.WidthIncludingTrailingWhitespace); 1830lineStartOfLongestLine = Math.Min(lineStartOfLongestLine, currentLine.Start);
Core\CSharp\System\Windows\Media\GlyphRun.cs (4)
1431double inflation = Math.Min(_renderingEmSize / 7.0, 1.0); 1473return Math.Max(advance, oneSideBearing + otherSideBearing + 1); 1780_baseVectorX = Math.Sqrt(m11 * m11 + m12 * m12); 1786_baseVectorY = _baseVectorX == 0 ? 0 : Math.Abs(m11 * m22 - m12 * m21) / _baseVectorX;
Core\CSharp\System\Windows\Media\GlyphsSerializer.cs (6)
75Math.Max( 190int normalizedAdvance = (int)Math.Round(_advances[glyph] * _milToEm); 192if (normalizedAdvance != (int)Math.Round(fontAdvance * EmScaleFactor)) 203int offset = (int)Math.Round(_offsets[glyph].X * _milToEm); 211offset = (int)Math.Round(_offsets[glyph].Y * _milToEm); 277lastCaretStop = Math.Min(i | 3, _caretStops.Count - 1);
Core\CSharp\System\Windows\Media\GlyphTypeface.cs (3)
1701advanceWidthsUnshaped[i] = (int)Math.Round(TextFormatterImp.RoundDipForDisplayMode(glyphMetrics[i].AdvanceWidth * designToEm, pixelsPerDip) * scalingFactor); 1709advanceWidthsUnshaped[i] = (int)Math.Round(glyphMetrics[i].AdvanceWidth * designToEm); 1717int missingGlyphWidth = (int)Math.Round(TextFormatterImp.RoundDip(emSize * GetAdvanceWidth(0, pixelsPerDip, textFormattingMode, isSideways), pixelsPerDip, textFormattingMode) * scalingFactor);
Core\CSharp\System\Windows\Media\Imaging\BitmapDownload.cs (1)
428int percentComplete = (int)Math.Floor(100.0 * (double)entry.outputStream.Length / (double)entry.contentLength);
Core\CSharp\System\Windows\Media\Imaging\BitmapPalette.cs (1)
321int numColors = Math.Min(256, _colors.Count);
Core\CSharp\System\Windows\Media\Imaging\BitmapSource.cs (2)
521return new Size(Math.Max(0, GetWidthInternal()), 522Math.Max(0, GetHeightInternal()));
Core\CSharp\System\Windows\Media\Imaging\TransformedBitmap.cs (6)
147scaleX = Math.Abs(m.M11); 148scaleY = Math.Abs(m.M22); 166scaleX = Math.Abs(m.M12); 167scaleY = Math.Abs(m.M21); 210uint width = Math.Max(1, (uint)(scaleX * _source.PixelWidth + 0.5)); 211uint height = Math.Max(1, (uint)(scaleY * _source.PixelHeight + 0.5));
Core\CSharp\System\Windows\Media\LinearGradientBrush.cs (3)
233angle = angle * (1.0/180.0) * System.Math.PI; 235return (new Point(System.Math.Cos(angle), System.Math.Sin(angle)));
Core\CSharp\System\Windows\Media\MatrixStack.cs (4)
88_highWaterMark = Math.Max(_highWaterMark, _size); 126_highWaterMark = Math.Max(_highWaterMark, _size); 156_highWaterMark = Math.Max(_highWaterMark, _size); 199int newSize = Math.Max(_highWaterMark, s_initialSize);
Core\CSharp\System\Windows\Media\MediaContext.cs (4)
122int sqrt = (int) Math.Sqrt(number); 610nextTickNeeded = TimeSpan.FromTicks(Math.Max(nextTickNeeded.Ticks, minimumDelay.Ticks)); 789_animationRenderRate = Math.Max(_adjustedRefreshRate, _timeManager.GetMaxDesiredFrameRate()); 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\RectangleGeometry.cs (9)
215strokeThickness = Math.Abs(pen.Thickness); 314double area = Math.Abs(rect.Width * rect.Height); 317area -= Math.Abs(radiusX * radiusY) * (4.0 - Math.PI); 323area *= Math.Abs(transform.Value.Determinant); 502radiusX = Math.Min(rect.Width * (1.0 / 2.0), Math.Abs(radiusX)); 503radiusY = Math.Min(rect.Height * (1.0 / 2.0), Math.Abs(radiusY));
Core\CSharp\System\Windows\Media\RenderData.cs (1)
491int newSize = Math.Max((_buffer.Length << 1) - (_buffer.Length >> 1), cbRequiredSize);
Core\CSharp\System\Windows\Media\TextFormatting\CharacterBufferReference.cs (1)
103int maxOffset = (charBuffer == null) ? 0 : Math.Max(0, charBuffer.Count - 1);
Core\CSharp\System\Windows\Media\Typeface.cs (2)
658nominalWidths[i] = (int)Math.Round(TextFormatterImp.RoundDipForDisplayMode(glyphMetrics[i].AdvanceWidth * designToEm, pixelsPerDip) * toIdeal); 667nominalWidths[i] = (int)Math.Round(glyphMetrics[i].AdvanceWidth * designToEm);
Core\CSharp\System\Windows\Media\VisualCollection.cs (1)
265InternalCapacity = Math.Max(min, (int)(InternalCapacity * c_growFactor));
Core\CSharp\System\Windows\Media\VisualProxy.cs (1)
581Array.Copy(_tail, reallocatedTail, Math.Min(_tail.Length, newLength));
Core\CSharp\System\Windows\Media3D\AxisAngleRotation3D.cs (4)
123Math.E, Math.PI, Math.E * Math.PI, 55.0
Core\CSharp\System\Windows\Media3D\OrthographicCamera.cs (1)
232return x + 0.1*Math.Abs(x) + 1.0;
Core\CSharp\System\Windows\Media3D\PerspectiveCamera.cs (2)
85double halfWidthDepthRatio = Math.Tan(fov/2); 133double halfWidthDepthRatio = Math.Tan(fov/2);
Core\CSharp\System\Windows\Media3D\Quaternion.cs (34)
94double angleInRadians = angleInDegrees * (Math.PI / 180.0); 98Vector3D v = (axisOfRotation / length) * Math.Sin(0.5 * angleInRadians); 102_w = Math.Cos(0.5 * angleInRadians); 166double msin = Math.Sqrt(_x*_x + _y*_y + _z*_z); 175double maxcoeff = Math.Max(Math.Abs(_x),Math.Max(Math.Abs(_y),Math.Abs(_z))); 179msin = Math.Sqrt(x*x + y*y + z*z); 185return Math.Atan2(msin,mcos) * (360.0 / Math.PI); 265double rmax = 1.0/Max(Math.Abs(_x), 266Math.Abs(_y), 267Math.Abs(_z), 268Math.Abs(_w)); 276double normInverse = 1.0 / Math.Sqrt(norm2); 451double max = Math.Max(Math.Max(Math.Abs(_x),Math.Abs(_y)), 452Math.Max(Math.Abs(_z),Math.Abs(_w))); 459double smallLength = Math.Sqrt(x*x+y*y+z*z+w*w); 463return Math.Sqrt(norm2); 567double theta = t * Math.PI; 569scaleFrom = Math.Cos(theta); 570scaleTo = Math.Sin(theta); 575double omega = Math.Acos(cosOmega); 576double sinOmega = Math.Sqrt(1.0 - cosOmega*cosOmega); 577scaleFrom = Math.Sin((1.0 - t) * omega) / sinOmega; 578scaleTo = Math.Sin(t * omega) / sinOmega; 586double lengthOut = lengthFrom * Math.Pow(lengthTo/lengthFrom, t);
Core\CSharp\System\Windows\Media3D\Ray3DHitTestResult.cs (1)
102return Math.Sign(x.DistanceToRayOrigin - y.DistanceToRayOrigin);
Core\CSharp\System\Windows\Media3D\Rect3D.cs (18)
101_x = Math.Min(point1._x, point2._x); 102_y = Math.Min(point1._y, point2._y); 103_z = Math.Min(point1._z, point2._z); 104_sizeX = Math.Max(point1._x, point2._x) - _x; 105_sizeY = Math.Max(point1._y, point2._y) - _y; 106_sizeZ = Math.Max(point1._z, point2._z) - _z; 443double x = Math.Max(_x, rect._x); 444double y = Math.Max(_y, rect._y); 445double z = Math.Max(_z, rect._z); 446_sizeX = Math.Min(_x + _sizeX, rect._x + rect._sizeX) - x; 447_sizeY = Math.Min(_y + _sizeY, rect._y + rect._sizeY) - y; 448_sizeZ = Math.Min(_z + _sizeZ, rect._z + rect._sizeZ) - z; 481double x = Math.Min(_x, rect._x); 482double y = Math.Min(_y, rect._y); 483double z = Math.Min(_z, rect._z); 484_sizeX = Math.Max(_x + _sizeX, rect._x + rect._sizeX) - x; 485_sizeY = Math.Max(_y + _sizeY, rect._y + rect._sizeY) - y; 486_sizeZ = Math.Max(_z + _sizeZ, rect._z + rect._sizeZ) - z;
Core\CSharp\System\Windows\Media3D\Vector3D.cs (11)
69return Math.Sqrt(_x * _x + _y * _y + _z * _z); 94double m = Math.Abs(_x); 95double absy = Math.Abs(_y); 96double absz = Math.Abs(_z); 110double length = Math.Sqrt(_x * _x + _y * _y + _z * _z); 177theta = Math.PI - 2.0 * Math.Asin((-vector1 - vector2).Length / 2.0); 181theta = 2.0 * Math.Asin((vector1 - vector2).Length / 2.0); 473return new Size3D(Math.Abs(vector._x), Math.Abs(vector._y), Math.Abs(vector._z));
Core\CSharp\System\Windows\UIElement.cs (2)
1103newValue = Math.Round(value * dpiScale) / dpiScale; 1114newValue = Math.Round(value);
Shared\MS\Internal\FloatUtil.cs (6)
34float eps = ((float)Math.Abs(a) + (float)Math.Abs(b) + 10.0f) * FLT_EPSILON; 44return (float)Math.Abs(a-1.0f) < 10.0f * FLT_EPSILON; 52return (float)Math.Abs(a) < 10.0f * FLT_EPSILON; 61return Math.Abs(denominator) <= Math.Abs(numerator) * INVERSE_FLT_MAX_PRECISION;
Shared\MS\Internal\Ink\BitStream.cs (1)
288int rightShiftNextByteBy = Math.Abs((countOfBits - _cbitsInPartialByte) - Native.BitsPerByte);
PresentationFramework (1108)
src\Framework\Microsoft\Win32\CommonDialog.cs (2)
367(int)Math.Round(x), 368(int)Math.Round(y), // new X and Y positions
src\Framework\MS\Internal\AnimatedTypeHelpers.cs (6)
81return Math.Abs(to - from); 87Math.Pow(GetSegmentLengthDouble(from.Left, to.Left), 2.0) 88+ Math.Pow(GetSegmentLengthDouble(from.Top, to.Top), 2.0) 89+ Math.Pow(GetSegmentLengthDouble(from.Right, to.Right), 2.0) 90+ Math.Pow(GetSegmentLengthDouble(from.Bottom, to.Bottom), 2.0); 92return Math.Sqrt(totalLength);
src\Framework\MS\Internal\Annotations\Component\MArkedHighlightComponent.cs (1)
876sign = Math.Sign(next.Left - current.Left);
src\Framework\MS\Internal\AppModel\IconHelper.cs (1)
381return (((int)Math.Ceiling(original) + (nBitsCount - 1)) / nBitsCount) * nBitsCount;
src\Framework\MS\Internal\AppModel\RootBrowserWindow.cs (2)
480uint heightDeviceUnits = (uint)Math.Round(sizeDeviceUnits.Y); 506uint widthDeviceUnits = (uint)Math.Round(sizeDeviceUnits.X);
src\Framework\MS\Internal\Controls\InkCanvasInnerCanvas.cs (4)
105newSize.Width = Math.Max(newSize.Width, left + child.DesiredSize.Width); 109newSize.Width = Math.Max(newSize.Width, child.DesiredSize.Width); 115newSize.Height = Math.Max(newSize.Height, top + child.DesiredSize.Height); 119newSize.Height = Math.Max(newSize.Height, child.DesiredSize.Height);
src\Framework\MS\Internal\Controls\StickyNote\StickyNoteAnnotations.cs (6)
1073if (DoubleUtil.GreaterThan(Math.Abs(offsetX), Math.Abs(_offsetX))) 1079offset = Math.Max(offset, -(rectStickyNote.Left - rectPage.Left)); 1085if (DoubleUtil.GreaterThan(Math.Abs(offsetY), Math.Abs(_offsetY))) 1090offset = Math.Max(offset, -(rectStickyNote.Top - rectPage.Top));
src\Framework\MS\Internal\Data\RBTree.cs (1)
401int n = Math.Min(mid-left, right-mid);
src\Framework\MS\Internal\Documents\ContentElementCollection.cs (1)
689PrivateCapacity = Math.Max(min, PrivateCapacity * 2);
src\Framework\MS\Internal\Documents\DocumentGrid.cs (18)
330if (Math.Abs(pageNumber - _firstVisiblePageNumber) > 1) 603double clippedHorizontalOffset = Math.Min(_horizontalOffset, ExtentWidth - ViewportWidth); 604clippedHorizontalOffset = Math.Max(clippedHorizontalOffset, 0.0); 646double clippedVerticalOffset = Math.Min(_verticalOffset, ExtentHeight - ViewportHeight); 647clippedVerticalOffset = Math.Max(clippedVerticalOffset, 0.0); 1248pageOffset = new Point(Math.Max(ViewportWidth, ExtentWidth) - (xOffset + pageSize.Width), yOffset); 1481visiblePages.Add(_childrenCollection[_firstPageVisualIndex + j - Math.Max(0, firstPage)]); 1636double centerWidth = Math.Max(ViewportWidth, ExtentWidth); 2269(int)Math.Floor( ViewportWidth / 2274maxColumns = Math.Min(maxColumns, _pageCache.PageCount); 2275maxColumns = Math.Min(maxColumns, DocumentViewerConstants.MaximumMaxPagesAcross); 2286int rows = (int)Math.Floor((double)(_pageCache.PageCount / columns)); 2298double aspectDiff = Math.Abs(layoutAspect - viewportAspect); 2412newScale = Math.Max(newScale, CurrentMinimumScale); 2413newScale = Math.Min(newScale, DocumentViewerConstants.MaximumScale); 2482scaleFactor = Math.Min(compensatedViewportWidth / rowWidth, compensatedViewportHeight / rowHeight); 2511scaleFactor = Math.Min(compensatedViewportWidth / rowWidth, 2749Math.Max(0.0, (ExtentWidth - row.RowSize.Width) / 2.0) : 0.0;
src\Framework\MS\Internal\Documents\DocumentGridPage.cs (1)
302new Size(_dropShadowWidth, Math.Max( 0.0, arrangeSize.Height - _dropShadowWidth))
src\Framework\MS\Internal\Documents\DocumentPageTextView.cs (2)
657while (Math.Abs(pagesMoved) < Math.Abs(count))
src\Framework\MS\Internal\Documents\FlowDocumentView.cs (8)
89desiredSize.Width = Math.Min(constraint.Width, _formatter.DocumentPage.Size.Width); 90desiredSize.Height = Math.Min(constraint.Height, _formatter.DocumentPage.Size.Height); 139if (Math.Abs(_scrollData.ExtentWidth - _scrollData.ViewportWidth) < 1) 143if (Math.Abs(_scrollData.ExtentHeight - _scrollData.ViewportHeight) < 1) 149Math.Max(0, Math.Min(_scrollData.ExtentWidth - _scrollData.ViewportWidth, _scrollData.HorizontalOffset)), 150Math.Max(0, Math.Min(_scrollData.ExtentHeight - _scrollData.ViewportHeight, _scrollData.VerticalOffset)));
src\Framework\MS\Internal\Documents\IFlowDocumentViewer.cs (2)
835GoToPage(Math.Max(1, MasterPageNumber - 2)); 843GoToPage(Math.Min(PageCount, MasterPageNumber + 2));
src\Framework\MS\Internal\Documents\MultiPageTextView.cs (17)
767Invariant.Assert(Math.Abs(request.NewCount) >= Math.Abs(linesMoved)); 839Invariant.Assert(Math.Abs(request.NewCount) >= Math.Abs(pagesMoved)); 987Invariant.Assert(Math.Abs(pagesMoved) <= Math.Abs(count)); 1105horz = Math.Min(Math.Abs(point.X - textViewBounds.Left), Math.Abs(point.X - textViewBounds.Right)); 1113vert = Math.Min(Math.Abs(point.Y - textViewBounds.Top), Math.Abs(point.Y - textViewBounds.Bottom)); 1115textViewProximities[i] = Math.Sqrt(Math.Pow(horz, 2) + Math.Pow(vert, 2)); 1200int closestDistance = Math.Abs(count); 1225int distance = Math.Abs(currentPageNumber - pageNumber);
src\Framework\MS\Internal\Documents\RowCache.cs (13)
332double roundedOffset = Math.Round(offset, _findOffsetPrecision); 340double rowOffset = Math.Round(_rowCache[i].VerticalOffset, _findOffsetPrecision); 341double rowHeight = Math.Round(_rowCache[i].RowSize.Height, _findOffsetPrecision); 435startOffset = Math.Round(startOffset, _findOffsetPrecision); 436endOffset = Math.Round(endOffset, _findOffsetPrecision); 442double rowOffset = Math.Round(_rowCache[i].VerticalOffset, _findOffsetPrecision); 494_extentWidth = Math.Max(currentRow.RowSize.Width, _extentWidth); 566_layoutColumns = Math.Min(_layoutColumns, PageCache.PageCount); 567_layoutColumns = Math.Max(1, _layoutColumns); 687pivotPage = Math.Max(0, PageCache.PageCount - columns); 1026_extentWidth = Math.Max(newRow.RowSize.Width, _extentWidth); 1154_extentWidth = Math.Max(row.RowSize.Width, _extentWidth); 1423_rowSize.Height = Math.Max(pageSize.Height, _rowSize.Height);
src\Framework\MS\Internal\Documents\ScrollData.cs (4)
138offset = Math.Max(0, Math.Min(_extent.Width - _viewport.Width, offset)); 160offset = Math.Max(0, Math.Min(_extent.Height - _viewport.Height, offset));
src\Framework\MS\Internal\Documents\TextBoxLine.cs (1)
126int runLength = Math.Min(128, position.GetTextRunLength(LogicalDirection.Backward));
src\Framework\MS\Internal\Documents\TextBoxView.cs (32)
504desiredSize.Width = Math.Min(constraint.Width, desiredSize.Width); 505desiredSize.Height = Math.Min(constraint.Height, desiredSize.Height); 701int startOffset = Math.Min(_lineMetrics[_lineMetrics.Count-1].EndOffset, startPosition.Offset); 702int endOffset = Math.Min(_lineMetrics[_lineMetrics.Count - 1].EndOffset, endPosition.Offset); 709firstLineIndex = Math.Max(firstLineIndex, GetLineIndexFromOffset(startOffset, LogicalDirection.Forward)); 710lastLineIndex = Math.Min(lastLineIndex, GetLineIndexFromOffset(endOffset, LogicalDirection.Backward)); 779int nextLineIndex = Math.Max(0, Math.Min(_lineMetrics.Count - 1, lineIndex + count)); 1789Math.Max(0, Math.Min(_scrollData.ExtentWidth - _scrollData.ViewportWidth, _scrollData.HorizontalOffset)), 1790Math.Max(0, Math.Min(_scrollData.ExtentHeight - _scrollData.ViewportHeight, _scrollData.VerticalOffset))); 1936int endOffset = Math.Min(range.StartIndex + range.PositionsAdded, _host.TextContainer.SymbolCount); 2045int startOffset = Math.Max(_lineMetrics[lineIndex].Offset, unclippedStartOffset); 2046int endOffset = Math.Min(_lineMetrics[lineIndex].EndOffset, unclippedEndOffset); 2141int startOffset = Math.Max(lineStartOffset, unclippedStartOffset); 2142int endOffset = Math.Min(lineEndOffset, unclippedEndOffset); 2201lastLineIndex = (int)Math.Ceiling((viewport.Y + viewport.Height) / _lineHeight) - 1; 2204firstLineIndex = Math.Max(0, Math.Min(firstLineIndex, _lineMetrics.Count - 1)); 2205lastLineIndex = Math.Max(0, Math.Min(lastLineIndex, _lineMetrics.Count - 1)); 2277desiredSize.Width = Math.Max(desiredSize.Width, line.Width); 2551int lastCoveredCharOffset = range.StartIndex + Math.Max(range.PositionsAdded, range.PositionsRemoved); 2647desiredSize.Width = Math.Max(desiredSize.Width, _lineMetrics[i].Width); 2710int lineIndex = Math.Max(oldLineVisualsIndex, firstLineIndex); 2711int lineCount = Math.Min(oldLastLineIndex, firstLineIndex + count - 1) - lineIndex + 1; 2805count = Math.Max(0, count); 2811count = Math.Min(count, _viewportLineVisuals.Count - start); 2970int rangeStart = Math.Max(viewportStart, selectionStart); 2971int rangeSize = Math.Min(viewportEnd, selectionEnd) - rangeStart; 3107padding = Math.Max(0, viewport.Height - _contentSize.Height);
src\Framework\MS\Internal\Documents\TextContainerHelper.cs (6)
207_cpFirst = Math.Min(_cpFirst, cpFirst); 208_cpLast = Math.Max(_cpLast, cpLast); 232_ranges[i * 2] = Math.Min(_ranges[i * 2], cpFirst); 233_ranges[i * 2 + 1] = Math.Max(_ranges[i * 2 + 1], cpLast); 255_ranges[pos * 2 + 1] = Math.Max(_ranges[pos * 2 + 1], _ranges[(pos + 1) * 2 + 1]); 480int depth = Math.Min(ancestorsStart.Count, ancestorsEnd.Count);
src\Framework\MS\Internal\Documents\TextDocumentView.cs (2)
2115double distance = Math.Abs(point.X - midPoint.X) + Math.Abs(point.Y - midPoint.Y);
src\Framework\MS\Internal\Documents\TextParagraphView.cs (6)
186lineIndex = Math.Max(0, lineIndex + count); 187lineIndex = Math.Min(lines.Count - 1, lineIndex); 603lineIndex = Math.Max(Math.Min((int)(point.Y / approximatedLineHeight), lines.Count - 1), 0); 749siblingGap = Math.Max(lineBox.X - (siblingLineBox.X + siblingLineBox.Width), 0); 778siblingGap = Math.Max(siblingLineBox.X - (lineBox.X + lineBox.Width), 0);
src\Framework\MS\Internal\Globalization\LocalizableResourceBuilder.cs (2)
580Readability readability = (Readability) Math.Min( 586Modifiability modifiability = (Modifiability) Math.Min(
src\Framework\MS\Internal\Helper.cs (7)
1097headerSize.Height = Math.Max(itemsCorrectionFactor.Top, headerSize.Height); 1101headerSize.Height = Math.Max(virtualizingElement.DesiredSize.Height, headerSize.Height); 1103headerSize.Width = Math.Max(virtualizingElement.DesiredSize.Width, headerSize.Width); 1134itemPixelSize.Width = Math.Max(desiredSize.Width, itemPixelSize.Width); 1147itemPixelSizeBeforeViewport.Width = Math.Max(desiredSize.Width, itemPixelSizeBeforeViewport.Width); 1159itemPixelSizeInViewport.Width = Math.Max(desiredSize.Width, itemPixelSizeInViewport.Width); 1170itemPixelSizeAfterViewport.Width = Math.Max(desiredSize.Width, itemPixelSizeAfterViewport.Width);
src\Framework\MS\Internal\Ink\LassoHelper.cs (6)
116double step = Math.Sqrt(MinDistanceSquared / distanceSquared); 241&& DoubleUtil.GreaterThanOrClose(point.X, Math.Min(prevLassoPoint.X, lassoPoint.X)) 242&& DoubleUtil.LessThanOrClose(point.X, Math.Max(prevLassoPoint.X, lassoPoint.X))) 251if (DoubleUtil.GreaterThanOrClose(point.X, Math.Max(prevLassoPoint.X, lassoPoint.X))) 257if ((0 == i) && DoubleUtil.AreClose(point.X, Math.Max(prevLassoPoint.X, lassoPoint.X))) 262else if (DoubleUtil.GreaterThanOrClose(point.X, Math.Min(prevLassoPoint.X, lassoPoint.X)))
src\Framework\MS\Internal\Ink\PenCursorManager.cs (3)
237int xHotspot = (int)Math.Round(hotspot.X - drawingBounds.Left); 238int yHotspot = (int)Math.Round(hotspot.Y - drawingBounds.Top); 372double maxLength = Math.Min(SystemParameters.PrimaryScreenWidth / 2, SystemParameters.PrimaryScreenHeight / 2);
src\Framework\MS\Internal\PtsHost\CellParagraph.cs (1)
89Math.Max(TextDpi.FromTextDpi(dvrAvailable), 0));
src\Framework\MS\Internal\PtsHost\ContainerParaClient.cs (2)
77_rect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.du); 78_rect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.dv);
src\Framework\MS\Internal\PtsHost\ContainerParagraph.cs (13)
540fsrcToFillSubtrack.u = Math.Max(Math.Min(fsrcToFillSubtrack.u, fsrcToFill.u + fsrcToFill.du - 1), fsrcToFill.u); 541fsrcToFillSubtrack.du = Math.Max(fsrcToFillSubtrack.du, 0); 554fsrcToFillSubtrack.v = Math.Max(Math.Min(fsrcToFillSubtrack.v, fsrcToFill.v + fsrcToFill.dv - 1), fsrcToFill.v); 555fsrcToFillSubtrack.dv = Math.Max(fsrcToFillSubtrack.dv, 0); 615dvrUsed = Math.Min(fsrcToFill.dv, dvrUsed); 705urSubtrack = Math.Max(Math.Min(urTrack + mbp.MBPLeft, urTrack + durTrack - 1), urTrack); 706durSubtrack = Math.Max(durTrack - (mbp.MBPLeft + mbp.MBPRight), 0); 842urSubtrack = Math.Max(Math.Min(urTrack + mbp.MBPLeft, urTrack + durTrack - 1), urTrack); 843durSubtrack = Math.Max(durTrack - (mbp.MBPLeft + mbp.MBPRight), 0);
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\FigureHelper.cs (5)
188value = Math.Max(1, Math.Min(value, structuralCache.CurrentFormatContext.PageHeight)); 193value = Math.Max(1, Math.Min(value, structuralCache.CurrentFormatContext.PageHeight - pageMargin.Top - pageMargin.Bottom)); 261width = Math.Min(width, pageWidth);
src\Framework\MS\Internal\PtsHost\FigureParaClient.cs (4)
104_contentRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.du - mbp.BPRight - mbp.BPLeft); 106_contentRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.dv - mbp.BPBottom - mbp.BPTop); 109_paddingRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.du - mbp.BorderRight - mbp.BorderLeft); 111_paddingRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.dv - mbp.BorderBottom - mbp.BorderTop);
src\Framework\MS\Internal\PtsHost\FigureParagraph.cs (4)
171int subpageWidth = Math.Max(1, TextDpi.ToTextDpi(anchorLimitedWidth) - (mbp.BPLeft + mbp.BPRight)); 180int subpageHeight = Math.Max(1, TextDpi.ToTextDpi(anchorLimitedHeight) - (mbp.BPTop + mbp.BPBottom)); 639width = Math.Max(TextDpi.MinWidth, maxTotalWidth - elementMarginWidth); 668height = Math.Max(TextDpi.MinWidth, maxTotalHeight - elementMarginHeight);
src\Framework\MS\Internal\PtsHost\FloaterParaClient.cs (4)
230_contentRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.du - mbp.BPRight - mbp.BPLeft); 232_contentRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.dv - mbp.BPBottom - mbp.BPTop); 235_paddingRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.du - mbp.BorderRight - mbp.BorderLeft); 237_paddingRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.dv - mbp.BorderBottom - mbp.BorderTop);
src\Framework\MS\Internal\PtsHost\FloaterParagraph.cs (7)
224dvrAvailable = Math.Min(dvrAvailable, PTS.dvBottomUndefined / 2); 230dvrAvailable = Math.Min(dvrAvailable, TextDpi.ToTextDpi(StructuralCache.CurrentFormatContext.PageHeight)); 243subpageHeight = Math.Max(1, dvrAvailable - (mbp.MBPTop + mbp.MBPBottom)); 683subpageWidth = Math.Max(1, durSpecified - (mbp.BPLeft + mbp.BPRight)); 688subpageWidth = Math.Max(1, durAvailable - (mbp.MBPLeft + mbp.MBPRight)); 694subpageWidth = Math.Max(1, durAvailable - (mbp.MBPLeft + mbp.MBPRight)); 912return Math.Min(desiredSize, spaceAvailable);
src\Framework\MS\Internal\PtsHost\Line.cs (1)
113dvrSuppressible = Math.Max(0, TextDpi.ToTextDpi(_line.OverhangAfter));
src\Framework\MS\Internal\PtsHost\MarginCollapsingState.cs (2)
170_maxPositive = Math.Max(_maxPositive, mcs._maxPositive); 171_minNegative = Math.Min(_minNegative, mcs._minNegative);
src\Framework\MS\Internal\PtsHost\PtsHelper.cs (9)
939return Math.Max(1, Math.Min(PTS.Restrictions.tscColumnRestriction-1, columns)); // at least 1 column is required 986columnWidth = Math.Max(1, Math.Min(columnWidth, pageWidth)); 988freeSpace = Math.Max(0, freeSpace); 1033pfscolinfo[i].durBefore = Math.Max(0, pfscolinfo[i].durBefore); 1034pfscolinfo[i].durWidth = Math.Max(1, pfscolinfo[i].durWidth); 1065pfscolinfo[i].durBefore = Math.Max(0, pfscolinfo[i].durBefore); 1066pfscolinfo[i].durWidth = Math.Max(1, pfscolinfo[i].durWidth);
src\Framework\MS\Internal\PtsHost\PtsHost.cs (1)
1599for(int breakIndex = 0; breakIndex < Math.Min(textBreakpoints.Count, nLineVariantsAlloc); breakIndex++)
src\Framework\MS\Internal\PtsHost\PtsPage.cs (7)
850rect.dv = Math.Max(rect.dv, bbox.fsrc.dv); 853_calculatedSize.Width = Math.Max(TextDpi.MinWidth, TextDpi.FromTextDpi(rect.du)); 854_calculatedSize.Height = Math.Max(TextDpi.MinWidth, TextDpi.FromTextDpi(rect.dv)); 858_contentSize.Width = Math.Max(Math.Max(TextDpi.FromTextDpi(bbox.fsrc.du), TextDpi.MinWidth), _calculatedSize.Width); 859_contentSize.Height = Math.Max(TextDpi.MinWidth, TextDpi.FromTextDpi(bbox.fsrc.dv)); 865_contentSize.Height = Math.Max(_contentSize.Height, _calculatedSize.Height);
src\Framework\MS\Internal\PtsHost\SubpageParaClient.cs (4)
116_contentRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.du - mbp.BPRight - mbp.BPLeft); 118_contentRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.dv - mbp.BPBottom - mbp.BPTop); 121_paddingRect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.du - mbp.BorderRight - mbp.BorderLeft); 123_paddingRect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.dv - mbp.BorderBottom - mbp.BorderTop);
src\Framework\MS\Internal\PtsHost\SubpageParagraph.cs (16)
195subpageWidth = Math.Max(1, subpageWidth - (mbp.MBPLeft + mbp.MBPRight)); 204subpageHeight = Math.Max(1, subpageHeight - (marginTop + mbp.BPTop)); 258dvrUsed = Math.Max(dvrUsed, fsbbox.fsrc.dv + fsbbox.fsrc.v); 259fsrcToFill.du = Math.Max(fsrcToFill.du, fsbbox.fsrc.du + fsbbox.fsrc.u); 302fsbbox.fsrc.du = Math.Max(fsrcToFill.du - (mbp.MarginLeft + mbp.MarginRight), 0); 303fsbbox.fsrc.dv = Math.Max(dvrUsed - dvrTopSpace, 0); 394subpageWidth = Math.Max(1, subpageWidth - (mbp.MBPLeft + mbp.MBPRight)); 466dvrUsed = Math.Max(dvrUsed, fsbbox.fsrc.dv + fsbbox.fsrc.v); 467durTrack = Math.Max(durTrack, fsbbox.fsrc.du + fsbbox.fsrc.u); 477fsbbox.fsrc.du = Math.Max(durTrack - (mbp.MarginLeft + mbp.MarginRight), 0); 478fsbbox.fsrc.dv = Math.Max(dvrUsed - dvrTopSpace, 0); 563subpageWidth = Math.Max(1, subpageWidth - (mbp.MBPLeft + mbp.MBPRight)); 634dvrUsed = Math.Max(dvrUsed, fsbbox.fsrc.dv + fsbbox.fsrc.v); 635durTrack = Math.Max(durTrack, fsbbox.fsrc.du + fsbbox.fsrc.u); 645fsbbox.fsrc.du = Math.Max(durTrack - (mbp.MarginLeft + mbp.MarginRight), 0); 646fsbbox.fsrc.dv = Math.Max(dvrUsed - dvrTopSpace, 0);
src\Framework\MS\Internal\PtsHost\TableParaClient.cs (11)
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)); 1075int iDistance = Math.Abs((cpc.Rect.u + cpc.Rect.du / 2) - suggestedU); 1157int iDistance = Math.Abs((cpc.Rect.u + cpc.Rect.du / 2) - suggestedU); 2055Math.Min(_calculatedColumns.Length, columns)); 2547Math.Max(_rect.du - (mbpInfo.BPRight + mbpInfo.BPLeft), 1), 2548Math.Max(_rect.dv - calculatedBPBottom - calculatedBPTop, 1)
src\Framework\MS\Internal\PtsHost\TextParaClient.cs (19)
854int dcpStart = Math.Max(cpStartTextPointer, cpParagraphStart) - cpParagraphStart; 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)); 2088int dcpRangeStartForThisLine = Math.Max(lineDesc.dcpFirst, dcpStart); 2091int cchRangeForThisLine = Math.Max(Math.Min(lineDesc.dcpLim, dcpEnd) - dcpRangeStartForThisLine, 1); 2203int dcpRangeStartForThisElem = Math.Max(elemDesc.dcpFirst, dcpStart); 2206int cchRangeForThisElem = Math.Max(Math.Min(elemDesc.dcpLim, dcpEnd) - dcpRangeStartForThisElem, 1); 2298lineRect.Width = Math.Max(lineVisual.WidthIncludingTrailingWhitespace, 0); 2409elementRect.Width = Math.Max(lineVisual.WidthIncludingTrailingWhitespace, 0); 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\PtsHost\UIElementParaClient.cs (2)
87_rect.du = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.du); 88_rect.dv = Math.Max(TextDpi.ToTextDpi(TextDpi.MinWidth), _rect.dv);
src\Framework\MS\Internal\PtsHost\UIElementParagraph.cs (3)
389double elementWidth = TextDpi.FromTextDpi(Math.Max(1, durAvailable - (mbp.MBPLeft + mbp.MBPRight))); 406elementHeight = Math.Max(TextDpi.FromTextDpi(1), elementHeight - TextDpi.FromTextDpi(mbp.MBPTop + mbp.MBPBottom)); 427elementHeight = Math.Max(TextDpi.FromTextDpi(1), elementHeight);
src\Framework\MS\Internal\Text\ComplexLine.cs (1)
570offset = Math.Min(_dcp + this.Length, offset);
src\Framework\MS\Internal\Text\DynamicPropertyReader.cs (2)
220return Math.Max(TextDpi.MinWidth, Math.Min(TextDpi.MaxWidth, lineHeight));
src\Framework\MS\Internal\Text\LineProperties.cs (2)
190lineAdvance = Math.Max(lineAdvance, _lineHeight); 222lineAdvance = Math.Max(lineAdvance, _lineHeight);
src\Framework\MS\Internal\Text\SimpleLine.cs (1)
92Math.Min(dcp, _content.Length)
src\Framework\MS\Internal\Text\TextDpi.cs (3)
57return (int)Math.Round(d * _scale); 170pageMargin.Right = Math.Max(0.0, pageSize.Width - pageMargin.Left - _minSize); 179pageMargin.Bottom = Math.Max(0.0, pageSize.Height - pageMargin.Top - _minSize);;
src\Framework\System\Windows\Application.cs (1)
2703if (Math.Abs(diff) == 1)
src\Framework\System\Windows\Automation\Peers\CalendarAutomationPeer.cs (1)
370return Math.Max(0, this.OwningGrid.RowDefinitions.Count - 1);
src\Framework\System\Windows\Automation\Peers\ScrollViewerAutomationPeer.cs (3)
214return Math.Min(100.0, (double)(owner.ViewportWidth * 100.0 / owner.ExtentWidth)); 228return Math.Min(100.0, (double)(owner.ViewportHeight * 100.0 / owner.ExtentHeight)); 264return Math.Min(100.0, (double)(viewport * 100.0 / extent));
src\Framework\System\Windows\Controls\Border.cs (12)
241Size childConstraint = new Size(Math.Max(0.0, constraint.Width - combined.Width), 242Math.Max(0.0, constraint.Height - combined.Height)); 648Math.Max(0.0, rt.Width - thick.Left - thick.Right), 649Math.Max(0.0, rt.Height - thick.Top - thick.Bottom)); 992LeftTop = Math.Max(0.0, radii.TopLeft - left); 993TopLeft = Math.Max(0.0, radii.TopLeft - top); 994TopRight = Math.Max(0.0, radii.TopRight - top); 995RightTop = Math.Max(0.0, radii.TopRight - right); 996RightBottom = Math.Max(0.0, radii.BottomRight - right); 997BottomRight = Math.Max(0.0, radii.BottomRight - bottom); 998BottomLeft = Math.Max(0.0, radii.BottomLeft - bottom); 999LeftBottom = Math.Max(0.0, radii.BottomLeft - left);
src\Framework\System\Windows\Controls\DataGrid.cs (18)
2655indexToSelect = Math.Min(Items.Count - numSelected - 1, indexToSelect); 5078int newRowCount = Math.Abs(endIndex - startIndex) + 1; 5079int newColumnCount = Math.Abs(endColumnIndex - startColumnIndex) + 1; 5097int previousStartIndex = Math.Min(startIndex, currentCellIndex); 5098int previousRowCount = Math.Abs(currentCellIndex - startIndex) + 1; 5099int previousStartColumnIndex = Math.Min(startColumnIndex, currentCellColumnIndex); 5100int previousColumnCount = Math.Abs(currentCellColumnIndex - startColumnIndex) + 1; 5140_selectedCells.AddRegion(Math.Min(startIndex, endIndex), Math.Min(startColumnIndex, endColumnIndex), newRowCount, newColumnCount); 5738nextDisplayIndex = Math.Max(0, InternalColumns.LastVisibleDisplayIndex); 5819nextRowIndex = Math.Max(0, Items.Count - 1); 6004index = Math.Max(0, Math.Min(numItems - 1, index + (shiftModifier ? -1 : 1))); 6147int jumpDistance = Math.Max(1, (int)scrollHost.ViewportHeight - 1); 6149targetIndex = Math.Max(0, Math.Min(targetIndex, Items.Count - 1)); 6592distance = Math.Abs(pt.Y - cellBounds.Top); 6600distance = Math.Abs(pt.X - cellBounds.Left);
src\Framework\System\Windows\Controls\DataGridCellsPanel.cs (6)
192measureHeight = Math.Max(measureHeight, blockMeasureSize.Height); 404measureSize.Height = Math.Max(measureSize.Height, childSize.Height); 424measureSize.Height = Math.Max(measureSize.Height, headerSize.Height); 619measureHeight = Math.Max(measureHeight, childSize.Height); 1910childMeasureWidth = Math.Max(averageColumnWidth, column.MinWidth); 1911childMeasureWidth = Math.Min(childMeasureWidth, column.MaxWidth);
src\Framework\System\Windows\Controls\DataGridColumnCollection.cs (24)
755int columnCount = Math.Min(newFrozenCount, Count); 763int columnCount = Math.Min(oldFrozenCount, Count); 953availableStarSpace = Math.Max(0.0, availableStarSpace - columnMinWidth); 1237double displayValue = Math.Max(width.DesiredValue, minWidth); 1277double displayValue = Math.Min(width.DesiredValue, maxWidth); 1345TakeAwayWidthFromColumns(null, Math.Abs(availableSpaceChange), false, newTotalAvailableSpace); 1369column.SetWidthInternal(new DataGridLength(width.Value, width.UnitType, width.DesiredValue, Math.Min(width.DesiredValue, maxWidth))); 1391Math.Max(width.DisplayValue - nonRetrievableSpace, changedColumn.MinWidth))); 1463return Math.Max(availableSpace - requiredSpace, 0.0); 1674column.UpdateWidthForStarColumn(Math.Max(columnDesiredWidth, column.MinWidth), columnDesiredWidth, columnDesiredWidth / perStarWidth); 1703double columnExcessWidth = onlyShrinkToDesiredWidth ? width.DisplayValue - Math.Max(width.DesiredValue, column.MinWidth) : width.DisplayValue - column.MinWidth; 1788double maxColumnResizeWidth = expandBeyondDesiredWidth ? column.MaxWidth : Math.Min(width.DesiredValue, column.MaxWidth); 1923column.UpdateWidthForStarColumn(Math.Min(columnDesiredWidth, column.MaxWidth), columnDesiredWidth, columnDesiredWidth / perStarWidth); 2010double usedStarSpace = ComputeStarColumnWidths(Math.Min(expectedStarSpace, sumOfStarMaxWidths)); 2011giveAwayWidth = Math.Max(usedStarSpace - expectedStarSpace, 0.0); 2081double lagWidth = Math.Min(width.DesiredValue, columnMaxWidth) - width.DisplayValue; 2112if (DoubleUtil.LessThan(width.DisplayValue, Math.Min(width.DesiredValue, column.MaxWidth))) 2140giveAwayWidth -= Math.Min(contributingSpace, giveAwayWidth); 2147giveAwayWidth = Math.Min(giveAwayWidth, Math.Max(0d, totalSpace - usedSpace)); 2194return Math.Min(usedSpace - totalAvailableWidth, takeAwayWidth); 2202takeAwayWidth = Math.Max(0.0, takeAwayWidth - unusedSpace); 2273double usedStarSpace = ComputeStarColumnWidths(Math.Max(expectedStarSpace, sumOfStarMinWidths)); 2274takeAwayWidth = Math.Max(usedStarSpace - expectedStarSpace, 0.0);
src\Framework\System\Windows\Controls\DataGridHelper.cs (4)
40return new Size(size.Width, Math.Max(0.0, size.Height - thickness)); 44return new Size(Math.Max(0.0, size.Width - thickness), size.Height); 721value = Math.Max(value, minValue); 722value = Math.Min(value, maxValue);
src\Framework\System\Windows\Controls\DataGridRow.cs (1)
554double minHeight = Math.Max(RowHeader.DesiredSize.Height, MinHeight);
src\Framework\System\Windows\Controls\DefinitionBase.cs (2)
139_minSize = Math.Max(_minSize, minSize); 882sharedMinSize = Math.Max(sharedMinSize, _registry[i].MinSize);
src\Framework\System\Windows\Controls\DockPanel.cs (10)
232childConstraint = new Size(Math.Max(0.0, constraint.Width - accumulatedWidth), 233Math.Max(0.0, constraint.Height - accumulatedHeight)); 253parentHeight = Math.Max(parentHeight, accumulatedHeight + childDesiredSize.Height); 259parentWidth = Math.Max(parentWidth, accumulatedWidth + childDesiredSize.Width); 266parentWidth = Math.Max(parentWidth, accumulatedWidth); 267parentHeight = Math.Max(parentHeight, accumulatedHeight); 297Math.Max(0.0, arrangeSize.Width - (accumulatedLeft + accumulatedRight)), 298Math.Max(0.0, arrangeSize.Height - (accumulatedTop + accumulatedBottom)) ); 311rcChild.X = Math.Max(0.0, arrangeSize.Width - accumulatedRight); 322rcChild.Y = Math.Max(0.0, arrangeSize.Height - accumulatedBottom);
src\Framework\System\Windows\Controls\DocumentViewer.cs (2)
1428VerticalOffset = Math.Max(verticalOffset, 0.0); 1429HorizontalOffset = Math.Max(horizontalOffset, 0.0);
src\Framework\System\Windows\Controls\FlowDocumentReader.cs (2)
723SetCurrentValueInternal(ZoomProperty, Math.Min(Zoom + ZoomIncrement, MaxZoom)); 735SetCurrentValueInternal(ZoomProperty, Math.Max(Zoom - ZoomIncrement, MinZoom));
src\Framework\System\Windows\Controls\FlowDocumentScrollViewer.cs (8)
593Math.Max(ia.OriginWidth, pagePadding.Left), 594Math.Max(ia.OriginHeight, pagePadding.Top), 595Math.Max(ia.MediaSizeWidth - (ia.OriginWidth + ia.ExtentWidth), pagePadding.Right), 596Math.Max(ia.MediaSizeHeight - (ia.OriginHeight + ia.ExtentHeight), pagePadding.Bottom)); 635Zoom = Math.Min(Zoom + ZoomIncrement, MaxZoom); 647Zoom = Math.Max(Zoom - ZoomIncrement, MinZoom); 718SetCurrentValueInternal(ZoomProperty, Math.Min(Zoom + ZoomIncrement, MaxZoom)); 722SetCurrentValueInternal(ZoomProperty, Math.Max(Zoom - ZoomIncrement, MinZoom));
src\Framework\System\Windows\Controls\Grid.cs (69)
442gridDesiredSize.Width = Math.Max(gridDesiredSize.Width, child.DesiredSize.Width); 443gridDesiredSize.Height = Math.Max(gridDesiredSize.Height, child.DesiredSize.Height); 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); 1169userMinSize = Math.Max(userMinSize, Math.Min(userSize, userMaxSize)); 1193definitions[i].MeasureSize = Math.Max(userMinSize, Math.Min(userSize, userMaxSize)); 1294DefinitionsU[PrivateCells[i].ColumnIndex].UpdateMinSize(Math.Min(children[i].DesiredSize.Width, DefinitionsU[PrivateCells[i].ColumnIndex].UserMaxSize)); 1311DefinitionsV[PrivateCells[i].RowIndex].UpdateMinSize(Math.Min(children[i].DesiredSize.Height, DefinitionsV[PrivateCells[i].RowIndex].UserMaxSize)); 1532double maxSize = Math.Max(definitions[i].UserMaxSize, minSize); 1584double newMinSize = Math.Min(sizeToDistribute / (count - i), tempDefinitions[i].PreferredSize); 1614tempDefinitions[i].UpdateMinSize(Math.Min(newMinSize, tempDefinitions[i].SizeCache)); 1625tempDefinitions[i].UpdateMinSize(Math.Min(newMinSize, tempDefinitions[i].SizeCache)); 1736starValue = Math.Min(starValue, c_starClip); 1740double maxSize = Math.Max(definitions[i].MinSize, definitions[i].UserMaxSize); 1741maxSize = Math.Min(maxSize, c_starClip); 1779double userSize = Math.Max(availableSize - takenSize, 0.0) * (starValue / tempDefinitions[i].SizeCache); 1780resolvedSize = Math.Min(userSize, tempDefinitions[i].UserMaxSize); 1781resolvedSize = Math.Max(tempDefinitions[i].MinSize, resolvedSize); 1842double power = Math.Floor(Math.Log(Double.MaxValue / maxStar / starCount, 2.0)); 1845scale = Math.Pow(2.0, power - 4.0); // -4 is just for paranoia 1893double effectiveMaxSize = Math.Max(def.MinSize, def.UserMaxSize); 1965resolvedSize = Math.Max(resolvedDef.MinSize, resolvedDef.UserMaxSize); 2083double resolvedSize = (def.MeasureSize > 0.0) ? Math.Max(availableSize - takenSize, 0.0) * (def.MeasureSize / def.SizeCache) : 0.0; 2086resolvedSize = Math.Min(resolvedSize, def.UserMaxSize); 2087resolvedSize = Math.Max(def.MinSize, resolvedSize); 2176starValue = Math.Min(starValue, c_starClip); 2180double maxSize = Math.Max(definitions[i].MinSizeForArrange, definitions[i].UserMaxSize); 2181maxSize = Math.Min(maxSize, c_starClip); 2221definitions[i].SizeCache = Math.Max(definitions[i].MinSizeForArrange, Math.Min(userSize, userMaxSize)); 2267double userSize = Math.Max(finalSize - allPreferredArrangeSize, 0.0) * (starValue / definitions[definitionIndices[i]].SizeCache); 2268resolvedSize = Math.Min(userSize, definitions[definitionIndices[i]].UserMaxSize); 2269resolvedSize = Math.Max(definitions[definitionIndices[i]].MinSizeForArrange, resolvedSize); 2295final = Math.Max(final, definitions[definitionIndex].MinSizeForArrange); 2296final = Math.Min(final, definitions[definitionIndex].SizeCache); 2302final = Math.Max(final, definitions[definitionIndex].MinSizeForArrange); 2303final = Math.Min(final, definitions[definitionIndex].SizeCache); 2337final = Math.Max(final, definition.MinSizeForArrange); 2353final = Math.Max(final, definition.MinSizeForArrange); 2424double power = Math.Floor(Math.Log(Double.MaxValue / maxStar / starCount, 2.0)); 2427scale = Math.Pow(2.0, power - 4.0); // -4 is just for paranoia 2471double effectiveMaxSize = Math.Max(def.MinSizeForArrange, def.UserMaxSize); 2510def.SizeCache = Math.Max(def.MinSizeForArrange, Math.Min(userSize, userMaxSize)); 2581resolvedSize = Math.Max(resolvedDef.MinSizeForArrange, resolvedDef.UserMaxSize); 2700double resolvedSize = (def.MeasureSize > 0.0) ? Math.Max(finalSize - takenSize, 0.0) * (def.MeasureSize / def.SizeCache) : 0.0; 2703resolvedSize = Math.Min(resolvedSize, def.UserMaxSize); 2704resolvedSize = Math.Max(def.MinSizeForArrange, resolvedSize); 2797final = Math.Max(final, definition.MinSizeForArrange); 2813final = Math.Max(final, definition.MinSizeForArrange); 2855double minPower = Math.Floor(Math.Log(minRatio, 2.0)); 2856double maxPower = Math.Floor(Math.Log(maxRatio, 2.0)); 2857double f = Math.Pow(2.0, Math.Floor((minPower + maxPower) / 2.0)); 2936Array.Clear(extData.TempDefinitions, 0, Math.Max(DefinitionsU.Length, DefinitionsV.Length)); 3141int requiredLength = Math.Max(DefinitionsU.Length, DefinitionsV.Length) * 2; 3174int requiredLength = Math.Max(Math.Max(DefinitionsU.Length, DefinitionsV.Length), 1) * 2; 3192int requiredLength = Math.Max(DefinitionsU.Length, DefinitionsV.Length); 3284return (Math.Abs(d) < c_epsilon); 3295return (Math.Abs(d1 - d2) < c_epsilon);
src\Framework\System\Windows\Controls\GridSplitter.cs (13)
506_resizeData.SplitterLength = Math.Min(ActualWidth, ActualHeight); 658horizontalChange = Math.Round(horizontalChange / dragIncrement) * dragIncrement; 659verticalChange = Math.Round(verticalChange / dragIncrement) * dragIncrement; 666_resizeData.Adorner.OffsetX = Math.Min(Math.Max(horizontalChange, _resizeData.MinChange), _resizeData.MaxChange); 670_resizeData.Adorner.OffsetY = Math.Min(Math.Max(verticalChange, _resizeData.MinChange), _resizeData.MaxChange); 804definition1Min = Math.Max(definition1Min, _resizeData.SplitterLength); 808definition2Min = Math.Max(definition2Min, _resizeData.SplitterLength); 814minDelta = -Math.Min(definition1Len - definition1Min, definition2Max - definition2Len); 815maxDelta = Math.Min(definition1Max - definition1Len, definition2Len - definition2Min); 923delta = Math.Min(Math.Max(delta, min), max);
src\Framework\System\Windows\Controls\GridViewHeaderRowPresenter.cs (8)
264double childConstraintWidth = Math.Max(0.0, constraint.Width - accumulatedWidth); 286childConstraintWidth = Math.Min(childConstraintWidth, column.DesiredWidth); 294childConstraintWidth = Math.Min(childConstraintWidth, column.Width); 301maxHeight = Math.Max(maxHeight, child.DesiredSize.Height); 308maxHeight = Math.Max(maxHeight, _paddingHeader.DesiredSize.Height); 357double childArrangeWidth = Math.Min(remainingWidth, ((column.State == ColumnMeasureState.SpecificWidth) ? column.Width : column.DesiredWidth)); 391rect = new Rect(accumulatedWidth, 0.0, Math.Max(remainingWidth, 0.0), arrangeSize.Height); 1250return (DoubleUtil.GreaterThan(Math.Abs(currentPos.X - originalPos.X), c_thresholdX));
src\Framework\System\Windows\Controls\GridViewRowPresenter.cs (5)
150double childConstraintWidth = Math.Max(0.0, constraint.Width - accumulatedWidth); 179childConstraintWidth = Math.Min(childConstraintWidth, column.DesiredWidth); 187childConstraintWidth = Math.Min(childConstraintWidth, column.Width); 194maxHeight = Math.Max(maxHeight, child.DesiredSize.Height); 227double childArrangeWidth = Math.Min(remainingWidth, ((column.State == ColumnMeasureState.SpecificWidth) ? column.Width : column.DesiredWidth));
src\Framework\System\Windows\Controls\InkPresenter.cs (4)
185newSize.Width = Math.Max(newSize.Width, sizeStrokes.Width); 186newSize.Height = Math.Max(newSize.Height, sizeStrokes.Height); 219availableSize = new Size(Math.Min(arrangeSize.Width, _constraintSize.Width), 220Math.Min(arrangeSize.Height, _constraintSize.Height));
src\Framework\System\Windows\Controls\ItemContainerGenerator.cs (1)
2772int index = Math.Min(oldIndex, newIndex);
src\Framework\System\Windows\Controls\ItemsControl.cs (2)
2814return FindFocusable((int)(ScrollHost.VerticalOffset + Math.Max(ScrollHost.ViewportHeight - 1, 0)), 2828return FindFocusable((int)(ScrollHost.HorizontalOffset + Math.Max(ScrollHost.ViewportWidth - 1, 0)),
src\Framework\System\Windows\Controls\MenuScrollingVisibilityConverter.cs (2)
99double percent = Math.Min(100.0, Math.Max(0.0, (verticalOffset * 100.0 / (extentHeight - viewportHeight))));
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\BulletDecorator.cs (5)
258contentConstraint.Width = Math.Max(0.0, contentConstraint.Width - bulletSize.Width); 264Size desiredSize = new Size(bulletSize.Width + contentSize.Width, Math.Max(bulletSize.Height, contentSize.Height)); 301contentSize.Width = Math.Max(content.DesiredSize.Width, arrangeSize.Width - bullet.DesiredSize.Width); 302contentSize.Height = Math.Max(content.DesiredSize.Height, arrangeSize.Height); 307bulletOffsetY += Math.Max(0d, centerY - bulletSize.Height * 0.5d);
src\Framework\System\Windows\Controls\Primitives\DataGridCellsPresenter.cs (1)
135dirtyCount = Math.Min(newColumnCount, oldColumnCount);
src\Framework\System\Windows\Controls\Primitives\DataGridColumnHeadersPresenter.cs (10)
122desiredSize.Width = Math.Max(desiredSize.Width, indicatorSize.Width); 123desiredSize.Height = Math.Max(desiredSize.Height, indicatorSize.Height); 130desiredSize.Width = Math.Max(desiredSize.Width, indicatorSize.Width); 131desiredSize.Height = Math.Max(desiredSize.Height, indicatorSize.Height); 134desiredSize.Width = Math.Min(availableSize.Width, desiredSize.Width); 154childRect.Width = Math.Max(finalSize.Width, dataGrid.CellsPanelActualWidth); 649return DoubleUtil.GreaterThan(Math.Abs(currentPos.X - originalPos.X), SystemParameters.MinimumHorizontalDragDistance); 698height = Math.Max(_draggingSrcColumnHeader.RenderSize.Height, _columnHeaderDragIndicator.Height); 922columnEstimatedWidth = Math.Max(averageColumnWidth, column.MinWidth); 923columnEstimatedWidth = Math.Min(columnEstimatedWidth, column.MaxWidth);
src\Framework\System\Windows\Controls\Primitives\DocumentPageView.cs (2)
971pageVisualRect.Width = Math.Min(pageVisualRect.Width, maxWidth); 972pageVisualRect.Height = Math.Min(pageVisualRect.Height, maxHeight);
src\Framework\System\Windows\Controls\Primitives\Popup.cs (26)
2114if (Math.Abs(score - childArea) < Tolerance) 2140if (Math.Abs(intersection.Width - childBounds.Width) > Tolerance || 2141Math.Abs(intersection.Height - childBounds.Height) > Tolerance) 2156if (!IsTransparent || double.IsNaN(horizontalAxis.Y) || Math.Abs(horizontalAxis.Y) < Tolerance) 2168else if (IsTransparent && Math.Abs(horizontalAxis.X) < Tolerance) 2191if (!IsTransparent || double.IsNaN(verticalAxis.X) || Math.Abs(verticalAxis.X) < Tolerance) 2202else if (IsTransparent && Math.Abs(verticalAxis.Y) < Tolerance) 2257if (!IsTransparent || double.IsNaN(verticalAxis.X) || Math.Abs(verticalAxis.X) < Tolerance) 2259limitSize.Height = Math.Max(0.0, Math.Max(screenBounds.Bottom - targetBounds.Bottom, targetBounds.Top - screenBounds.Top)); 2261else if (IsTransparent && Math.Abs(verticalAxis.Y) < Tolerance) 2263limitSize.Width = Math.Max(0.0, Math.Max(screenBounds.Right - targetBounds.Right, targetBounds.Left - screenBounds.Left)); 2279if (!IsTransparent || double.IsNaN(horizontalAxis.X) || Math.Abs(horizontalAxis.Y) < Tolerance) 2281limitSize.Width = Math.Max(0.0, Math.Max(screenBounds.Right - targetBounds.Right, targetBounds.Left - screenBounds.Left)); 2283else if (IsTransparent && Math.Abs(horizontalAxis.X) < Tolerance) 2285limitSize.Height = Math.Max(0.0, Math.Max(screenBounds.Bottom - targetBounds.Bottom, targetBounds.Top - screenBounds.Top)); 2637desiredSize.Width = Math.Min(desiredSize.Width, screenBounds.Width); 2638desiredSize.Width = Math.Min(desiredSize.Width, limitSize.Width); 2642desiredSize.Height = Math.Min(desiredSize.Height, screenBounds.Height); 2643desiredSize.Height = Math.Min(desiredSize.Height, maxHeight); 2644desiredSize.Height = Math.Min(desiredSize.Height, limitSize.Height); 2717return new Rect(mousePoint.x, mousePoint.y - 1, Math.Max(0, cursorWidth - hotX), Math.Max(0, cursorHeight - hotY + 2));
src\Framework\System\Windows\Controls\Primitives\PopupRoot.cs (4)
223restrictWidth = Math.Abs(restrictedSize.Width - desiredSize.Width) > Popup.Tolerance; 224restrictHeight = Math.Abs(restrictedSize.Height - desiredSize.Height) > Popup.Tolerance; 235return new Size(Math.Min(restrictedSize.Width, restricted2DDesiredSize.Width), 236Math.Min(restrictedSize.Height, restricted2DDesiredSize.Height));
src\Framework\System\Windows\Controls\Primitives\ScrollBar.cs (8)
354perpendicularDragDelta = Math.Abs(verticalDragDelta); 358perpendicularDragDelta = Math.Abs(horizontalDragDelta); 430newValue = Math.Min(Math.Max(newValue, Minimum), Maximum); 560double newValue = Math.Max(Value - SmallChange, Minimum); 569double newValue = Math.Min(Value + SmallChange, Maximum); 578double newValue = Math.Max(Value - LargeChange, Minimum); 587double newValue = Math.Min(Value + LargeChange, Maximum);
src\Framework\System\Windows\Controls\Primitives\ScrollContentPresenter.cs (5)
451desiredSize.Width = Math.Min(constraint.Width, desiredSize.Width); 452desiredSize.Height = Math.Min(constraint.Height, desiredSize.Height); 500childRect.Width = Math.Max(childRect.Width, arrangeSize.Width); 501childRect.Height = Math.Max(childRect.Height, arrangeSize.Height); 703return Math.Max(0.0, offset);
src\Framework\System\Windows\Controls\Primitives\TabPanel.cs (5)
213desiredSizeWithoutMargin.Height = Math.Max(0d, element.DesiredSize.Height - margin.Top - margin.Bottom); 214desiredSizeWithoutMargin.Width = Math.Max(0d, element.DesiredSize.Width - margin.Left - margin.Right); 285childSize.Height = Math.Max(0d, childSize.Height - topOffset - bottomOffset); 286childSize.Width = Math.Max(0d, childSize.Width - leftOffset - rightOffset); 417currentAverageGap = Math.Max(0d, (rowWidthLimit - currentRowWidth) / numberOfHeadersInCurrentRow); // The amout of width that should be added to justify the header
src\Framework\System\Windows\Controls\Primitives\TickBar.cs (4)
536Point pt2 = new Point(startPoint.X + tickLen2, y0 + Math.Abs(tickLen2) * progression); 549pt2 = new Point(startPoint.X + tickLen2, y0 - Math.Abs(tickLen2) * progression); 641Point pt2 = new Point(x0 + Math.Abs(tickLen2) * progression, startPoint.Y + tickLen2); 654pt2 = new Point(x0 - Math.Abs(tickLen2) * progression, startPoint.Y + tickLen2);
src\Framework\System\Windows\Controls\Primitives\ToolBarOverflowPanel.cs (7)
123_wrapWidth = Math.Min(_wrapWidth, constraint.Width); 132_panelSize.Width = Math.Max(curLineSize.Width, _panelSize.Width); 138_panelSize.Width = Math.Max(sz.Width, _panelSize.Width); 146curLineSize.Height = Math.Max(sz.Height, curLineSize.Height); 151_panelSize.Width = Math.Max(curLineSize.Width, _panelSize.Width); 167_wrapWidth = Math.Min(_wrapWidth, arrangeBounds.Width); 187curLineSize.Height = Math.Max(sz.Height, curLineSize.Height);
src\Framework\System\Windows\Controls\Primitives\ToolBarPanel.cs (6)
126panelDesiredSize.Height = Math.Max(panelDesiredSize.Height, childDesiredSize.Height); 130panelDesiredSize.Width = Math.Max(panelDesiredSize.Width, childDesiredSize.Width); 185panelDesiredSize.Height = Math.Max(panelDesiredSize.Height, childDesiredSize.Height); 190panelDesiredSize.Width = Math.Max(panelDesiredSize.Width, childDesiredSize.Width); 314rcChild.Height = Math.Max(arrangeSize.Height, child.DesiredSize.Height); 321rcChild.Width = Math.Max(arrangeSize.Width, child.DesiredSize.Width);
src\Framework\System\Windows\Controls\Primitives\Track.cs (11)
84return Math.Max(Minimum, Math.Min(Maximum, val)); 484double viewportSize = Math.Max(0.0, ViewportSize); 583double range = Math.Max(0.0, Maximum - min); 584double offset = Math.Min(range, Value - min); 622double range = Math.Max(0.0, Maximum - min); 623double offset = Math.Min(range, Value - min); 627double extent = Math.Max(0.0, range) + viewportSize; 639thumbMinLength = Math.Floor(buttonHeight * 0.5); 647thumbMinLength = Math.Floor(buttonWidth * 0.5); 653thumbLength = Math.Max(thumbMinLength, thumbLength);
src\Framework\System\Windows\Controls\Primitives\UniformGrid.cs (1)
305_rows = (int)Math.Sqrt(nonCollapsedCount);
src\Framework\System\Windows\Controls\PrintDialog.cs (6)
359dlg.MinPage = Math.Max(1, Math.Min(_minPage, _maxPage)); 360dlg.MaxPage = Math.Max(dlg.MinPage, Math.Max(_minPage, _maxPage)); 366Math.Max((int)dlg.MinPage, _pageRange.PageFrom), 367Math.Min((int)dlg.MaxPage, _pageRange.PageTo));
src\Framework\System\Windows\Controls\ScrollViewer.cs (17)
412get { return Math.Max(0.0, ExtentWidth - ViewportWidth); } 420get { return Math.Max(0.0, ExtentHeight - ViewportHeight); } 1803DoubleUtil.LessThan(Math.Abs(unusedX), PanningInfo.PreFeedbackTranslationX)) 1811DoubleUtil.LessThan(Math.Abs(unusedY), PanningInfo.PreFeedbackTranslationY)) 1856double newUnused = Math.Max(unused + delta, 0); 1865double newUnused = Math.Min(unused + delta, 0); 1876Math.Round(PanningRatio * cumulativeTranslation / _panningInfo.DeltaPerHorizontalOffet)); 1886Math.Round(PanningRatio * cumulativeTranslation / _panningInfo.DeltaPerVerticalOffset)); 1899if (Math.Abs(Environment.TickCount - _panningInfo.InertiaBoundaryBeginTimestamp) < PanningInfo.InertiaBoundryMinimumTicks) 1904return (DoubleUtil.GreaterThanOrClose(Math.Abs(_panningInfo.UnusedTranslation.X), PanningInfo.MaxInertiaBoundaryTranslation) || 1905DoubleUtil.GreaterThanOrClose(Math.Abs(_panningInfo.UnusedTranslation.Y), PanningInfo.MaxInertiaBoundaryTranslation)); 1924bool validX = (DoubleUtil.GreaterThan(Math.Abs(translation.X), PanningInfo.PrePanTranslation)); 1925bool validY = (DoubleUtil.GreaterThan(Math.Abs(translation.Y), PanningInfo.PrePanTranslation)); 1935bool biggerX = (DoubleUtil.GreaterThanOrClose(Math.Abs(translation.X), Math.Abs(translation.Y))); 1948bool biggerY = (DoubleUtil.GreaterThanOrClose(Math.Abs(translation.Y), Math.Abs(translation.X)));
src\Framework\System\Windows\Controls\SinglePageViewer.cs (6)
711Math.Max(ia.OriginWidth, pagePadding.Left), 712Math.Max(ia.OriginHeight, pagePadding.Top), 713Math.Max(ia.MediaSizeWidth - (ia.OriginWidth + ia.ExtentWidth), pagePadding.Right), 714Math.Max(ia.MediaSizeHeight - (ia.OriginHeight + ia.ExtentHeight), pagePadding.Bottom)); 752SetCurrentValueInternal(ZoomProperty, Math.Min(Zoom + ZoomIncrement, MaxZoom)); 764SetCurrentValueInternal(ZoomProperty, Math.Max(Zoom - ZoomIncrement, MinZoom));
src\Framework\System\Windows\Controls\Slider.cs (13)
1023valueToSize = Math.Max(0.0, (trackSize.Width - thumbSize.Width) / range); 1029Canvas.SetLeft(rangeElement, (thumbSize.Width * 0.5) + Math.Max(Maximum - SelectionEnd, 0) * valueToSize); 1033Canvas.SetLeft(rangeElement, (thumbSize.Width * 0.5) + Math.Max(SelectionStart - Minimum, 0) * valueToSize); 1045valueToSize = Math.Max(0.0, (trackSize.Height - thumbSize.Height) / range); 1051Canvas.SetTop(rangeElement, (thumbSize.Height * 0.5) + Math.Max(SelectionStart - Minimum, 0) * valueToSize); 1055Canvas.SetTop(rangeElement, (thumbSize.Height * 0.5) + Math.Max(Maximum - SelectionEnd,0) * valueToSize); 1140previous = Minimum + (Math.Round(((value - Minimum) / TickFrequency)) * TickFrequency); 1141next = Math.Min(Maximum, previous + TickFrequency); 1161double next = SnapToTick(Math.Max(this.Minimum, Math.Min(this.Maximum, value + direction))); 1199double tickNumber = Math.Round((value - Minimum) / TickFrequency); 1357this.SetCurrentValueInternal(ValueProperty, Math.Max(this.Minimum, Math.Min(this.Maximum, snappedValue)));
src\Framework\System\Windows\Controls\Stack.cs (15)
610stackDesiredSize.Height = Math.Max(stackDesiredSize.Height, childDesiredSize.Height); 615stackDesiredSize.Width = Math.Max(stackDesiredSize.Width, childDesiredSize.Width); 675offset.Y = Math.Max(0, Math.Min(offset.Y, extent.Height - viewport.Height)); 683offset.X = Math.Max(0, Math.Min(offset.X, extent.Width - viewport.Width)); 688stackDesiredSize.Width = Math.Min(stackDesiredSize.Width, constraint.Width); 689stackDesiredSize.Height = Math.Min(stackDesiredSize.Height, constraint.Height); 767rcChild.Height = Math.Max(arrangeSize.Height, child.DesiredSize.Height); 774rcChild.Width = Math.Max(arrangeSize.Width, child.DesiredSize.Width); 908double left = Math.Max(targetRectOffset, minPhysicalOffset); 909targetRectSize = Math.Max(Math.Min(targetRectSize + targetRectOffset, minPhysicalOffset + viewportSize) - left, 0); 1007iNewOffset = Math.Max(Math.Min(numberOfItems - 1, iNewOffset), 0);
src\Framework\System\Windows\Controls\StickyNote.cs (4)
1160horizontalChange = Math.Min(Math.Max(minBoundary.X, horizontalChange), maxBoundary.X); 1161verticalChange = Math.Min(Math.Max(minBoundary.Y, verticalChange), maxBoundary.Y);
src\Framework\System\Windows\Controls\TextBlock.cs (12)
1353Size contentSize = new Size(Math.Max(0.0, constraint.Width - (padding.Left + padding.Right)), 1354Math.Max(0.0, constraint.Height - (padding.Top + padding.Bottom))); 1393desiredSize.Width = Math.Max(desiredSize.Width, line.GetCollapsedWidth()); 1622double contentBottom = Math.Max(0.0, RenderSize.Height - Padding.Bottom); 2067Size contentSize = new Size(Math.Max(0.0, _referenceSize.Width - (padding.Left + padding.Right)), 2068Math.Max(0.0, _referenceSize.Height - (padding.Top + padding.Bottom))); 2419int dcpStart = Math.Max(dcpLineStart, dcpPositionStart); 2420int dcpEnd = Math.Min(dcpLineEnd, dcpPositionEnd); 3206Size contentSize = new Size(Math.Max(0.0, computedSize.Width - (padding.Left + padding.Right)), 3207Math.Max(0.0, computedSize.Height - (padding.Top + padding.Bottom))); 3256double contentBottom = Math.Max(0.0, RenderSize.Height - Padding.Bottom); 3286width = Math.Max(0.0, width - paddingWidth);
src\Framework\System\Windows\Controls\TextBox.cs (3)
352return (int)Math.Floor((this.VerticalOffset / lineHeight) + epsilon); 376return (int)Math.Floor((this.VerticalOffset + this.ViewportHeight - 1) / GetLineHeight()); 1722if ( 2*(prefix + suffix) >= Math.Min(oldText.Length, newText.Length))
src\Framework\System\Windows\Controls\TextRangeAdaptor.cs (1)
1004int absCount = (count == int.MinValue) ? int.MaxValue : Math.Abs(count);
src\Framework\System\Windows\Controls\ToolBar.cs (2)
568extraLength = Math.Max(0.0, desiredSize.Width - toolBarPanel.DesiredSize.Width + margin.Left + margin.Right); 572extraLength = Math.Max(0.0, desiredSize.Height - toolBarPanel.DesiredSize.Height + margin.Top + margin.Bottom);
src\Framework\System\Windows\Controls\ToolBarTray.cs (5)
399bandThickness = Math.Max(bandThickness, fHorizontal ? toolBar.DesiredSize.Height : toolBar.DesiredSize.Width); 414toolBarTrayDesiredSize.Width = Math.Max(toolBarTrayDesiredSize.Width, bandLength); 419toolBarTrayDesiredSize.Height = Math.Max(toolBarTrayDesiredSize.Height, bandLength); 813currentToolBar.Width = Math.Max(currentToolBar.MinLength, currentToolBar.RenderSize.Width - toolBarOffset + position); 815currentToolBar.Height = Math.Max(currentToolBar.MinLength, currentToolBar.RenderSize.Height - toolBarOffset + position);
src\Framework\System\Windows\Controls\VirtualizedCellInfoCollection.cs (12)
616int left = Math.Max(Left, region.Left); 617int top = Math.Max(Top, region.Top); 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); 691Right = Math.Max(prevRight, region.Right); 692Bottom = Math.Max(prevBottom, region.Bottom); 732int top = Math.Max(Top, region.Top); 733int bottom = Math.Min(Bottom, region.Bottom); 740int top = Math.Max(Top, region.Top); 741int bottom = Math.Min(Bottom, region.Bottom);
src\Framework\System\Windows\Controls\VirtualizingStackPanel.cs (172)
515double delta = Math.Abs(scrollX - oldViewportOffset.X); 528_scrollData._offset.X = Math.Floor(_scrollData._offset.X); 529_scrollData._computedOffset.X = Math.Floor(_scrollData._computedOffset.X); 641double delta = Math.Abs(scrollY - oldViewportOffset.Y); 654_scrollData._offset.Y = Math.Floor(_scrollData._offset.Y); 655_scrollData._computedOffset.Y = Math.Floor(_scrollData._computedOffset.Y); 2286double factor = Math.Min(1.0, isHorizontal ? viewport.Width / extendedViewport.Width : viewport.Height / extendedViewport.Height); 2287int calcItemsInViewportCount = (int)Math.Ceiling(factor * _itemsInExtendedViewportCount); 2288excludeCount = Math.Max(excludeCount, 2580double spanBeforeViewport = Math.Max(isHorizontal ? viewport.X : viewport.Y, 0.0); 2637_firstItemInExtendedViewportIndex = Math.Max(_firstItemInExtendedViewportIndex - 1, 0); 2639_firstItemInExtendedViewportChildIndex = Math.Max(_firstItemInExtendedViewportChildIndex, 0); 3328arrangeLength = Math.Max(isHorizontal ? arrangeSize.Height : arrangeSize.Width, arrangeLength); 4670pixelSizeBeforeViewport = Math.Max(pixelSizeBeforeViewport, Math.Abs(_viewport.X - _extendedViewport.X)); 4674logicalSizeBeforeViewport = Math.Max(logicalSizeBeforeViewport, Math.Abs(_viewport.X - _extendedViewport.X)); 4706extendedViewport.Width = Math.Max(extendedViewport.Width + extendedViewport.X, 0.0); 4741extendedViewport.Width = Math.Max(extendedViewport.Width / approxSizeOfLogicalUnit + extendedViewport.X, 0.0) * approxSizeOfLogicalUnit; 4776pixelSizeBeforeViewport = Math.Max(pixelSizeBeforeViewport, Math.Abs(_viewport.Y - _extendedViewport.Y)); 4780logicalSizeBeforeViewport = Math.Max(logicalSizeBeforeViewport, Math.Abs(_viewport.Y - _extendedViewport.Y)); 4812extendedViewport.Height = Math.Max(extendedViewport.Height + extendedViewport.Y, 0.0); 4847extendedViewport.Height = Math.Max(extendedViewport.Height / approxSizeOfLogicalUnit + extendedViewport.Y, 0.0) * approxSizeOfLogicalUnit; 4865double factor = Math.Max(1.0, isHorizontal ? extendedViewport.Width / viewport.Width : extendedViewport.Height / viewport.Height); 4866int calcItemsInExtendedViewportCount = (int)Math.Ceiling(factor * _actualItemsInExtendedViewportCount); 4867itemsInExtendedViewportCount = Math.Max(calcItemsInExtendedViewportCount, itemsInExtendedViewportCount); 4978viewport.Width = Math.Max(viewport.Width - sizeAfterStartViewportEdge, 0); 4982cacheBeforeSize = Math.Max(cacheBeforeSize - sizeBeforeStartViewportEdge, 0); 4986cacheBeforeSize = Math.Max(cacheBeforeSize - Math.Floor(logicalSize.Width * sizeBeforeStartViewportEdge / pixelSize.Width), 0); 5013viewport.Width = Math.Max(0, parentViewport.Width - pixelSize.Width); 5028cacheAfterSize = Math.Max(cacheAfterSize - sizeAfterEndViewportEdge, 0); 5032cacheAfterSize = Math.Max(cacheAfterSize - Math.Floor(logicalSize.Width * sizeAfterEndViewportEdge / pixelSize.Width), 0); 5044cacheAfterSize = Math.Max(cacheAfterSize - pixelSize.Width, 0); 5048cacheAfterSize = Math.Max(cacheAfterSize - logicalSize.Width, 0); 5077viewport.Height = Math.Max(viewport.Height - sizeAfterStartViewportEdge, 0); 5081cacheBeforeSize = Math.Max(cacheBeforeSize - sizeBeforeStartViewportEdge, 0); 5085cacheBeforeSize = Math.Max(cacheBeforeSize - Math.Floor(logicalSize.Height * sizeBeforeStartViewportEdge / pixelSize.Height), 0); 5112viewport.Height = Math.Max(0, parentViewport.Height - pixelSize.Height); 5127cacheAfterSize = Math.Max(cacheAfterSize - sizeAfterEndViewportEdge, 0); 5131cacheAfterSize = Math.Max(cacheAfterSize - Math.Floor(logicalSize.Height * sizeAfterEndViewportEdge / pixelSize.Height), 0); 5143cacheAfterSize = Math.Max(cacheAfterSize - pixelSize.Height, 0); 5147cacheAfterSize = Math.Max(cacheAfterSize - logicalSize.Height, 0); 5212cacheBeforeSize = Math.Max(0, cacheBeforeSize - parentViewport.X); 5217viewport.Width = Math.Max(0, viewport.Width + viewport.X); 5237cacheBeforeSize = Math.Max(0, cacheBeforeSize - inset.Right); 5241cacheBeforeSize = Math.Max(0, cacheBeforeSize - 1); 5256viewport.Width = Math.Max(0, viewport.Width - inset.Left); 5267cacheAfterSize = Math.Max(0, cacheAfterSize - (inset.Left - viewport.Width)); 5284cacheAfterSize = Math.Max(0, cacheAfterSize - inset.Left); 5288cacheAfterSize = Math.Max(0, cacheAfterSize - 1); 5315cacheBeforeSize = Math.Max(0, cacheBeforeSize - parentViewport.Y); 5320viewport.Height = Math.Max(0, viewport.Height + viewport.Y); 5340cacheBeforeSize = Math.Max(0, cacheBeforeSize - inset.Bottom); 5344cacheBeforeSize = Math.Max(0, cacheBeforeSize - 1); 5359viewport.Height = Math.Max(0, viewport.Height - inset.Top); 5370cacheAfterSize = Math.Max(0, cacheAfterSize - (inset.Top - viewport.Height)); 5387cacheAfterSize = Math.Max(0, cacheAfterSize - inset.Top); 5391cacheAfterSize = Math.Max(0, cacheAfterSize - 1); 5447double spanBeforeViewport = Math.Max(isHorizontal ? viewport.X : viewport.Y, 0.0); 5459firstItemInViewportIndex = (int)Math.Floor(spanBeforeViewport / childSize); 6414double eps = (Math.Abs(value1) + Math.Abs(value2)) * Tolerance; 6595childViewport.X = Math.Min(childViewport.X, 0) - 6598childViewport.Width = Math.Max(childViewport.Width - stackPixelSizeInViewport.Width, 0.0); 6603childViewport.Width = Math.Max(childViewport.Width - stackPixelSizeInViewport.Width, 0.0); 6611Math.Max(parentCacheSize.CacheBeforeViewport - stackLogicalSizeInCacheBeforeViewport.Width, 0.0), 6614Math.Max(parentCacheSize.CacheAfterViewport - stackLogicalSizeInCacheAfterViewport.Width, 0.0)); 6622Math.Max(parentCacheSize.CacheBeforeViewport - stackPixelSizeInCacheBeforeViewport.Width, 0.0), 6625Math.Max(parentCacheSize.CacheAfterViewport - stackPixelSizeInCacheAfterViewport.Width, 0.0)); 6640childViewport.Y = Math.Min(childViewport.Y, 0) - 6644childViewport.Height = Math.Max(childViewport.Height - stackPixelSizeInViewport.Height, 0.0); 6649childViewport.Height = Math.Max(childViewport.Height - stackPixelSizeInViewport.Height, 0.0); 6657Math.Max(parentCacheSize.CacheBeforeViewport - stackLogicalSizeInCacheBeforeViewport.Height, 0.0), 6660Math.Max(parentCacheSize.CacheAfterViewport - stackLogicalSizeInCacheAfterViewport.Height, 0.0)); 6668Math.Max(parentCacheSize.CacheBeforeViewport - stackPixelSizeInCacheBeforeViewport.Height, 0.0), 6671Math.Max(parentCacheSize.CacheAfterViewport - stackPixelSizeInCacheAfterViewport.Height, 0.0)); 6774childLogicalSize.Width = Math.Max(itemDesiredSizes.LogicalSize.Width, logicalHeaderSize.Width); 6779childLogicalSize.Height = Math.Max(itemDesiredSizes.LogicalSize.Height, logicalHeaderSize.Height); 6978Size frontPixelSize = isHorizontal ? new Size(Math.Max(inset.Left,0), childDesiredSize.Height) 6979: new Size(childDesiredSize.Width, Math.Max(inset.Top, 0)); 6992Size backPixelSize = isHorizontal ? new Size(Math.Max(inset.Right,0), childDesiredSize.Height) 6993: new Size(childDesiredSize.Width, Math.Max(inset.Bottom,0)); 7006adjustedChildViewport.Width = Math.Max(0, adjustedChildViewport.Width - childPixelSizeInViewport.Width); 7012adjustedChildViewport.Height = Math.Max(0, adjustedChildViewport.Height - childPixelSizeInViewport.Height); 7097pixelSizeBeforeViewport = DoubleUtil.LessThan(childViewport.X, childPixelSize.Width) ? Math.Max(childViewport.X, 0.0) : childPixelSize.Width; 7098pixelSizeInViewport = Math.Min(childViewport.Width, childPixelSize.Width - pixelSizeBeforeViewport); 7099pixelSizeAfterViewport = Math.Max(childPixelSize.Width - pixelSizeInViewport - pixelSizeBeforeViewport, 0.0); // Please note that due to rounding errors this subtraction can lead to negative values. Hence the Math.Max call 7144logicalSizeBeforeViewport = Math.Floor(childLogicalSize.Width * pixelSizeBeforeViewport / childPixelSize.Width); 7145logicalSizeAfterViewport = Math.Floor(childLogicalSize.Width * pixelSizeAfterViewport / childPixelSize.Width); 7153double childPixelHeightInViewport = Math.Min(childViewport.Height, childPixelSize.Height - Math.Max(childViewport.Y, 0.0)); 7156childPixelSizeInViewport.Height = Math.Max(childPixelSizeInViewport.Height, childPixelHeightInViewport); 7158childPixelSizeInCacheBeforeViewport.Height = Math.Max(childPixelSizeInCacheBeforeViewport.Height, childPixelHeightInViewport); 7160childPixelSizeInCacheAfterViewport.Height = Math.Max(childPixelSizeInCacheAfterViewport.Height, childPixelHeightInViewport); 7163childLogicalSizeInViewport.Height = Math.Max(childLogicalSizeInViewport.Height, childLogicalSize.Height); 7165childLogicalSizeInCacheBeforeViewport.Height = Math.Max(childLogicalSizeInCacheBeforeViewport.Height, childLogicalSize.Height); 7167childLogicalSizeInCacheAfterViewport.Height = Math.Max(childLogicalSizeInCacheAfterViewport.Height, childLogicalSize.Height); 7189pixelSizeBeforeViewport = DoubleUtil.LessThan(childViewport.Y, childPixelSize.Height) ? Math.Max(childViewport.Y, 0.0) : childPixelSize.Height; 7190pixelSizeInViewport = Math.Min(childViewport.Height, childPixelSize.Height - pixelSizeBeforeViewport); 7191pixelSizeAfterViewport = Math.Max(childPixelSize.Height - pixelSizeInViewport - pixelSizeBeforeViewport, 0.0); // Please note that due to rounding errors this subtraction can lead to negative values. Hence the Math.Max call 7236logicalSizeBeforeViewport = Math.Floor(childLogicalSize.Height * pixelSizeBeforeViewport / childPixelSize.Height); 7237logicalSizeAfterViewport = Math.Floor(childLogicalSize.Height * pixelSizeAfterViewport / childPixelSize.Height); 7245double childPixelWidthInViewport = Math.Min(childViewport.Width, childPixelSize.Width - Math.Max(childViewport.X, 0.0)); 7248childPixelSizeInViewport.Width = Math.Max(childPixelSizeInViewport.Width, childPixelWidthInViewport); 7250childPixelSizeInCacheBeforeViewport.Width = Math.Max(childPixelSizeInCacheBeforeViewport.Width, childPixelWidthInViewport); 7252childPixelSizeInCacheAfterViewport.Width = Math.Max(childPixelSizeInCacheAfterViewport.Width, childPixelWidthInViewport); 7255childLogicalSizeInViewport.Width = Math.Max(childLogicalSizeInViewport.Width, childLogicalSize.Width); 7257childLogicalSizeInCacheBeforeViewport.Width = Math.Max(childLogicalSizeInCacheBeforeViewport.Width, childLogicalSize.Width); 7259childLogicalSizeInCacheAfterViewport.Width = Math.Max(childLogicalSizeInCacheAfterViewport.Width, childLogicalSize.Width); 7302sz1.Height = Math.Max(sz1.Height, sz2.Height); 7307sz1.Width = Math.Max(sz1.Width, sz2.Width); 7357childSize = new Size(Math.Max(headerDesiredSizes.PixelSize.Width, itemDesiredSizes.PixelSize.Width), 7362childSize = new Size(Math.Max(headerDesiredSizes.LogicalSize.Width, itemDesiredSizes.LogicalSize.Width), 7446uniformOrAverageContainerSize = Math.Round(sumOfContainerSizes / numContainerSizes); 7530Math.Max(1, itemDesiredSizes.LogicalSize.Height)) 7531: new Size(Math.Max(1, itemDesiredSizes.LogicalSize.Width), 7668uniformOrAverageContainerSize = Math.Round(sumOfContainerSizes / numContainerSizes); 8327rcChild.Height = Math.Max(arrangeLength, childDesiredSize.Height); 8352previousChildSize.Width = Math.Max(previousChildSize.Width, pixelHeaderSize.Width); 8359rcChild.Width = Math.Max(arrangeLength, childDesiredSize.Width); 8384previousChildSize.Height = Math.Max(previousChildSize.Height, pixelHeaderSize.Height); 8414rcChild.Height = Math.Max(arrangeLength, childDesiredSize.Height); 8420rcChild.Width = Math.Max(arrangeLength, childDesiredSize.Width); 8458rcChild.Height = Math.Max(arrangeLength, childDesiredSize.Height); 8511rcChild.Width = Math.Max(arrangeLength, childDesiredSize.Width); 9390return Math.Max(0, _firstItemInExtendedViewportIndex); 9398return Math.Min(ItemCount, _firstItemInExtendedViewportIndex + _actualItemsInExtendedViewportCount); 9520_scrollData._maxDesiredSize.Height = Math.Max(_scrollData._maxDesiredSize.Height, stackPixelSize.Height); 9547_scrollData._maxDesiredSize.Width = Math.Max(_scrollData._maxDesiredSize.Width, stackPixelSize.Width); 9573Math.Min(stackPixelSize.Width, constraint.Width) : constraint.Width; 9578Math.Min(stackPixelSize.Height, constraint.Height) : constraint.Height; 9847double proposedViewportSize = Math.Floor(viewport.Width / approxSizeOfLogicalUnit); 9940if (!LayoutDoubleUtil.AreClose(Math.Floor(computedViewportOffset.X)/extentSize.Width, Math.Floor(_scrollData._offset.X)/_scrollData._extent.Width)) 9943viewportOffset.X = Math.Floor((extentSize.Width * Math.Floor(_scrollData._offset.X)) / _scrollData._extent.Width); 10064double proposedViewportSize = Math.Floor(viewport.Height / approxSizeOfLogicalUnit); 10157if (!LayoutDoubleUtil.AreClose(Math.Floor(computedViewportOffset.Y)/extentSize.Height, Math.Floor(_scrollData._offset.Y)/_scrollData._extent.Height)) 10160viewportOffset.Y = Math.Floor((extentSize.Height * Math.Floor(_scrollData._offset.Y)) / _scrollData._extent.Height); 10372_scrollData._maxDesiredSize.Height = Math.Max(_scrollData._maxDesiredSize.Height, stackPixelSize.Height); 10399_scrollData._maxDesiredSize.Width = Math.Max(_scrollData._maxDesiredSize.Width, stackPixelSize.Width); 10425Math.Min(stackPixelSize.Width, constraint.Width) : constraint.Width; 10430Math.Min(stackPixelSize.Height, constraint.Height) : constraint.Height; 10526lastPageSafeOffset = lastPageSafeOffset.HasValue ? Math.Min(computedViewportOffset.X, (double)lastPageSafeOffset) : computedViewportOffset.X; 10529double proposedViewportSize = Math.Floor(viewport.Width / approxSizeOfLogicalUnit); 10611if (!LayoutDoubleUtil.AreClose(Math.Floor(computedViewportOffset.X)/extentSize.Width, Math.Floor(_scrollData._offset.X)/_scrollData._extent.Width)) 10614viewportOffset.X = Math.Floor((extentSize.Width * Math.Floor(_scrollData._offset.X)) / _scrollData._extent.Width); 10657lastPageSafeOffset = lastPageSafeOffset.HasValue ? Math.Min(computedViewportOffset.Y, (double)lastPageSafeOffset) : computedViewportOffset.Y; 10660double proposedViewportSize = Math.Floor(viewport.Height / approxSizeOfLogicalUnit); 10742if (!LayoutDoubleUtil.AreClose(Math.Floor(computedViewportOffset.Y)/extentSize.Height, Math.Floor(_scrollData._offset.Y)/_scrollData._extent.Height)) 10745viewportOffset.Y = Math.Floor((extentSize.Height * Math.Floor(_scrollData._offset.Y)) / _scrollData._extent.Height); 11053double left = Math.Max(targetRectOffset, minPhysicalOffset); 11054targetRectSize = Math.Max(Math.Min(targetRectSize + targetRectOffset, minPhysicalOffset + viewportSize) - left, 0); 11101else if (childIndex > firstChildInView + Math.Max(viewportSize - 1, 0)) 11147maxChildLength = Math.Max(maxChildLength, childSize.Height); 11151maxChildLength = Math.Max(maxChildLength, childSize.Width); 11740else if (DoubleUtil.GreaterThan(Math.Abs(newOffset - oldOffset), _viewport.Width)) 11756else if (DoubleUtil.GreaterThan(Math.Abs(newOffset - oldOffset), _viewport.Height))
src\Framework\System\Windows\Controls\WrapPanel.cs (5)
255panelSize.U = Math.Max(curLineSize.U, panelSize.U); 261panelSize.U = Math.Max(sz.U, panelSize.U); 269curLineSize.V = Math.Max(sz.V, curLineSize.V); 274panelSize.U = Math.Max(curLineSize.U, panelSize.U); 329curLineSize.V = Math.Max(sz.V, curLineSize.V);
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\CaretElement.cs (6)
413deltaToScroll = Math.Abs(targetPoint.Y); 414scroller.ScrollToVerticalOffset(Math.Max(0, scroller.VerticalOffset - deltaToScroll - scrollerHeight / 4)); 420scroller.ScrollToVerticalOffset(Math.Min(scroller.ExtentHeight, scroller.VerticalOffset + deltaToScroll + scrollerHeight / 4)); 430deltaToScroll = Math.Abs(targetPoint.X); 431scroller.ScrollToHorizontalOffset(Math.Max(0, scroller.HorizontalOffset - deltaToScroll - scrollerWidth / 4)); 437scroller.ScrollToHorizontalOffset(Math.Min(scroller.ExtentWidth, scroller.HorizontalOffset + deltaToScroll + scrollerWidth / 4));
src\Framework\System\Windows\Documents\DocumentSequenceTextPointer.cs (1)
1056distance = Math.Abs(distance);
src\Framework\System\Windows\Documents\Figure.cs (1)
300double maxOffset = Math.Min(1000000, PTS.MaxPageSize);
src\Framework\System\Windows\Documents\FixedPageStructure.cs (4)
142line = Math.Max(0, Math.Min(line, _lineResults.Length - 1)); 167double absVerDistance = Math.Max(0, (pt.Y > lineResult.LayoutBox.Y) ? (pt.Y - lineResult.LayoutBox.Bottom) : (lineResult.LayoutBox.Y - pt.Y)); 168double absHorDistance = Math.Max(0, (pt.X > lineResult.LayoutBox.X) ? (pt.X - lineResult.LayoutBox.Right) : (lineResult.LayoutBox.X - pt.X));
src\Framework\System\Windows\Documents\FixedSOMPageConstructor.cs (5)
568if (Math.Abs(textRunRect.Left - fixedBlockRect.Left) <= textRun.DefaultCharWidth || 569Math.Abs(textRunRect.Right - fixedBlockRect.Right) <= textRun.DefaultCharWidth) 1040if (Math.Abs(t.BoundingRect.Left - row.BoundingRect.Left) < fudge && 1041Math.Abs(t.BoundingRect.Right - row.BoundingRect.Right) < fudge && 1042Math.Abs(t.BoundingRect.Bottom - row.BoundingRect.Top) < fudge)
src\Framework\System\Windows\Documents\FixedSOMSemanticBox.cs (1)
223double overlap = Math.Abs(thisRectRefX - otherRectRefX);
src\Framework\System\Windows\Documents\FixedSOMTextRun.cs (2)
147double yScale = Math.Sqrt(mat.M12*mat.M12 + mat.M22*mat.M22); 148double xScale = Math.Sqrt(mat.M11 * mat.M11 + mat.M21 * mat.M21);
src\Framework\System\Windows\Documents\FixedTextBuilder.cs (2)
892double xDistance = Math.Abs(currentPt.X - prevPt.X); 893double maxHeight = Math.Max(box1.Height, box2.Height);
src\Framework\System\Windows\Documents\FixedTextView.cs (2)
860double horizontalDistance = Math.Max(0, (transformedPt.X > alignmentRect.X) ? (transformedPt.X - alignmentRect.Right) : (alignmentRect.X - transformedPt.X)); 861double verticalDistance = Math.Max(0, (transformedPt.Y > alignmentRect.Y) ? (transformedPt.Y - alignmentRect.Bottom) : (alignmentRect.Y - transformedPt.Y));
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 (2)
225maxLength = Math.Min(maxLength, remainingLength); 322distance = Math.Abs(distance);
src\Framework\System\Windows\Documents\Glyphs.cs (3)
171Math.Max(0, designRect.Right), 172Math.Max(0, designRect.Bottom) 552estimatedNumberOfGlyphs = Math.Max(estimatedNumberOfGlyphs, glyphsProp.Length / 5);
src\Framework\System\Windows\Documents\ImmComposition.cs (5)
770milPointTopLeft = new Point(Math.Min(rectStart.Left, rectEnd.Left), Math.Min(rectStart.Top, rectEnd.Top)); 771milPointBottomRight = new Point(Math.Max(rectStart.Left, rectEnd.Left), Math.Max(rectStart.Bottom, rectEnd.Bottom)); 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\RangeContentEnumerator.cs (1)
316newBuffer = new char[Math.Max(2*_buffer.Length, size)];
src\Framework\System\Windows\Documents\Speller.cs (7)
1072int timeOutOffset = Math.Min(data.TextMap.ContentEndOffset, sentenceEndOffset); 1261sTextRange = (SpellerInteropBase.ITextRange)segments[Math.Max(i, 0)]; 1264contextOffset = Math.Min(sTextRange.Start, contentOffset); 1269sTextRange = (SpellerInteropBase.ITextRange)segments[Math.Min(i, segments.Count-1)]; 1272contextOffset = Math.Max(sTextRange.Start + sTextRange.Length, contentOffset); 1821runCount = Math.Min(runCount, _text.Length - _textLength); 1822runCount = Math.Min(runCount, position.GetOffsetToPosition(contextEnd));
src\Framework\System\Windows\Documents\Table.cs (2)
215get { return Math.Max(CellSpacing, 0); } 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\TableRowGroup.cs (1)
237_columnCount = Math.Max(_columnCount, Rows[i].ColumnCount);
src\Framework\System\Windows\Documents\TextContainerChangedEventArgs.cs (3)
244change.RemovedLength += Math.Max(0, length - change.AddedLength); 245change.AddedLength = Math.Max(0, change.AddedLength - length); 408int cancelledCount = Math.Min(overlap, newChange.RemovedLength);
src\Framework\System\windows\Documents\TextEditor.cs (2)
539_mouseSelectionState.Timer.Interval = TimeSpan.FromMilliseconds(Math.Max(SystemParameters.MenuShowDelay, 200)); 1218int extraCharsAllowed = Math.Max(0, this.MaxLength - currentLength);
src\Framework\System\Windows\Documents\TextElement.cs (1)
1657double maxFontSize = Math.Min(1000000, PTS.MaxFontSize);
src\Framework\System\Windows\Documents\TextFindEngine.cs (4)
221int textBlockLength = Math.Max(TextBlockLength, findPattern.Length * 2 * 2); 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 (4)
2350new DoublePropertyRange (Paragraph.TextIndentProperty, -Math.Min(1000000, PTS.MaxPageSize), Math.Min(1000000, PTS.MaxPageSize)) 2372double retValue = Math.Max(_lowerBound, value); 2373retValue = Math.Min(retValue, _upperBound);
src\Framework\System\Windows\Documents\TextRangeEditTables.cs (10)
338int firstRowIndex = Math.Min(anchorCell.Row.Index, movingCell.Row.Index); 339int lastRowIndex = Math.Max(anchorCell.Row.Index + anchorCell.RowSpan - 1, movingCell.Row.Index + movingCell.RowSpan - 1); 340int firstColumnIndex = Math.Min(anchorCell.ColumnIndex, movingCell.ColumnIndex); 341int lastColumnIndex = Math.Max(anchorCell.ColumnIndex + anchorCell.ColumnSpan - 1, movingCell.ColumnIndex + movingCell.ColumnSpan - 1); 1431int cCols = Math.Abs(columnCount); 1713_dxr = Math.Max(_dxr, 0.0); 1736xPosAdorner = Math.Max(xPosAdorner, _columnRect.Left - this.LeftDragMax); 1737xPosAdorner = Math.Min(xPosAdorner, _columnRect.Right + this.RightDragMax); 1748dx = Math.Max(dx, - this.LeftDragMax); 1749dx = Math.Min(dx, this.RightDragMax);
src\Framework\System\windows\Documents\TextSelection.cs (2)
2259caretRectangle.Y += caretRectangle.Height - Math.Abs(bottom.Y - top.Y); 2260caretRectangle.Height = Math.Abs(bottom.Y - top.Y);
src\Framework\System\Windows\Documents\TextStore.cs (12)
869milPointTopLeft = new Point(Math.Min(rectPrev.Left, rectCur.Left), Math.Min(rectPrev.Top, rectCur.Top)); 870milPointBottomRight = new Point(Math.Max(rectPrev.Left, rectCur.Left), Math.Max(rectPrev.Bottom, rectCur.Bottom)); 2325runCount = TextPointerBase.GetTextWithLimit(navigator, LogicalDirection.Forward, text, charsCopied, Math.Min(cchReq, text.Length - charsCopied), limit); 2755double radSin = Math.Asin(tf.M12 / Math.Sqrt((tf.M11 * tf.M11) + (tf.M12 * tf.M12))); 2756double radCos = Math.Acos(tf.M11 / Math.Sqrt((tf.M11 * tf.M11) + (tf.M12 * tf.M12))); 2758double angleCos = Math.Round((radCos * 180) / Math.PI, 0); 3693int extraCharsAllowed = Math.Max(0, this.TextEditor.MaxLength - currentLength);
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\Documents\XamlToRtfWriter.cs (2)
1734tableWidth = Math.Max(tableWidth, lastCellX); 2899formatState.FontSize = (long)Math.Round(fs);
src\Framework\System\Windows\FigureLength.cs (1)
104double maxPixel = Math.Min(1000000, PTS.MaxPageSize);
src\Framework\System\Windows\FrameworkElement.cs (59)
4065maxHeight = Math.Max(Math.Min(height, maxHeight), minHeight); 4068minHeight = Math.Max(Math.Min(maxHeight, height), minHeight); 4075maxWidth = Math.Max(Math.Min(width, maxWidth), minWidth); 4078minWidth = Math.Max(Math.Min(maxWidth, width), minWidth); 4180Double yCoverD = (yConstrInfinite ? Double.PositiveInfinity : Math.Abs(yConstr/d)); 4181Double xCoverA = (xConstrInfinite ? Double.PositiveInfinity : Math.Abs(xConstr/a)); 4201h = Math.Min(0.5*Math.Abs(xConstr/c), yCoverD); 4212w = Math.Min( 0.5*Math.Abs(yConstr/b), xCoverA); 4220Double yCoverB = Math.Abs(yConstr/b); 4221Double xCoverC = Math.Abs(xConstr/c); 4241h = Math.Min(0.5*Math.Abs(yConstr/d), xCoverC); 4252w = Math.Min( 0.5*Math.Abs(xConstr/a), yCoverB); 4258Double xCoverA = Math.Abs(xConstr / a); // w-intercept of x-constraint line. 4259Double xCoverC = Math.Abs(xConstr / c); // h-intercept of x-constraint line. 4261Double yCoverB = Math.Abs(yConstr / b); // w-intercept of y-constraint line. 4262Double yCoverD = Math.Abs(yConstr / d); // h-intercept of y-constraint line. 4269w = Math.Min(yCoverB, xCoverA) * 0.5; 4270h = Math.Min(xCoverC, yCoverD) * 0.5; 4287Double expandFactor = Math.Min(xConstr / childBoundsTr.Width, 4343Math.Max(availableSize.Width - marginWidth, 0), 4344Math.Max(availableSize.Height - marginHeight, 0)); 4392frameworkAvailableSize.Width = Math.Max(mm.minWidth, Math.Min(frameworkAvailableSize.Width, mm.maxWidth)); 4393frameworkAvailableSize.Height = Math.Max(mm.minHeight, Math.Min(frameworkAvailableSize.Height, mm.maxHeight)); 4406Math.Max(desiredSize.Width, mm.minWidth), 4407Math.Max(desiredSize.Height, mm.minHeight)); 4473ltd.TransformedUnroundedDS = new Size(Math.Max(0, clippedDesiredWidth), Math.Max(0, clippedDesiredHeight)); 4520return new Size(Math.Max(0, clippedDesiredWidth), Math.Max(0, clippedDesiredHeight)); 4582arrangeSize.Width = Math.Max(0, arrangeSize.Width - marginWidth); 4583arrangeSize.Height = Math.Max(0, arrangeSize.Height - marginHeight); 4591transformedUnroundedDS.Width = Math.Max(0, transformedUnroundedDS.Width - marginWidth); 4592transformedUnroundedDS.Height = Math.Max(0, transformedUnroundedDS.Height- marginHeight); 4601unclippedDesiredSize = new Size(Math.Max(0, this.DesiredSize.Width - marginWidth), 4602Math.Max(0, this.DesiredSize.Height - marginHeight)); 4607unclippedDesiredSize.Width = Math.Max(transformedUnroundedDS.Width, unclippedDesiredSize.Width); 4608unclippedDesiredSize.Height = Math.Max(transformedUnroundedDS.Height, unclippedDesiredSize.Height); 4695double effectiveMaxWidth = Math.Max(unclippedDesiredSize.Width, mm.maxWidth); 4702double effectiveMaxHeight = Math.Max(unclippedDesiredSize.Height, mm.maxHeight); 4733Size clippedInkSize = new Size(Math.Min(innerInkSize.Width, mm.maxWidth), 4734Math.Min(innerInkSize.Height, mm.maxHeight)); 4766Size clientSize = new Size(Math.Max(0, finalRect.Width - marginWidth), 4767Math.Max(0, finalRect.Height - marginHeight)); 4916inkSize.Width = Math.Min(inkSize.Width, mm.maxWidth); 4917inkSize.Height = Math.Min(inkSize.Height, mm.maxHeight); 4934Size clippingSize = new Size(Math.Max(0, layoutSlotSize.Width - marginWidth), 4935Math.Max(0, layoutSlotSize.Height - marginHeight)); 5247inkSize.Width = Math.Min(inkSize.Width, mm.maxWidth); 5248inkSize.Height = Math.Min(inkSize.Height, mm.maxHeight);
src\Framework\System\Windows\Input\KeyboardNavigation.cs (9)
2605rect.Height = Math.Min(Math.Max(before, 0.0d), rect.Height); 2609double height = Math.Min(Math.Max(after, 0.0d), rect.Height); 2625return Math.Sqrt(deltaX * deltaX + deltaY * deltaY); 2756startRange = Math.Min(startRange, _horizontalBaseline); 2757endRange = Math.Max(endRange, _horizontalBaseline); 2778startRange = Math.Min(startRange, _verticalBaseline); 2779endRange = Math.Max(endRange, _verticalBaseline);
src\Framework\System\Windows\Interop\HwndHost.cs (2)
857desiredSize.Width = Math.Min(_desiredSize.Width, constraint.Width); 858desiredSize.Height = Math.Min(_desiredSize.Height, constraint.Height);
src\Framework\System\Windows\Markup\Baml2006\SharedStream.cs (2)
158long end = Math.Min(_position + 1, _length); 192long end = Math.Min(_position + count, _length);
src\Framework\System\Windows\Markup\BamlRecordReader.cs (1)
1782defKeyList = new ArrayList(Math.Max (5, (int)(bamlRecord.ContentSize/400)));
src\Framework\System\Windows\Shapes\Ellipse.cs (4)
101width = Math.Min(width, height); 105width = Math.Max(width, height); 128Math.Max(0, finalSize.Width - penThickness), // Width 129Math.Max(0, finalSize.Height - penThickness)); // Height
src\Framework\System\Windows\Shapes\Rectangle.cs (4)
153width = Math.Min(width, height); 157width = Math.Max(width, height); 181Math.Max(0, finalSize.Width - penThickness), // Width 182Math.Max(0, finalSize.Height - penThickness)); // Height
src\Framework\System\Windows\Shapes\Shape.cs (6)
474return Math.Abs(StrokeThickness); 491thickness = Math.Abs(strokeThickness); 592xScale = Math.Max(availableSize.Width - strokeThickness, 0); 593yScale = Math.Max(availableSize.Height - strokeThickness, 0); 720return new Size(Math.Max(bounds.Right, 0), 721Math.Max(bounds.Bottom, 0));
src\Framework\System\Windows\Shell\TaskbarItemInfo.cs (2)
103progressValue = Math.Max(progressValue, 0); 104progressValue = Math.Min(1, progressValue);
src\Framework\System\Windows\Shell\WindowChromeWorker.cs (23)
1226double shortestDimension = Math.Min(windowSize.Width, windowSize.Height); 1229topLeftRadius = Math.Min(topLeftRadius, shortestDimension / 2); 1245topRightRadius = Math.Min(topRightRadius, shortestDimension / 2); 1253bottomLeftRadius = Math.Min(bottomLeftRadius, shortestDimension / 2); 1261bottomRightRadius = Math.Min(bottomRightRadius, shortestDimension / 2); 1292(int)Math.Floor(region.Left), 1293(int)Math.Floor(region.Top), 1294(int)Math.Ceiling(region.Right), 1295(int)Math.Ceiling(region.Bottom)); 1300(int)Math.Floor(region.Left), 1301(int)Math.Floor(region.Top), 1302(int)Math.Ceiling(region.Right) + 1, 1303(int)Math.Ceiling(region.Bottom) + 1, 1304(int)Math.Ceiling(radius), 1305(int)Math.Ceiling(radius)); 1401deviceGlassThickness.Top = Math.Max(0, deviceGlassThickness.Top); 1406deviceGlassThickness.Left = Math.Max(0, deviceGlassThickness.Left); 1411deviceGlassThickness.Bottom = Math.Max(0, deviceGlassThickness.Bottom); 1416deviceGlassThickness.Right = Math.Max(0, deviceGlassThickness.Right); 1423cxLeftWidth = (int)Math.Ceiling(deviceGlassThickness.Left), 1424cxRightWidth = (int)Math.Ceiling(deviceGlassThickness.Right), 1425cyTopHeight = (int)Math.Ceiling(deviceGlassThickness.Top), 1426cyBottomHeight = (int)Math.Ceiling(deviceGlassThickness.Bottom),
src\Framework\System\Windows\Standard\NativeMethods.cs (4)
2146Left = Math.Min(rect1.Left, rect2.Left), 2147Top = Math.Min(rect1.Top, rect2.Top), 2148Right = Math.Max(rect1.Right, rect2.Right), 2149Bottom = Math.Max(rect1.Bottom, rect2.Bottom),
src\Framework\System\Windows\SystemFonts.cs (1)
1008return (double)(Math.Abs(height) * 96 / dpi);
src\Framework\System\Windows\Window.cs (30)
1877frameworkAvailableSize.Width = Math.Max(mm.minWidth, Math.Min(frameworkAvailableSize.Width, mm.maxWidth)); 1878frameworkAvailableSize.Height = Math.Max(mm.minHeight, Math.Min(frameworkAvailableSize.Height, mm.maxHeight)); 1885Math.Max(desiredSize.Width, mm.minWidth), 1886Math.Max(desiredSize.Height, mm.minHeight)); 1907arrangeBounds.Width = Math.Max(mm.minWidth, Math.Min(arrangeBounds.Width, mm.maxWidth)); 1908arrangeBounds.Height = Math.Max(mm.minHeight, Math.Min(arrangeBounds.Height, mm.maxHeight)); 1942childArrangeBounds.Width = Math.Max(0.0, arrangeBounds.Width - frameSize.Width); 1943childArrangeBounds.Height = Math.Max(0.0, arrangeBounds.Height - frameSize.Height); 3494childConstraint.Width = ((constraint.Width == Double.PositiveInfinity) ? Double.PositiveInfinity : Math.Max(0.0, (constraint.Width - frameSize.Width))); 3495childConstraint.Height = ((constraint.Height == Double.PositiveInfinity) ? Double.PositiveInfinity : Math.Max(0.0, (constraint.Height - frameSize.Height))); 3539maxWidthDeviceUnits = Math.Max(_trackMaxWidthDeviceUnits, _windowMaxWidthDeviceUnits); 3540maxHeightDeviceUnits = Math.Max(_trackMaxHeightDeviceUnits, _windowMaxHeightDeviceUnits); 3549mm.minWidth = Math.Max(this.MinWidth, minSizeLogicalUnits.X); 3554mm.maxWidth = Math.Min(MinWidth, maxSizeLogicalUnits.X); 3560mm.maxWidth = Math.Min(MaxWidth, maxSizeLogicalUnits.X); 3571mm.minHeight = Math.Max(this.MinHeight, minSizeLogicalUnits.Y); 3576mm.maxHeight = Math.Min(this.MinHeight, maxSizeLogicalUnits.Y); 3582mm.maxHeight = Math.Min(MaxHeight, maxSizeLogicalUnits.Y); 3958leftDeviceUnits = Math.Min(leftDeviceUnits, workAreaRectDeviceUnits.right - currentSizeDeviceUnits.Width); 3959leftDeviceUnits = Math.Max(leftDeviceUnits, workAreaRectDeviceUnits.left); 3960topDeviceUnits = Math.Min(topDeviceUnits, workAreaRectDeviceUnits.bottom - currentSizeDeviceUnits.Height); 3961topDeviceUnits = Math.Max(topDeviceUnits, workAreaRectDeviceUnits.top); 4896_windowMaxWidthDeviceUnits = Math.Max(_windowMaxWidthDeviceUnits, windowSize.X); 4897_windowMaxHeightDeviceUnits = Math.Max(_windowMaxHeightDeviceUnits, windowSize.Y); 8135return new Size(Math.Max(0.0, pt.X), Math.Max(0.0, pt.Y));
PresentationFramework.Aero (21)
Microsoft\Windows\Themes\ButtonChrome.cs (4)
440desired = new Size(Math.Min(4.0, availableSize.Width), Math.Min(4.0, availableSize.Height)); 458childArrangeRect.Width = Math.Max(0d, finalSize.Width - 4.0); 459childArrangeRect.Height = Math.Max(0d, finalSize.Height - 4.0);
Microsoft\Windows\Themes\ListBoxChrome.cs (2)
261desired = new Size(Math.Min(borderX, availableSize.Width), Math.Min(borderY, availableSize.Height));
Microsoft\Windows\Themes\ScrollChrome.cs (5)
477bounds.Width = Math.Max(0.0, bounds.Width - 1.0); 548double height = Math.Min(7.0, bounds.Height); 571double width = Math.Min(7.0, bounds.Width); 735double widthScale = Math.Min(glyphWidth, bounds.Width) / glyphWidth; 736double heightScale = Math.Min(glyphHeight, bounds.Height) / glyphHeight;
parent\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (5)
195childWidth = Math.Max(0.0, childWidth - padding.Left - padding.Right); 200childHeight = Math.Max(0.0, childHeight - padding.Top - padding.Bottom); 235double childWidth = Math.Max(0.0, arrangeSize.Width - padding.Left - padding.Right); 236double childHeight = Math.Max(0.0, arrangeSize.Height - padding.Top - padding.Bottom); 302return Math.Max(0.0, d);
parent\Shared\Microsoft\Windows\Themes\SystemDropShadowChrome.cs (5)
121double maxRadius = Math.Min(centerWidth * 0.5, centerHeight * 0.5); 122cornerRadius.TopLeft = Math.Min(cornerRadius.TopLeft, maxRadius); 123cornerRadius.TopRight = Math.Min(cornerRadius.TopRight, maxRadius); 124cornerRadius.BottomLeft = Math.Min(cornerRadius.BottomLeft, maxRadius); 125cornerRadius.BottomRight = Math.Min(cornerRadius.BottomRight, maxRadius);
PresentationFramework.Classic (23)
Microsoft\Windows\Themes\ClassicBorderDecorator.cs (11)
244float min = Math.Min(rgbColor.Red, Math.Min(rgbColor.Green, rgbColor.Blue)); 245float max = Math.Max(rgbColor.Red, Math.Max(rgbColor.Green, rgbColor.Blue)); 277saturation = Math.Max(0.0f, Math.Min(saturation, 1.0f)); 332float hue = (float)((hlsColor.Hue - Math.Floor(hlsColor.Hue)) * 6); 608Math.Max(0.0, rt.Width - thick.Left - thick.Right), 609Math.Max(0.0, rt.Height - thick.Top - thick.Bottom)); 697desired = new Size(Math.Min(borderSize.Width, availableSize.Width), Math.Min(borderSize.Height, availableSize.Height));
parent\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (5)
195childWidth = Math.Max(0.0, childWidth - padding.Left - padding.Right); 200childHeight = Math.Max(0.0, childHeight - padding.Top - padding.Bottom); 235double childWidth = Math.Max(0.0, arrangeSize.Width - padding.Left - padding.Right); 236double childHeight = Math.Max(0.0, arrangeSize.Height - padding.Top - padding.Bottom); 302return Math.Max(0.0, d);
parent\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (2)
101int blocks = (int)Math.Ceiling(width / blockTotal); 176if (!isIndeterminate && remainder > 0.0 && Math.Abs(width - trackWidth) < 1.0e-5)
parent\Shared\Microsoft\Windows\Themes\SystemDropShadowChrome.cs (5)
121double maxRadius = Math.Min(centerWidth * 0.5, centerHeight * 0.5); 122cornerRadius.TopLeft = Math.Min(cornerRadius.TopLeft, maxRadius); 123cornerRadius.TopRight = Math.Min(cornerRadius.TopRight, maxRadius); 124cornerRadius.BottomLeft = Math.Min(cornerRadius.BottomLeft, maxRadius); 125cornerRadius.BottomRight = Math.Min(cornerRadius.BottomRight, maxRadius);
PresentationFramework.Luna (27)
Microsoft\Windows\Themes\ButtonChrome.cs (4)
357desired = new Size(Math.Min(sideThickness2, availableSize.Width), Math.Min(sideThickness2, availableSize.Height)); 375childArrangeRect.Width = Math.Max(0d, finalSize.Width - sideThickness2); 376childArrangeRect.Height = Math.Max(0d, finalSize.Height - sideThickness2);
Microsoft\Windows\Themes\ScrollChrome.cs (5)
316bounds.Width = Math.Max(0.0, bounds.Width - 1.0); 390double height = Math.Min(6.0, bounds.Height); 412double width = Math.Min(6.0, bounds.Width); 594double widthScale = Math.Min(glyphWidth, bounds.Width) / glyphWidth; 595double heightScale = Math.Min(glyphHeight, bounds.Height) / glyphHeight;
parent\Shared\Microsoft\Windows\Themes\BulletChrome.cs (6)
199desired = new Size(Math.Min(11.0 + borderX, availableSize.Width), Math.Min(11.0 + borderY, availableSize.Height)); 222Math.Max(0, bounds.Width - thickness.Left - thickness.Right), 223Math.Max(0, bounds.Height - thickness.Top - thickness.Bottom)); 464Math.Max(0.0, rt.Width - thick.Left - thick.Right), 465Math.Max(0.0, rt.Height - thick.Top - thick.Bottom));
parent\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (5)
195childWidth = Math.Max(0.0, childWidth - padding.Left - padding.Right); 200childHeight = Math.Max(0.0, childHeight - padding.Top - padding.Bottom); 235double childWidth = Math.Max(0.0, arrangeSize.Width - padding.Left - padding.Right); 236double childHeight = Math.Max(0.0, arrangeSize.Height - padding.Top - padding.Bottom); 302return Math.Max(0.0, d);
parent\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (2)
101int blocks = (int)Math.Ceiling(width / blockTotal); 176if (!isIndeterminate && remainder > 0.0 && Math.Abs(width - trackWidth) < 1.0e-5)
parent\Shared\Microsoft\Windows\Themes\SystemDropShadowChrome.cs (5)
121double maxRadius = Math.Min(centerWidth * 0.5, centerHeight * 0.5); 122cornerRadius.TopLeft = Math.Min(cornerRadius.TopLeft, maxRadius); 123cornerRadius.TopRight = Math.Min(cornerRadius.TopRight, maxRadius); 124cornerRadius.BottomLeft = Math.Min(cornerRadius.BottomLeft, maxRadius); 125cornerRadius.BottomRight = Math.Min(cornerRadius.BottomRight, maxRadius);
PresentationFramework.Royale (26)
Microsoft\Windows\Themes\ButtonChrome.cs (4)
315desired = new Size(Math.Min(sideThickness2, availableSize.Width), Math.Min(sideThickness2, availableSize.Height)); 333childArrangeRect.Width = Math.Max(0d, finalSize.Width - sideThickness2); 334childArrangeRect.Height = Math.Max(0d, finalSize.Height - sideThickness2);
Microsoft\Windows\Themes\ScrollChrome.cs (4)
350double height = Math.Min(6.0, bounds.Height); 372double width = Math.Min(6.0, bounds.Width); 554double widthScale = Math.Min(glyphWidth, bounds.Width) / glyphWidth; 555double heightScale = Math.Min(glyphHeight, bounds.Height) / glyphHeight;
parent\Shared\Microsoft\Windows\Themes\BulletChrome.cs (6)
199desired = new Size(Math.Min(11.0 + borderX, availableSize.Width), Math.Min(11.0 + borderY, availableSize.Height)); 222Math.Max(0, bounds.Width - thickness.Left - thickness.Right), 223Math.Max(0, bounds.Height - thickness.Top - thickness.Bottom)); 464Math.Max(0.0, rt.Width - thick.Left - thick.Right), 465Math.Max(0.0, rt.Height - thick.Top - thick.Bottom));
parent\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (5)
195childWidth = Math.Max(0.0, childWidth - padding.Left - padding.Right); 200childHeight = Math.Max(0.0, childHeight - padding.Top - padding.Bottom); 235double childWidth = Math.Max(0.0, arrangeSize.Width - padding.Left - padding.Right); 236double childHeight = Math.Max(0.0, arrangeSize.Height - padding.Top - padding.Bottom); 302return Math.Max(0.0, d);
parent\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (2)
101int blocks = (int)Math.Ceiling(width / blockTotal); 176if (!isIndeterminate && remainder > 0.0 && Math.Abs(width - trackWidth) < 1.0e-5)
parent\Shared\Microsoft\Windows\Themes\SystemDropShadowChrome.cs (5)
121double maxRadius = Math.Min(centerWidth * 0.5, centerHeight * 0.5); 122cornerRadius.TopLeft = Math.Min(cornerRadius.TopLeft, maxRadius); 123cornerRadius.TopRight = Math.Min(cornerRadius.TopRight, maxRadius); 124cornerRadius.BottomLeft = Math.Min(cornerRadius.BottomLeft, maxRadius); 125cornerRadius.BottomRight = Math.Min(cornerRadius.BottomRight, maxRadius);
System (76)
compmod\system\componentmodel\Container.cs (1)
245for (int i = 0; i < Math.Min(siteCount,sites.Length); i++) {
compmod\system\componentmodel\EventDescriptorCollection.cs (1)
207int newSize = Math.Max(sizeNeeded, events.Length * 2);
compmod\system\componentmodel\PropertyDescriptorCollection.cs (1)
231int newSize = Math.Max(sizeNeeded, properties.Length * 2);
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 (4)
750int BytesTransferred = Math.Min(size, m_ReadBufferSize); 1510bytesToRead = (int)Math.Min(m_ReadBytes, (long)size); 1747bytesToRead = (int)Math.Min(m_ReadBytes, (long)size); 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\_TimerThread.cs (2)
144(int) (Math.Min((uint) unchecked(Expiration - now), (uint) Int32.MaxValue)) : 0; 699Math.Min(unchecked((uint) (nextTick - newNow)), (uint) (Int32.MaxValue - c_TickCountResolution)) + c_TickCountResolution :
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\SmtpDateTime.cs (4)
418if (Math.Abs(sanitizedTimeSpan.Ticks) > timeSpanMaxTicks) 442uint hours = (uint)Math.Abs(Math.Floor(span.TotalHours)); 443uint minutes = (uint)Math.Abs(span.Minutes);
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\_AcceptOverlappedAsyncResult.cs (1)
143Logging.Dump(Logging.Sockets, m_ListenSocket, "PostCompletion", pinnedBuffer, (int)Math.Min(size, (long)m_Buffer.Length));
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\webclient.cs (4)
644buffSize = (int)Math.Min((long)DefaultCopyBufferLength, fs.Length); 657buffSize = (int) Math.Min((long) DefaultCopyBufferLength, fs.Length); 2313chunkSize = (int)Math.Min((long)DefaultCopyBufferLength, data.Length); 2512chunkSize = (int)Math.Min((long)DefaultCopyBufferLength, buffer.Length);
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 (2)
348int bytesTransferred = Math.Min(buffer.Count, m_BufferedPayloadReceiveResult.Count); 598return Math.Max(m_ReceiveBufferSize, m_SendBufferSize);
net\System\UriHelper.cs (1)
144short maxSize = (short)Math.Min(end - i, (int)c_MaxUnicodeCharsReallocate-1);
parent\parent\parent\InternalApis\NDP_Common\inc\PinnableBufferCache.cs (2)
297m_restockSize = Math.Max(m_restockSize, m_minBufferCount - m_buffersUnderManagement); 391m_restockSize = Math.Max(newRestockSize, DefaultNumberOfBuffers);
security\system\security\cryptography\bigint.cs (1)
481char[] dec = new char[(int)Math.Ceiling(m_size * 2 * 1.21)];
security\system\security\cryptography\x509\x509chain.cs (1)
383ChainPara.dwUrlRetrievalTimeout = (uint) Math.Floor(timeout.TotalMilliseconds);
services\monitoring\system\diagnosticts\EventLog.cs (1)
1258largestNumber = Math.Max(largestNumber, num);
services\timers\system\timers\Timer.cs (3)
65double roundedInterval = Math.Ceiling(interval); 131int i = (int)Math.Ceiling(interval); 146int i = (int)Math.Ceiling(interval);
sys\system\configuration\ClientSettingsStore.cs (5)
402EnsureQuota(Math.Max(oldLen, newLen)); 436EnsureQuota(Math.Max(oldLen, newLen)); 448EnsureQuota(Math.Max(oldLen, newLen)); 459EnsureQuota(Math.Max(oldLen, newLen)); 483EnsureQuota(Math.Max(oldLen, newLen));
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 (4)
870bytesReadToBuffer = Math.Min(CachedBytesToRead, count); 1079int bytesToRead = Math.Min(count, CachedBytesToRead); 1111currentBytesToExamine = Math.Min(count - totalCharsFound, readLen - readPos - totalBytesExamined); 1476int newLength = Math.Max(CachedBytesToRead + additionalByteLength, inBuffer.Length * 2);
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.Core.Presentation (10)
System\Activities\Core\Presentation\FlowchartDesigner.xaml.cs (2)
2653Double offsetX = Math.Ceiling(-detX / FreeFormPanel.GridSize) * FreeFormPanel.GridSize; 2654Double offsetY = Math.Ceiling(-detY / FreeFormPanel.GridSize) * FreeFormPanel.GridSize;
System\Activities\Core\Presentation\FlowchartResizeGrip.cs (4)
89flowchartDesigner.FlowchartWidth = Math.Min(Math.Max(panel.RequiredWidth, currentPosition.X), flowchartGrid.MaxWidth); 90flowchartDesigner.FlowchartHeight = Math.Min(Math.Max(panel.RequiredHeight, currentPosition.Y), flowchartGrid.MaxHeight);
System\Activities\Core\Presentation\StateContainerResizeGrip.cs (4)
135stateContainerEditor.StateContainerWidth = Math.Min(Math.Max(panel.RequiredWidth, currentPosition.X), stateContainerGrid.MaxWidth); 136stateContainerEditor.StateContainerHeight = Math.Min(Math.Max(panel.RequiredHeight, currentPosition.Y), stateContainerGrid.MaxHeight);
System.Activities.DurableInstancing (7)
System\Activities\DurableInstancing\BinaryHeap.cs (1)
142int newSize = Math.Max(
System\Activities\DurableInstancing\LoadRetryExponentialBackoffStrategy.cs (3)
13readonly int expLimit = (int)(Math.Log(Int32.MaxValue, 2)) - 1; 27int power = Math.Min(retryAttempt, this.expLimit); 31Math.Min
System\Activities\DurableInstancing\SqlCommandAsyncResult.cs (1)
64long openTimeout = Math.Min(timeout.Ticks, SqlCommandAsyncResult.MaximumOpenTimeout.Ticks);
System\Activities\DurableInstancing\SqlWorkflowInstanceStore.cs (2)
183double lockBuffer = Math.Min(SqlWorkflowInstanceStoreConstants.LockOwnerTimeoutBuffer.TotalSeconds, (TimeSpan.MaxValue.Subtract(this.HostLockRenewalPeriod)).TotalSeconds); 184this.bufferedHostLockRenewalPeriod = TimeSpan.FromSeconds(Math.Min(Int32.MaxValue, lockBuffer + this.HostLockRenewalPeriod.TotalSeconds));
System.Activities.Presentation (105)
System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\manifestimages.cs (6)
224float desiredAspectRatio = Math.Max(float.Epsilon, GetAspectRatio(desiredSize)); 225float actualAspectRatio = Math.Max(float.Epsilon, GetAspectRatio(actualSize)); 227float desiredArea = Math.Max(float.Epsilon, GetArea(desiredSize)); 228float actualArea = Math.Max(float.Epsilon, GetArea(actualSize)); 236_lastMatch = Math.Min(1f, Math.Max(0f, 1f - diff));
System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\PropertyEditing\FromExpression\Framework\Tolerances.cs (1)
26return Math.Abs(d) < Tolerances.ZeroThreshold;
System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\PropertyEditing\PropertyPanel.cs (10)
178double lastChildWidth = Math.Max(0, this.LastChildWidth); 180double availableWidth = Math.Max(0, availableSize.Width - lastChildWidth - indent); 200actualSize.Height = Math.Max(actualSize.Height, child.DesiredSize.Height); 211double lastChildWidth = Math.Max(0, this.LastChildWidth); 213double availableWidth = Math.Max(0, finalSize.Width - lastChildWidth - indent); 225child.Arrange(new Rect(Math.Max(0, finalSize.Width - lastChildWidth), 0, lastChildWidth, finalSize.Height)); 229child.Arrange(new Rect(left, 0, Math.Min(desiredWidth, availableWidth), finalSize.Height)); 234availableWidth = Math.Max(0, availableWidth); 248double dividerRight = Math.Max(0, this.LastChildWidth); 266Math.Max(dividerLeft - firstChildWidth, 0),
System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\PropertyEditing\SharedPropertyValueColumnWidthContainer.cs (2)
190return Math.Max(min, Math.Min(max, value));
System.Activities.Presentation\System\Activities\Presentation\FreeFormEditing\AutoSplitHelper.cs (2)
157double distX = Math.Abs(shapeCenter.X - mousePosition.X); 158double distY = Math.Abs(shapeCenter.Y - mousePosition.Y);
System.Activities.Presentation\System\Activities\Presentation\FreeFormEditing\ConnectorEditor.cs (6)
351if (Math.Abs(slope1) == Math.Abs(slope2)) 405Orientation orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical; 426Orientation orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical; 509Orientation orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical; 514orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical;
System.Activities.Presentation\System\Activities\Presentation\FreeFormEditing\ConnectorRouter.cs (22)
112vec.X.IsEqualTo(0) ? 0 : Math.Sign(vec.X), 113vec.Y.IsEqualTo(0) ? 0 : Math.Sign(vec.Y) 952int steps = (int)Math.Max(Math.Abs(sub.X / margin.Width), Math.Abs(sub.Y / margin.Height)); //one of the values will be null 1147(p.X.IsNoLessThan(Math.Min(this.point1.X, this.point2.X)) && p.X.IsNoGreaterThan(Math.Max(this.point1.X, this.point2.X))) : 1148(p.Y.IsNoLessThan(Math.Min(this.point1.Y, this.point2.Y)) && p.Y.IsNoGreaterThan(Math.Max(this.point1.Y, this.point2.Y))); 1184k += k.IsEqualTo(Math.Min(k1, k2)) ? -1.0 : 1.0; 1238if (vertical.A.X < Math.Min(horizontal.A.X, horizontal.B.X) || vertical.A.X > Math.Max(horizontal.A.X, horizontal.B.X)) 1243if (horizontal.A.Y < Math.Min(vertical.A.Y, vertical.B.Y) || horizontal.A.Y > Math.Max(vertical.A.Y, vertical.B.Y)) 1261return k.IsNoLessThan(Math.Min(k1, k2)) && k.IsNoGreaterThan(Math.Max(k1, k2)); 1468newDistance = (int)Math.Abs(newCover.A.X - escape.X); 1472newDistance = (int)Math.Abs(newCover.A.Y - escape.Y); 1475if (Math.Sign(newDistance) == Math.Sign(originalDistance) && Math.Abs(newDistance) < Math.Abs(originalDistance))
System.Activities.Presentation\System\Activities\Presentation\FreeFormEditing\DesignerGeometryHelper.cs (8)
17return Math.Abs(begin.X - end.X) + Math.Abs(begin.Y - end.Y); 22return Math.Sqrt(Math.Pow(point2.X - point1.X, 2) + Math.Pow(point2.Y - point1.Y, 2)); 38return new Point(Math.Round((point1.X + point2.X) / 2), Math.Round((point1.Y + point2.Y) / 2)); 69double length = Math.Abs((points[i].X == points[i + 1].X) ? points[i].Y - points[i + 1].Y : points[i].X - points[i + 1].X);
System.Activities.Presentation\System\Activities\Presentation\FreeFormEditing\DoubleExtensions.cs (1)
14return Math.Abs(a - b) < DesignerGeometryHelper.EPS;
System.Activities.Presentation\System\Activities\Presentation\MiniMap\MiniMapControl.xaml.cs (2)
120double left = Math.Max(value - this.mousePosition.X, 0.0); 134double top = Math.Max(value - this.mousePosition.Y, 0.0);
System.Activities.Presentation\System\Activities\Presentation\Model\ModelSearchServiceImpl.cs (2)
715width = Math.Min(fe.RenderSize.Width, designerView.ScrollViewer.ViewportWidth); 716height = Math.Min(fe.RenderSize.Height, designerView.ScrollViewer.ViewportHeight);
System.Activities.Presentation\System\Activities\Presentation\View\BreadCrumbTextConverter.cs (2)
19set { this.pixelsPerChar = Math.Max(5.0, value); } 58actualDisplayNameLength = (int)Math.Max(MaxDisplayNameLength, actualControlWidth / pixelsPerChar);
System.Activities.Presentation\System\Activities\Presentation\View\DataGridHelper.cs (2)
210int index = Math.Max(0, Math.Min(numItems - 1, items.IndexOf(currentCell.Item) + (shiftModifier ? -1 : 1)));
System.Activities.Presentation\System\Activities\Presentation\View\DesignerView.xaml.cs (10)
1166int imageWidth = (int)Math.Ceiling(bounds.Right); 1167int imageHeight = (int)Math.Ceiling(bounds.Bottom); 1573return Math.Sqrt((y - c) / a); 1624double y = Math.Min(maxValue, Math.Max(minValue, Math.Min(y1, y2))); 1667y = Math.Min(maxValue, Math.Max(minValue, Math.Min(y1, y2))); 1703if (valueAsDouble == Math.Floor(valueAsDouble))
System.Activities.Presentation\System\Activities\Presentation\View\ExtensionSurface.cs (11)
299pos = Math.Max(0.0, pos); 327this.canvasOffset.X = Math.Min(this.canvasOffset.X, p.X); 328this.canvasOffset.Y = Math.Min(this.canvasOffset.Y, p.Y); 331this.canvasOffset.X = Math.Abs(this.canvasOffset.X); 332this.canvasOffset.Y = Math.Abs(this.canvasOffset.Y); 415offsetMinusX = Math.Min(offsetMinusX, pos.X); 416offsetMinusY = Math.Min(offsetMinusY, pos.Y); 419offsetPlusX = Math.Max(offsetPlusX, pos.X + child.DesiredSize.Width); 420offsetPlusY = Math.Max(offsetPlusY, pos.Y + child.DesiredSize.Height); 425panelWidth = Math.Abs(offsetPlusX - offsetMinusX); 426panelHeight = Math.Abs(offsetPlusY - offsetMinusY);
System.Activities.Presentation\System\Activities\Presentation\View\ExtensionWindow.cs (4)
477size.Width = Math.Min(Math.Max(MinWidth, current.X), MaxWidth); 496size.Height = Math.Min(Math.Max(MinHeight, current.Y), MaxHeight);
System.Activities.Presentation\System\Activities\Presentation\View\ExtensionWindowResizeGrip.cs (4)
60newSize.Width = Math.Min(Math.Max(this.parent.MinWidth, currentPosition.X), this.parent.MaxWidth); 61newSize.Height = Math.Min(Math.Max(this.parent.MinHeight, currentPosition.Y), this.parent.MaxHeight);
System.Activities.Presentation\System\Activities\Presentation\View\RubberBandSelector.cs (2)
126if (!this.IsSelecting && (Math.Abs(positionToScreen.X - this.MouseDownPointToScreen.X) > SystemParameters.MinimumHorizontalDragDistance || 127Math.Abs(positionToScreen.Y - this.MouseDownPointToScreen.Y) > SystemParameters.MinimumVerticalDragDistance))
System.Activities.Presentation\System\Activities\Presentation\View\VisualBasicEditor.xaml.cs (6)
433this.blockHeight = Math.Max(this.blockHeight, textBlock.MinHeight); 434this.blockHeight = Math.Min(this.blockHeight, textBlock.MaxHeight); 436this.blockWidth = Math.Max(this.blockWidth, textBlock.MinWidth); 437this.blockWidth = Math.Min(this.blockWidth, textBlock.MaxWidth); 528this.blockWidth = Math.Max(this.ActualWidth - 8, 0); //8 is the margin 531this.blockWidth = Math.Max(this.blockWidth - 16, 0); //give 16 for error icon
System.Activities.Presentation\System\Activities\Presentation\WorkflowViewElement.cs (2)
759if (Math.Abs(difference.X) > SystemParameters.MinimumHorizontalDragDistance || 760Math.Abs(difference.Y) > SystemParameters.MinimumVerticalDragDistance)
System.Configuration (1)
System\Configuration\ConfigurationErrorsException.cs (1)
238_firstLine = Math.Max(line, 0); // BaseConfigurationRecord uses -1 as uninitialized value.
System.Core (15)
Microsoft\Scripting\Actions\RuleCache.cs (1)
53int max = Math.Min(_rules.Length, i + count);
Microsoft\Scripting\Ast\BinaryExpression.cs (2)
2568Type mathType = typeof(System.Math); 2618Type mathType = typeof(System.Math);
Microsoft\Scripting\Ast\DebugViewWriter.cs (1)
208return (Flow)System.Math.Max((int)last, (int)flow);
Microsoft\Scripting\Compiler\LambdaCompiler.Statements.cs (1)
370keys.Sort((x, y) => Math.Sign(x.Key - y.Key));
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 (2)
376return Math.Min(m_childCount, m_takeOrSkipOp.m_count); 380return Math.Max(m_childCount - m_takeOrSkipOp.m_count, 0);
System\Linq\Parallel\Scheduling\Scheduling.cs (2)
41internal static int DefaultDegreeOfParallelism = Math.Min(Environment.ProcessorCount, MAX_SUPPORTED_DOP); 90chunkSize = Math.Max(1, DEFAULT_BYTES_PER_CHUNK / Marshal.SizeOf(typeof(T)));
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\Security\Cryptography\Rfc4050KeyFormatter.cs (2)
211int requiredLength = Math.Max(xLen, yLen); 221requiredLength = Math.Max(requiredLength, curveLength);
System.Data (308)
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\manifestimages.cs (6)
224float desiredAspectRatio = Math.Max(float.Epsilon, GetAspectRatio(desiredSize)); 225float actualAspectRatio = Math.Max(float.Epsilon, GetAspectRatio(actualSize)); 227float desiredArea = Math.Max(float.Epsilon, GetArea(desiredSize)); 228float actualArea = Math.Max(float.Epsilon, GetArea(actualSize)); 236_lastMatch = Math.Min(1f, Math.Max(0f, 1f - diff));
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\PropertyEditing\FromExpression\Framework\Tolerances.cs (1)
26return Math.Abs(d) < Tolerances.ZeroThreshold;
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\PropertyEditing\PropertyPanel.cs (10)
178double lastChildWidth = Math.Max(0, this.LastChildWidth); 180double availableWidth = Math.Max(0, availableSize.Width - lastChildWidth - indent); 200actualSize.Height = Math.Max(actualSize.Height, child.DesiredSize.Height); 211double lastChildWidth = Math.Max(0, this.LastChildWidth); 213double availableWidth = Math.Max(0, finalSize.Width - lastChildWidth - indent); 225child.Arrange(new Rect(Math.Max(0, finalSize.Width - lastChildWidth), 0, lastChildWidth, finalSize.Height)); 229child.Arrange(new Rect(left, 0, Math.Min(desiredWidth, availableWidth), finalSize.Height)); 234availableWidth = Math.Max(0, availableWidth); 248double dividerRight = Math.Max(0, this.LastChildWidth); 266Math.Max(dividerLeft - firstChildWidth, 0),
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\PropertyEditing\SharedPropertyValueColumnWidthContainer.cs (2)
190return Math.Max(min, Math.Min(max, value));
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\FreeFormEditing\AutoSplitHelper.cs (2)
157double distX = Math.Abs(shapeCenter.X - mousePosition.X); 158double distY = Math.Abs(shapeCenter.Y - mousePosition.Y);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\FreeFormEditing\ConnectorEditor.cs (6)
351if (Math.Abs(slope1) == Math.Abs(slope2)) 405Orientation orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical; 426Orientation orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical; 509Orientation orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical; 514orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical;
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\FreeFormEditing\ConnectorRouter.cs (22)
112vec.X.IsEqualTo(0) ? 0 : Math.Sign(vec.X), 113vec.Y.IsEqualTo(0) ? 0 : Math.Sign(vec.Y) 952int steps = (int)Math.Max(Math.Abs(sub.X / margin.Width), Math.Abs(sub.Y / margin.Height)); //one of the values will be null 1147(p.X.IsNoLessThan(Math.Min(this.point1.X, this.point2.X)) && p.X.IsNoGreaterThan(Math.Max(this.point1.X, this.point2.X))) : 1148(p.Y.IsNoLessThan(Math.Min(this.point1.Y, this.point2.Y)) && p.Y.IsNoGreaterThan(Math.Max(this.point1.Y, this.point2.Y))); 1184k += k.IsEqualTo(Math.Min(k1, k2)) ? -1.0 : 1.0; 1238if (vertical.A.X < Math.Min(horizontal.A.X, horizontal.B.X) || vertical.A.X > Math.Max(horizontal.A.X, horizontal.B.X)) 1243if (horizontal.A.Y < Math.Min(vertical.A.Y, vertical.B.Y) || horizontal.A.Y > Math.Max(vertical.A.Y, vertical.B.Y)) 1261return k.IsNoLessThan(Math.Min(k1, k2)) && k.IsNoGreaterThan(Math.Max(k1, k2)); 1468newDistance = (int)Math.Abs(newCover.A.X - escape.X); 1472newDistance = (int)Math.Abs(newCover.A.Y - escape.Y); 1475if (Math.Sign(newDistance) == Math.Sign(originalDistance) && Math.Abs(newDistance) < Math.Abs(originalDistance))
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\FreeFormEditing\DesignerGeometryHelper.cs (8)
17return Math.Abs(begin.X - end.X) + Math.Abs(begin.Y - end.Y); 22return Math.Sqrt(Math.Pow(point2.X - point1.X, 2) + Math.Pow(point2.Y - point1.Y, 2)); 38return new Point(Math.Round((point1.X + point2.X) / 2), Math.Round((point1.Y + point2.Y) / 2)); 69double length = Math.Abs((points[i].X == points[i + 1].X) ? points[i].Y - points[i + 1].Y : points[i].X - points[i + 1].X);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\FreeFormEditing\DoubleExtensions.cs (1)
14return Math.Abs(a - b) < DesignerGeometryHelper.EPS;
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\MiniMap\MiniMapControl.xaml.cs (2)
120double left = Math.Max(value - this.mousePosition.X, 0.0); 134double top = Math.Max(value - this.mousePosition.Y, 0.0);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Model\ModelSearchServiceImpl.cs (2)
715width = Math.Min(fe.RenderSize.Width, designerView.ScrollViewer.ViewportWidth); 716height = Math.Min(fe.RenderSize.Height, designerView.ScrollViewer.ViewportHeight);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\View\BreadCrumbTextConverter.cs (2)
19set { this.pixelsPerChar = Math.Max(5.0, value); } 58actualDisplayNameLength = (int)Math.Max(MaxDisplayNameLength, actualControlWidth / pixelsPerChar);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\View\DataGridHelper.cs (2)
210int index = Math.Max(0, Math.Min(numItems - 1, items.IndexOf(currentCell.Item) + (shiftModifier ? -1 : 1)));
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\View\DesignerView.xaml.cs (10)
1166int imageWidth = (int)Math.Ceiling(bounds.Right); 1167int imageHeight = (int)Math.Ceiling(bounds.Bottom); 1573return Math.Sqrt((y - c) / a); 1624double y = Math.Min(maxValue, Math.Max(minValue, Math.Min(y1, y2))); 1667y = Math.Min(maxValue, Math.Max(minValue, Math.Min(y1, y2))); 1703if (valueAsDouble == Math.Floor(valueAsDouble))
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\View\ExtensionSurface.cs (11)
299pos = Math.Max(0.0, pos); 327this.canvasOffset.X = Math.Min(this.canvasOffset.X, p.X); 328this.canvasOffset.Y = Math.Min(this.canvasOffset.Y, p.Y); 331this.canvasOffset.X = Math.Abs(this.canvasOffset.X); 332this.canvasOffset.Y = Math.Abs(this.canvasOffset.Y); 415offsetMinusX = Math.Min(offsetMinusX, pos.X); 416offsetMinusY = Math.Min(offsetMinusY, pos.Y); 419offsetPlusX = Math.Max(offsetPlusX, pos.X + child.DesiredSize.Width); 420offsetPlusY = Math.Max(offsetPlusY, pos.Y + child.DesiredSize.Height); 425panelWidth = Math.Abs(offsetPlusX - offsetMinusX); 426panelHeight = Math.Abs(offsetPlusY - offsetMinusY);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\View\ExtensionWindow.cs (4)
477size.Width = Math.Min(Math.Max(MinWidth, current.X), MaxWidth); 496size.Height = Math.Min(Math.Max(MinHeight, current.Y), MaxHeight);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\View\ExtensionWindowResizeGrip.cs (4)
60newSize.Width = Math.Min(Math.Max(this.parent.MinWidth, currentPosition.X), this.parent.MaxWidth); 61newSize.Height = Math.Min(Math.Max(this.parent.MinHeight, currentPosition.Y), this.parent.MaxHeight);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\View\RubberBandSelector.cs (2)
126if (!this.IsSelecting && (Math.Abs(positionToScreen.X - this.MouseDownPointToScreen.X) > SystemParameters.MinimumHorizontalDragDistance || 127Math.Abs(positionToScreen.Y - this.MouseDownPointToScreen.Y) > SystemParameters.MinimumVerticalDragDistance))
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\View\VisualBasicEditor.xaml.cs (6)
433this.blockHeight = Math.Max(this.blockHeight, textBlock.MinHeight); 434this.blockHeight = Math.Min(this.blockHeight, textBlock.MaxHeight); 436this.blockWidth = Math.Max(this.blockWidth, textBlock.MinWidth); 437this.blockWidth = Math.Min(this.blockWidth, textBlock.MaxWidth); 528this.blockWidth = Math.Max(this.ActualWidth - 8, 0); //8 is the margin 531this.blockWidth = Math.Max(this.blockWidth - 16, 0); //give 16 for error icon
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\WorkflowViewElement.cs (2)
759if (Math.Abs(difference.X) > SystemParameters.MinimumHorizontalDragDistance || 760Math.Abs(difference.Y) > SystemParameters.MinimumVerticalDragDistance)
fx\src\data\Microsoft\SqlServer\Server\SqlRecordBuffer.cs (2)
433byte[] data = new byte[Math.Max(ndataIndex + length, 2 * cbytes)]; 470char[] data = new char[Math.Max(ndataIndex + length, 2 * cchars)];
fx\src\data\Microsoft\SqlServer\Server\ValueUtilsSmi.cs (5)
2792return Math.Min(first, second); 2841length = Math.Min( length, bufferLength - bufferOffset ); 2846length = Math.Min( length, TdsEnums.TYPE_SIZE_LIMIT ); 2854length = (int) Math.Min((long)length, actualLength - fieldOffset); 2858length = (int) Math.Min((long)length, maxLength - fieldOffset);
fx\src\data\System\Data\Common\AdapterUtil.cs (3)
2405startIndex = Math.Min(startIndex, index); 2459lval = Math.Min((long)Int32.MaxValue, lval); 2460lval = Math.Max((long)Int32.MinValue, lval);
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 (4)
90return Math.Sqrt(var); 102min=Math.Min(values[record], min); 116max=Math.Max(values[record], max); 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\DBCommandBuilder.cs (1)
210int maxPrefixLength = Math.Max(
fx\src\data\System\Data\Common\DbDataAdapter.cs (1)
827int maxBatchCommands = Math.Min(UpdateBatchSize, dataRows.Length);
fx\src\data\System\Data\Common\DecimalStorage.cs (4)
90return Math.Sqrt(var); 101min=Math.Min(values[record], min); 115max=Math.Max(values[record], max); 204Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\DoubleStorage.cs (4)
90return Math.Sqrt(var); 102min=Math.Min(values[record], min); 116max=Math.Max(values[record], max); 211Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\Int16Storage.cs (4)
90return Math.Sqrt(var); 102min=Math.Min(values[record], min); 116max=Math.Max(values[record], max); 217Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\Int32Storage.cs (4)
90return Math.Sqrt(var); 101min=Math.Min(values[record], min); 115max=Math.Max(values[record], max); 216Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\Int64Storage.cs (4)
90return Math.Sqrt(var); 101min=Math.Min(values[record], min); 115max=Math.Max(values[record], max); 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 (4)
90return Math.Sqrt(var); 102min=Math.Min(values[record], min); 116max=Math.Max(values[record], max); 213Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SingleStorage.cs (4)
90return Math.Sqrt(var); 103min=Math.Min(values[record], min); 117max=Math.Max(values[record], max); 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 (2)
92return Math.Sqrt(var.Value); 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 (2)
92return Math.Sqrt(var.Value); 182Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLDoubleStorage.cs (2)
92return Math.Sqrt(var.Value); 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 (2)
92return Math.Sqrt(var.Value); 183Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLInt32Storage.cs (2)
92return Math.Sqrt(var.Value); 183Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLInt64Storage.cs (2)
92return Math.Sqrt(var.Value); 184Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLMoneyStorage.cs (2)
92return Math.Sqrt(var.Value); 183Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\SQLTypes\SQLSingleStorage.cs (2)
93return Math.Sqrt(var.Value); 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 (5)
76return TimeSpan.FromTicks((long)Math.Round(sum)); 91return TimeSpan.FromTicks((long)Math.Round(meanSum / meanCount)); 116ulong stDev = (ulong)Math.Round(Math.Sqrt(varSum / (count - 1))); 221Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\UInt16Storage.cs (4)
90return Math.Sqrt(var); 101min=Math.Min(values[record], min); 115max=Math.Max(values[record], max); 216Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\UInt32Storage.cs (4)
90return Math.Sqrt(var); 101min=Math.Min(values[record], min); 115max=Math.Max(values[record], max); 216Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\Common\UInt64Storage.cs (4)
90return Math.Sqrt(var); 101min=Math.Min(values[record], min); 115max=Math.Max(values[record], max); 210Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
fx\src\data\System\Data\DataColumn.cs (1)
956maxLength = Math.Max(value, -1);
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\Filter\BinaryNode.cs (2)
1040DataTypePrecedence higherPrec = (DataTypePrecedence)Math.Max(leftPrecedence, rightPrecedence); 1138DataTypePrecedence higherPrec = (DataTypePrecedence)Math.Max(leftPrecedence, rightPrecedence);
fx\src\data\System\Data\Filter\FunctionNode.cs (2)
262return(Math.Abs((Int64)argumentValues[0])); 264return(Math.Abs((double)argumentValues[0]));
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 (12)
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); 1192cbReadMax = (int)Math.Min(cbLength, internalNativeBuffer.Length - 4); 1200cbReadMax = (int)Math.Min(cbLength, internalNativeBuffer.Length - 2); 1292Buffer.ReadBytes(0, rgBytes, cbOffset, Math.Min(cbActual, cbBufferLen)); 1304buffer.ReadBytes(0, rgBytes, cbOffset, Math.Min(cbActual, cbBufferLen)); 2005row[columnSize] = unchecked((int)Math.Min(Math.Max(Int32.MinValue, metadata[i].size.ToInt64()), Int32.MaxValue));
fx\src\data\System\Data\Odbc\OdbcParameter.cs (8)
299return Math.Min((int)_internalPrecision,ADP.DecimalMaxPrecision); 322cch = Math.Max(cch, 4 * 1024); // MDAC 69224 345cch = Math.Max(cch, 4 * 1024); // MDAC 69224 359cch = Math.Max(cch, 8 * 1024); // MDAC 69224 370cch = Math.Max(2, cch); 384return Math.Min((int)_internalPrecision,ADP.DecimalMaxPrecision); 452ccb = Math.Max(ccb, 8 * 1024); // MDAC 69224 481_internalPrecision = Math.Max(_internalPrecision, precision); // silently adjust the precision
fx\src\data\System\Data\Odbc\OdbcUtils.cs (4)
41cb = Math.Min(cb/2, (Length-2)/2); 49cb = Math.Min(cb, Length); 171length = Math.Max(0, ((string)value).Length - valueOffset); 184length = Math.Max(0, ((char[])value).Length - valueOffset);
fx\src\data\System\Data\OleDb\ColumnBinding.cs (11)
169return Math.Max(length, 0); 223_valueBindingOffset = Math.Max(offset, 0); 227_valueBindingSize = Math.Max(size, 0); 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 (4)
797int byteCount = Math.Min(value.Length - srcIndex, length); 827int charCount = Math.Min(value.Length - srcIndex, length); 1042int count = Math.Min(values.Length, _visibleFieldCount); 1574_rowFetchedCount = (IntPtr)Math.Max((int)_rowFetchedCount, 0);
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\OleDb\RowBinding.cs (1)
160return Math.Max(8, (value + 7) & ~0x7); // MDAC 70350
fx\src\data\System\Data\ProviderBase\DbConnectionPool.cs (1)
1101delay = (uint)Math.Max(ADP.TimerRemainingMilliseconds(next.DueTime), 0);
fx\src\data\System\Data\ProviderBase\DbMetaDataFactory.cs (1)
146command.CommandTimeout = System.Math.Max(command.CommandTimeout,180);
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\SqlCommand.cs (2)
5022? (_rowsAffected - Math.Max(_sqlRPCParameterEncryptionReqArray[_currentlyExecutingDescribeParameterEncryptionRPC - 1].cumulativeRecordsAffected, 0)) 5060? (_rowsAffected - Math.Max(_SqlRPCBatchArray[_currentlyExecutingBatch-1].cumulativeRecordsAffected, 0))
fx\src\data\System\Data\SqlClient\SqlCommandSet.cs (2)
164byte[] copy = new byte[Math.Max(countOfBytes, 0)]; 178char[] copy = new char[Math.Max(countOfChars, 0)];
fx\src\data\System\Data\SqlClient\SqlDataReader.cs (4)
1833int bytesToRead = (int)Math.Min((long)length, _sharedState._columnDataBytesRemaining); 3562int bytesRemaining = Math.Min(checked(_stateObj._inBytesRead - _stateObj._inBytesUsed), _stateObj._inBytesPacket); 3894throw ADP.NonSequentialColumnAccess(columnIndex, Math.Max(_sharedState._nextColumnHeaderToRead - 1, _lastColumnWithDataChunkRead)); 3916throw ADP.NonSequentialColumnAccess(columnIndex, Math.Max(_sharedState._nextColumnDataToRead, _lastColumnWithDataChunkRead + 1));
fx\src\data\System\Data\SqlClient\SqlInternalConnectionTds.cs (1)
1528nextTimeoutInterval = Math.Max(ADP.MinimumTimeoutForTnirMs, nextTimeoutInterval);
fx\src\data\System\Data\SqlClient\SqlSequentialStream.cs (1)
30_readTimeout = (int)Math.Min((long)reader.Command.CommandTimeout * 1000L, (long)Int32.MaxValue);
fx\src\data\System\Data\SqlClient\SqlSequentialStreamSmi.cs (1)
70int bytesNeeded = (int)Math.Min((long)count, _length - _position);
fx\src\data\System\Data\SqlClient\SqlSequentialTextReader.cs (1)
525charsUsed = Math.Min(charCount, byteCount / 2);
fx\src\data\System\Data\SqlClient\SqlSequentialTextReaderSmi.cs (1)
94int charsNeeded = (int)Math.Min((long)(count - charsRead), _length - _position);
fx\src\data\System\Data\SqlClient\TdsParser.cs (5)
10302count = Math.Min(_size - _written, count); 10324count = Math.Min(_size - _written, count); 11177buff = new char[(int)Math.Min((int)stateObj._longlen, len)]; 11195charsRead = (int)Math.Min((stateObj._longlenleft + 1) >> 1, (ulong)charsLeft); 11290bytesRead = (int)Math.Min(stateObj._longlenleft, (ulong)charsLeft);
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (9)
435remaining = (int)Math.Min((long)Int32.MaxValue, _timeoutMilliseconds); 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)); 1736int bytesToRead = (int)Math.Min(_longlenleft, (ulong)len); 1774buff = new byte[(int)Math.Min((int)_longlen, len)]; 1795int bytesToRead = (int)Math.Min(_longlenleft, (ulong)bytesLeft); 1844cbSkip = (int)Math.Min((long)Int32.MaxValue, num);
fx\src\data\System\Data\SQLTypes\SQLDecimal.cs (26)
430precision = Math.Max(precision, m_bScale); 689double dInt = Math.Floor(dVal); 695dVal = Math.Floor (dInt / DUINT_BASE); 700dVal = Math.Floor (dInt / DUINT_BASE); 706dVal = Math.Floor (dInt / DUINT_BASE); 712dVal = Math.Floor (dInt / DUINT_BASE); 766dFrac -= Math.Floor (dFrac); 1125dRet /= System.Math.Pow(10.0, m_bScale); 1222ResInteger = Math.Max((int)x.m_bPrec - MyScale, (int)y.m_bPrec - OpScale); 1226ResScale = Math.Max(MyScale, OpScale); 1232ResPrec = Math.Min(MaxPrecision, ResPrec); 1433ResScale = Math.Min((ResPrec - ResInteger),ResScale); 1435ResScale = Math.Max(ResScale, Math.Min(ActualScale,x_cNumeDivScaleMin)); 1649ResScale = Math.Max(x.m_bScale + y.m_bPrec + 1, x_cNumeDivScaleMin); 1652MinScale = Math.Min(ResScale, x_cNumeDivScaleMin); 1654ResInteger = Math.Min(ResInteger, NUMERIC_MAX_PRECISION); 1661ResScale = Math.Min((ResPrec - ResInteger), ResScale); 1662ResScale = Math.Max(ResScale, MinScale); 2236bNewPrec = (byte) (Math.Min(NUMERIC_MAX_PRECISION,Math.Max(1,lAdjust + m_bPrec))); 3059lPosition = Math.Min(NUMERIC_MAX_PRECISION, lPosition); 3065lPosition = Math.Max(-NUMERIC_MAX_PRECISION, lPosition); 3075int lAdjust = Math.Abs(lPosition - (int)n.m_bScale); // Precision adjustment 3110lAdjust = Math.Abs(lPosition - n.m_bScale); 3152n = new SqlDecimal(Math.Pow(dBaseNum, exp));
System.Data.Entity (40)
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\Coordinator.cs (1)
125maxDistance = Math.Max(maxDistance, child.MaxDistanceToLeaf() + 1);
System\Data\Common\Internal\Materialization\RecordState.cs (4)
152byteCount = Math.Min(byteCount, length); 159return Math.Max(0, byteCount); 185charCount = Math.Min(charCount, length); 194return Math.Max(0, charCount);
System\Data\Common\Utils\AliasGenerator.cs (1)
92_counter = Math.Max(unchecked(1+_counter), 0);
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\MetadataMappingHasherVisitor.HashSourceBuilder.cs (1)
154int bufferSize = Math.Max(_cachedBuffer.Length + (_cachedBuffer.Length / 2), byteCount);
System\Data\Mapping\Update\Internal\RelationshipConstraintValidator.cs (1)
219int absoluteCount = Math.Abs(addedCount - deletedCount);
System\Data\Mapping\ViewGeneration\QueryRewriting\RewritingProcessor.cs (2)
253int numPermutations = Math.Min(MAX_PERMUTATIONS, Math.Max(MIN_PERMUTATIONS, (int)(usedViews.Count * PERMUTE_FRACTION)));
System\Data\Metadata\EdmSchemaError.cs (1)
242int pos = Math.Max(schemaLocation.LastIndexOf('/'), schemaLocation.LastIndexOf('\\'));
System\Data\Objects\ELinq\MethodCallTranslator.cs (10)
822typeof(Math).GetMethod("Ceiling", BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(decimal) }, null), 823typeof(Math).GetMethod("Ceiling", BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(double) }, null), 824typeof(Math).GetMethod("Floor", BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(decimal) }, null), 825typeof(Math).GetMethod("Floor", BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(double) }, null), 826typeof(Math).GetMethod("Round", BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(decimal) }, null), 827typeof(Math).GetMethod("Round", BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(double) }, null), 828typeof(Math).GetMethod("Round", BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(decimal), typeof(int) }, null), 829typeof(Math).GetMethod("Round", BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(double), typeof(int) }, null), 847result.Add(typeof(Math).GetMethod("Abs", BindingFlags.Public | BindingFlags.Static, null, new Type[] { argType }, null)); 940typeof(Math).GetMethod("Pow", BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(double), typeof(double) }, null),
System\Data\Objects\ELinq\OrderByLifter.cs (1)
233DbExpression newCount = CombineIntegers(limit.Limit, k, Math.Min);
System\Data\Objects\ObjectContext.cs (2)
2205int batchSize = Math.Min(maxBatch, (targetKeys.Count - startFrom)); 2580int returnTypeCount = Math.Max(1, functionImport.ReturnParameters.Count);
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\SqlClient\SqlGen\SqlGenerator.cs (1)
970byte precision = (byte)Math.Max((Byte)strDecimal.Length, defaultDecimalPrecision);
System\Data\SqlClient\SqlProviderServices.cs (1)
367result.Size = Math.Max(result.Size, size.Value);
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 (6)
SqlClient\Query\SqlMethodCallConverter.cs (2)
422if (mc.Method.IsStatic && mc.Method.DeclaringType == typeof(Math)) { 915else if (declType == typeof(System.Math)) {
SqlClient\SqlTypeSystemProvider.cs (4)
828int end = (paren != -1 && space != -1) ? Math.Min(space, paren) 1349int bestLeft = Math.Max(p0 - s0, p1 - s1); 1350int bestRight = Math.Max(s0, s1); 1351int precision = Math.Min(bestLeft + bestRight, 38);
System.Data.Services (11)
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\Parsing\FunctionDescription.cs (2)
529CreateFunctionDescription(typeof(Math), false /* instance */, true /* method */, name, typeof(double)), 530CreateFunctionDescription(typeof(Math), false /* instance */, true /* method */, name, typeof(decimal)),
System.Data.Services.Client (18)
System\Data\Services\Client\ALinq\TypeSystem.cs (6)
72expressionMethodMap.Add(typeof(Math).GetMethod("Round", new Type[] { typeof(double) }), @"round"); 73expressionMethodMap.Add(typeof(Math).GetMethod("Round", new Type[] { typeof(decimal) }), @"round"); 74expressionMethodMap.Add(typeof(Math).GetMethod("Floor", new Type[] { typeof(double) }), @"floor"); 76expressionMethodMap.Add(typeof(Math).GetMethod("Floor", new Type[] { typeof(decimal) }), @"floor"); 78expressionMethodMap.Add(typeof(Math).GetMethod("Ceiling", new Type[] { typeof(double) }), @"ceiling"); 80expressionMethodMap.Add(typeof(Math).GetMethod("Ceiling", new Type[] { typeof(decimal) }), @"ceiling");
System\Data\Services\Client\ArraySet.cs (2)
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\Client\DataServiceContext.cs (1)
1962request.Timeout = (int)Math.Min(Int32.MaxValue, new TimeSpan(0, 0, this.timeout).TotalMilliseconds);
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.Data.SqlXml (11)
System\Xml\Xsl\Runtime\NumberFormatter.cs (1)
81Debug.Assert(Math.Pow(totalChars, MaxAlphabeticLength) >= MaxAlphabeticValue);
System\Xml\Xsl\Runtime\XslNumber.cs (2)
265Debug.Assert(val >= 0 && val == Math.Round(val), "ConvertToArabic operates on non-negative integer numbers only"); 271int newLen = Math.Max(oldLen, minLen);
System\Xml\Xsl\Runtime\XsltFunctions.cs (1)
181double temp = Math.Round(value);
System\Xml\Xsl\Runtime\XsltLibrary.cs (3)
42public static readonly MethodInfo Floor = GetMethod(typeof(Math) , "Floor" , typeof(double)); 43public static readonly MethodInfo Ceiling = GetMethod(typeof(Math) , "Ceiling", typeof(double)); 446idx += Math.Max(count - 4, 0);
System\Xml\Xsl\XPathConvert.cs (3)
643if (wExp2 >= 1023 && wExp2 <= 1075 && dbl == Math.Floor(dbl)) { 855Debug.Assert(dblInt == Math.Floor(dblInt) && 1 <= dblInt && dblInt <= 9007199254740991.0d); 878Debug.Assert(dblInt == Math.Floor(dblInt) && 0 <= dblInt && dblInt < C10toN[iT]);
System\Xml\Xsl\XsltOld\NumberAction.cs (1)
114if (Math.Floor(val) == val) {
System.Drawing (64)
commonui\System\Drawing\Advanced\Font.cs (1)
1041return(int) Math.Ceiling(GetHeight());
commonui\System\Drawing\Advanced\RectangleF.cs (8)
408float x1 = Math.Max(a.X, b.X); 409float x2 = Math.Min(a.X + a.Width, b.X + b.Width); 410float y1 = Math.Max(a.Y, b.Y); 411float y2 = Math.Min(a.Y + a.Height, b.Y + b.Height); 440float x1 = Math.Min(a.X, b.X); 441float x2 = Math.Max(a.X + a.Width, b.X + b.Width); 442float y1 = Math.Min(a.Y, b.Y); 443float y2 = Math.Max(a.Y + a.Height, b.Y + b.Height);
commonui\System\Drawing\BufferedGraphicsContext.cs (2)
386int optWidth = Math.Max(width, bufferSize.Width); 387int optHeight = Math.Max(height, bufferSize.Height);
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 (7)
714int bestDelta = Math.Abs(bestWidth - width) + Math.Abs(bestHeight - height); 715int thisDelta = Math.Abs(EntryTemp.bWidth - width) + Math.Abs(EntryTemp.bHeight - height); 903for (int i = 0; i < Math.Min(sourceData.Height, targetData.Height); i++) { 916UnsafeNativeMethods.CopyMemory(new HandleRef(this, destPtr), new HandleRef(this, srcPtr), Math.Abs(targetData.Stride)); 926for (int j = 3; j < Math.Abs(bmpData.Stride); j += 4) { // stride here is fine since we know we're doing this on the whole image
commonui\System\Drawing\Point.cs (4)
209return new Point((int)Math.Ceiling(value.X), (int)Math.Ceiling(value.Y)); 227return new Point((int)Math.Round(value.X), (int)Math.Round(value.Y));
commonui\System\Drawing\Printing\Margins.cs (4)
148this.Left = (int)Math.Round(value); 164this.Right = (int)Math.Round(value); 180this.Top = (int)Math.Round(value); 196this.Bottom = (int)Math.Round(value);
commonui\System\Drawing\Printing\PrinterUnitConvert.cs (1)
46return(int) Math.Round(Convert((double)value, fromUnit, toUnit));
commonui\System\Drawing\Rectangle.cs (16)
300return new Rectangle((int)Math.Ceiling(value.X), 301(int)Math.Ceiling(value.Y), 302(int)Math.Ceiling(value.Width), 303(int)Math.Ceiling(value.Height)); 324return new Rectangle((int)Math.Round(value.X), 325(int)Math.Round(value.Y), 326(int)Math.Round(value.Width), 327(int)Math.Round(value.Height)); 439int x1 = Math.Max(a.X, b.X); 440int x2 = Math.Min(a.X + a.Width, b.X + b.Width); 441int y1 = Math.Max(a.Y, b.Y); 442int y2 = Math.Min(a.Y + a.Height, b.Y + b.Height); 473int x1 = Math.Min(a.X, b.X); 474int x2 = Math.Max(a.X + a.Width, b.X + b.Width); 475int y1 = Math.Min(a.Y, b.Y); 476int y2 = Math.Max(a.Y + a.Height, b.Y + b.Height);
commonui\System\Drawing\Size.cs (4)
193return new Size((int)Math.Ceiling(value.Width), (int)Math.Ceiling(value.Height)); 220return new Size((int)Math.Round(value.Width), (int)Math.Round(value.Height));
misc\DpiHelper.cs (4)
429int dpiScalePercent = (int)Math.Round(LogicalToDeviceUnitsScalingFactor * 100); 508return (int)Math.Round(LogicalToDeviceUnitsScalingFactor * (double)value); 511return (int)Math.Round(scalingFactor * (double)value); 601var scaledValue = (int)Math.Round(value * pixelFactor);
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 (2)
System\IO\Log\FileLogRecordStream.cs (1)
60int streamSize = Math.Min(this.recordSize,
System\IO\Log\LogStore.cs (1)
403lsnStart = Math.Min(logInfo.BaseLsn,
System.Management (1)
ManagementDatetime.cs (1)
267 if(Math.Abs(OffsetMins) > MAXSIZE_UTC_DMTF)
System.Net (1)
net\Logging.cs (1)
123int n = Math.Min(length, 16);
System.Numerics (162)
System\Numerics\BigInteger.cs (7)
895return BigInteger.Log(value, Math.E); 908return Math.Log((double)value._sign, baseValue); 929return (Math.Log(c) + log2 * bitlen) / Math.Log(baseValue); 1340uint[] z = new uint[Math.Max(x.Length, y.Length)]; 1360uint[] z = new uint[Math.Max(x.Length, y.Length)]; 1375uint[] z = new uint[Math.Max(x.Length, y.Length)];
System\Numerics\BigIntegerBuilder.cs (4)
302Array.Copy(_rgu, rgu, Math.Min(cu, _iuLast + 1)); 429EnsureWritable(Math.Max(_iuLast, reg._iuLast) + 1, 1); 905private static readonly double kdblLn2To32 = 32 * Math.Log(2); 1101int cbitMin = Math.Min(cbit1, cbit2);
System\Numerics\BigNumber.cs (1)
625int maxDigits = Math.Min(ichDst + 50, cchMax);
System\Numerics\Complex.cs (38)
64return Math.Atan2(m_imaginary, m_real); 84return new Complex((magnitude * Math.Cos(phase)), (magnitude * Math.Sin(phase))); 138if (Math.Abs(d) < Math.Abs(c)) { 161double c = Math.Abs(value.m_real); 162double d = Math.Abs(value.m_imaginary); 166return c * Math.Sqrt(1.0 + r * r); 171return d * Math.Sqrt(1.0 + r * r); 290return new Complex(Math.Sin(a) * Math.Cosh(b), Math.Cos(a) * Math.Sinh(b)); 298return new Complex(Math.Sinh(a) * Math.Cos(b), Math.Cosh(a) * Math.Sin(b)); 309return new Complex(Math.Cos(a) * Math.Cosh(b), - (Math.Sin(a) * Math.Sinh(b))); 317return new Complex(Math.Cosh(a) * Math.Cos(b), Math.Sinh(a) * Math.Sin(b)); 343return (new Complex((Math.Log(Abs(value))), (Math.Atan2(value.m_imaginary, value.m_real)))); 359Double temp_factor = Math.Exp(value.m_real); 360Double result_re = temp_factor * Math.Cos(value.m_imaginary); 361Double result_im = temp_factor * Math.Sin(value.m_imaginary); 368return Complex.FromPolarCoordinates(Math.Sqrt(value.Magnitude), value.Phase / 2.0); 388double theta = Math.Atan2(b, a); 389double newRho = c * theta + d * Math.Log(rho); 391double t = Math.Pow(rho, c) * Math.Pow(Math.E, -d * theta); 393return new Complex(t * Math.Cos(newRho), t * Math.Sin(newRho));
System\Numerics\Matrix3x2.cs (27)
280float xTan = (float)Math.Tan(radiansX); 281float yTan = (float)Math.Tan(radiansY); 304float xTan = (float)Math.Tan(radiansX); 305float yTan = (float)Math.Tan(radiansY); 329radians = (float)Math.IEEERemainder(radians, Math.PI * 2); 333const float epsilon = 0.001f * (float)Math.PI / 180f; // 0.1% of a degree 341else if (radians > Math.PI / 2 - epsilon && radians < Math.PI / 2 + epsilon) 347else if (radians < -Math.PI + epsilon || radians > Math.PI - epsilon) 353else if (radians > -Math.PI / 2 - epsilon && radians < -Math.PI / 2 + epsilon) 362c = (float)Math.Cos(radians); 363s = (float)Math.Sin(radians); 389radians = (float)Math.IEEERemainder(radians, Math.PI * 2); 393const float epsilon = 0.001f * (float)Math.PI / 180f; // 0.1% of a degree 401else if (radians > Math.PI / 2 - epsilon && radians < Math.PI / 2 + epsilon) 407else if (radians < -Math.PI + epsilon || radians > Math.PI - epsilon) 413else if (radians > -Math.PI / 2 - epsilon && radians < -Math.PI / 2 + epsilon) 422c = (float)Math.Cos(radians); 423s = (float)Math.Sin(radians); 478if (Math.Abs(det) < float.Epsilon)
System\Numerics\Matrix4x4.cs (26)
209zaxis = Vector3.Multiply(zaxis, 1.0f / (float)Math.Sqrt(norm)); 251const float minAngle = 1.0f - (0.1f * ((float)Math.PI / 180.0f)); // 0.1 degrees 267faceDir = Vector3.Multiply(faceDir, (1.0f / (float)Math.Sqrt(norm))); 277if (Math.Abs(dot) > minAngle) 284if (Math.Abs(dot) > minAngle) 286zaxis = (Math.Abs(rotateAxis.Z) > minAngle) ? new Vector3(1, 0, 0) : new Vector3(0, 0, -1); 585float c = (float)Math.Cos(radians); 586float s = (float)Math.Sin(radians); 622float c = (float)Math.Cos(radians); 623float s = (float)Math.Sin(radians); 661float c = (float)Math.Cos(radians); 662float s = (float)Math.Sin(radians); 698float c = (float)Math.Cos(radians); 699float s = (float)Math.Sin(radians); 737float c = (float)Math.Cos(radians); 738float s = (float)Math.Sin(radians); 774float c = (float)Math.Cos(radians); 775float s = (float)Math.Sin(radians); 838float sa = (float)Math.Sin(angle), ca = (float)Math.Cos(angle); 874if (fieldOfView <= 0.0f || fieldOfView >= Math.PI) 886float yScale = 1.0f / (float)Math.Tan(fieldOfView * 0.5f); 1420if (Math.Abs(det) < float.Epsilon) 1598fAbsX = (float)Math.Abs(pVectorBasis[a]->X); 1599fAbsY = (float)Math.Abs(pVectorBasis[a]->Y); 1600fAbsZ = (float)Math.Abs(pVectorBasis[a]->Z);
System\Numerics\NumericsHelpers.cs (1)
134int n = System.Math.Min(v.Length, len);
System\Numerics\Plane.cs (5)
99float invNorm = 1.0f / (float)Math.Sqrt((double)ls); 124if (Math.Abs(normalLengthSquared - 1.0f) < FLT_EPSILON) 129float normalLength = (float)Math.Sqrt(normalLengthSquared); 138if (Math.Abs(f - 1.0f) < FLT_EPSILON) 143float fInv = 1.0f / (float)Math.Sqrt(f);
System\Numerics\Quaternion.cs (20)
83return (float)Math.Sqrt((double)ls); 106float invNorm = 1.0f / (float)Math.Sqrt((double)ls); 168float s = (float)Math.Sin(halfAngle); 169float c = (float)Math.Cos(halfAngle); 193sr = (float)Math.Sin(halfRoll); 194cr = (float)Math.Cos(halfRoll); 197sp = (float)Math.Sin(halfPitch); 198cp = (float)Math.Cos(halfPitch); 201sy = (float)Math.Sin(halfYaw); 202cy = (float)Math.Cos(halfYaw); 227float s = (float)Math.Sqrt(trace + 1.0f); 238float s = (float)Math.Sqrt(1.0f + matrix.M11 - matrix.M22 - matrix.M33); 247float s = (float)Math.Sqrt(1.0f + matrix.M22 - matrix.M11 - matrix.M33); 256float s = (float)Math.Sqrt(1.0f + matrix.M33 - matrix.M11 - matrix.M22); 316float omega = (float)Math.Acos(cosOmega); 317float invSinOmega = (float)(1 / Math.Sin(omega)); 319s1 = (float)Math.Sin((1.0f - t) * omega) * invSinOmega; 321? (float)-Math.Sin(t * omega) * invSinOmega 322: (float)Math.Sin(t * omega) * invSinOmega; 369float invNorm = 1.0f / (float)Math.Sqrt((double)ls);
System\Numerics\Vector2.cs (5)
108return (float)Math.Sqrt(ls); 113return (float)Math.Sqrt((double)ls); 149return (float)System.Math.Sqrt(ls); 158return (float)Math.Sqrt((double)ls); 201float invNorm = 1.0f / (float)Math.Sqrt((double)ls);
System\Numerics\Vector2_Intrinsics.cs (4)
149return new Vector2(Math.Abs(value.X), Math.Abs(value.Y)); 161return new Vector2((Single)Math.Sqrt(value.X), (Single)Math.Sqrt(value.Y));
System\Numerics\Vector3.cs (5)
117return (float)System.Math.Sqrt(ls); 122return (float)System.Math.Sqrt(ls); 158return (float)System.Math.Sqrt(ls); 168return (float)System.Math.Sqrt((double)ls); 212float length = (float)System.Math.Sqrt(ls);
System\Numerics\Vector3_Intrinsics.cs (6)
168return new Vector3(Math.Abs(value.X), Math.Abs(value.Y), Math.Abs(value.Z)); 180return new Vector3((Single)Math.Sqrt(value.X), (Single)Math.Sqrt(value.Y), (Single)Math.Sqrt(value.Z));
System\Numerics\Vector4.cs (5)
124return (float)System.Math.Sqrt(ls); 130return (float)Math.Sqrt((double)ls); 166return (float)System.Math.Sqrt(ls); 177return (float)Math.Sqrt((double)ls); 222float invNorm = 1.0f / (float)Math.Sqrt((double)ls);
System\Numerics\Vector4_Intrinsics.cs (8)
202return new Vector4(Math.Abs(value.X), Math.Abs(value.Y), Math.Abs(value.Z), Math.Abs(value.W)); 214return new Vector4((Single)Math.Sqrt(value.X), (Single)Math.Sqrt(value.Y), (Single)Math.Sqrt(value.Z), (Single)Math.Sqrt(value.W));
System.Runtime.Caching (11)
System\Caching\CacheMemoryMonitor.cs (3)
102memoryLimit = Math.Min(usableMemory, recommendedPrivateByteLimit); 194percent = Math.Min(100, (int)((cacheSize - _memoryLimit) * 100L / cacheSize)); 222_memoryLimit = Math.Min(_memoryLimit, cacheMemoryLimit);
System\Caching\MemoryCacheStatistics.cs (3)
67int newPollingInterval = Math.Min(_configPollingInterval, MEMORYSTATUS_INTERVAL_30_SECONDS); 96return Math.Max(_physicalMemoryMonitor.GetPercentToTrim(_lastTrimTime, _lastTrimPercent), _cacheMemoryMonitor.GetPercentToTrim(_lastTrimTime, _lastTrimPercent)); 219int percent = Math.Max(minPercent, GetPercentToTrim());
System\Caching\MemoryCacheStore.cs (1)
322toTrim = (int)Math.Ceiling(((long)count * (long)percent) / 100D);
System\Caching\PhysicalMemoryMonitor.cs (4)
133percent = Math.Min(50, (int)((lastTrimPercent * TARGET_TOTAL_MEMORY_TRIM_INTERVAL_TICKS) / ticksSinceTrim)); 134percent = Math.Max(MIN_TOTAL_MEMORY_TRIM_PERCENT, percent); 153_pressureHigh = Math.Max(3, physicalMemoryLimitPercentage); 154_pressureLow = Math.Max(1, _pressureHigh - 9);
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 (62)
System\Runtime\Serialization\CodeExporter.cs (1)
1521length = Math.Min(MaxIdentifierLength, length);
System\Runtime\Serialization\Json\JsonWriterDelegator.cs (2)
246int hours = Math.Abs(ts.Hours); 248int minutes = Math.Abs(ts.Minutes);
System\Runtime\Serialization\Json\XmlJsonReader.cs (1)
793actual = Math.Min(count, value.Length);
System\Runtime\Serialization\ObjectToIdCache.cs (1)
198int limit = (int)Math.Sqrt(candidate);
System\Runtime\Serialization\SchemaExporter.cs (1)
456return isFlags ? (long)Math.Pow(2, index) : index;
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 (15)
894int maxLength = Math.Max(this.maxBytesPerRead - maxTextNodeLength, 0); 906int actual = Math.Max(maxLength - maxTextNodeLength, 0); 964int maxLength = Math.Max(this.maxBytesPerRead - maxTextNodeLength, 0); 976int actual = Math.Max(maxLength - maxTextNodeLength, 0); 1006int maxBytesPerRead = Math.Max(this.maxBytesPerRead - nodeLength, 0); 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 (3)
45strings = new XmlDictionaryString[Math.Max(id + 1, 16)]; 49XmlDictionaryString[] newStrings = new XmlDictionaryString[Math.Min(Math.Max(id + 1, strings.Length * 2), MaxArrayEntries)];
System\Xml\XmlBinaryWriterSession.cs (2)
63IntArray keys = new IntArray(Math.Max(minCount, 16)); 250int[] newArray = new int[Math.Max(index + 1, array.Length * 2)];
System\Xml\XmlBufferReader.cs (6)
162TryEnsureBytes(Math.Min(count, windowOffsetMax - offset)); 222byte[] newBuffer = new byte[Math.Max(newOffsetMax, buffer.Length * 2)]; 284this.windowOffsetMax = Math.Max(windowOffset + windowLength, offsetMax); 983int length = Math.Min(byteLength, charLength); 997int length = Math.Min(byteLength, charLength); 1029int length = Math.Min(length1, length2);
System\Xml\XmlC14NWriter.cs (3)
362xmlnsBuffer = new byte[Math.Max(byteCount, 128)]; 366byte[] newBuffer = new byte[Math.Max(xmlnsOffset + byteCount, xmlnsBuffer.Length * 2)]; 910int length = Math.Min(length1, length2);
System\Xml\XmlConverter.cs (2)
1110offset += ToCharsD2(Math.Abs(ts.Hours), chars, offset); 1112offset += ToCharsD2(Math.Abs(ts.Minutes), chars, offset);
System\Xml\XmlMtomReader.cs (6)
1101this.chunkSize = Math.Min(reader.Quotas.MaxBytesPerRead, chunkSize); 1172count = Math.Min(count, this.valueCount); 1219count = Math.Min(count, this.valueCount); 1299this.stringOffset = Math.Max(0, this.stringOffset - consumed * 2); 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.Security (1)
system\security\cryptography\bigint.cs (1)
484char[] dec = new char[(int)Math.Ceiling(m_size * 2 * 1.21)];
System.ServiceModel (64)
System\ServiceModel\Channels\BufferedConnection.cs (1)
96int flushSkew = Ticks.ToMilliseconds(Math.Min(this.flushTimeout / 10, Ticks.FromMilliseconds(maxFlushSkew)));
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\MessageEncoderCompressionHandler.cs (1)
19int maxDecompressedSize = (int)Math.Min(maxReceivedMessageSize, int.MaxValue);
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\PeerNodeImplementation.cs (1)
398factoryMaxReceivedMessageSize = (int)Math.Min(maxReceivedMessageSize, settings.MaxReceivedMessageSize);
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 (3)
1039size = Math.Min(bytesToWrite, maxSocketWrite); 1512long delta = Math.Max(oldTimeout.Ticks, newTimeout.Ticks) - Math.Min(oldTimeout.Ticks, newTimeout.Ticks);
System\ServiceModel\Channels\TransmissionStrategy.cs (20)
103this.meanRtt = Math.Min((long)initRtt.TotalMilliseconds, Constants.MaxMeanRtt >> Constants.TimeMultiplier) << Constants.TimeMultiplier; 107this.timeout = Math.Max(((200 << Constants.TimeMultiplier) * 2) + this.meanRtt, this.meanRtt + (this.serrRtt << Constants.ChebychevFactor)); 307int count = Math.Min(this.windowSize, this.quotaRemaining) - this.window.Count; 311count = Math.Min(count, this.waitQueue.Count); 359this.slowStartThreshold = Math.Max(1, this.windowSize >> 1); 697this.quotaRemaining = quotaRemaining - Math.Min(this.windowSize, this.window.Count); 736int inFlightAfterAck = Math.Min(this.windowSize, this.window.Count) - (int)slide; 737this.quotaRemaining = quotaRemaining - Math.Max(0, inFlightAfterAck); 748this.windowSize = Math.Min(this.maxWindowSize, Math.Min(this.slowStartThreshold + 1, this.windowSize + (int)slide)); 753sendBeginIndex = Math.Max(0, (int)oldWindowEnd - (int)this.windowStart); 760int segmentSize = Math.Max(1, (this.lossWindowSize - this.slowStartThreshold) / 8); 766this.windowSize = Math.Min(this.maxWindowSize, this.windowSize + 1); 769sendBeginIndex = Math.Max(0, (int)oldWindowEnd - (int)this.windowStart); 772int sendEndIndex = Math.Min(this.windowSize, this.window.Count); 837now = Math.Max(now, lastAttemptTime); 840this.serrRtt = Math.Min(this.serrRtt + ((Math.Abs(error) - this.serrRtt) >> Constants.Gain), Constants.MaxSerrRtt); 841this.meanRtt = Math.Min(this.meanRtt + (error >> Constants.Gain), Constants.MaxMeanRtt); 842this.timeout = Math.Max(((200 << Constants.TimeMultiplier) * 2) + this.meanRtt, this.meanRtt + (this.serrRtt << Constants.ChebychevFactor));
System\ServiceModel\Channels\WebSocketHelper.cs (1)
73return Math.Max(WebSocketDefaults.MinReceiveBufferSize, effectiveMaxReceiveBufferSize);
System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (2)
542this.receiveBufferSize = Math.Min(WebSocketHelper.GetReceiveBufferSize(this.maxReceivedMessageSize), this.maxBufferSize); 682int newSize = (int)Math.Min(((double)internalBuffer.Length) * 2, this.maxBufferSize);
System\ServiceModel\Description\DispatcherBuilder.cs (1)
783transactedBatchSize = System.Math.Min(transactedBatchSize, batchBehavior.MaxBatchSize);
System\ServiceModel\Dispatcher\ClientRuntime.cs (1)
333max = System.Math.Max(max, this.operations[i].ParameterInspectors.Count);
System\ServiceModel\Dispatcher\DispatchRuntime.cs (4)
671max = System.Math.Max(max, this.operations[i].CallContextInitializers.Count); 673max = System.Math.Max(max, this.unhandled.CallContextInitializers.Count); 689max = System.Math.Max(max, this.operations[i].ParameterInspectors.Count); 691max = System.Math.Max(max, this.unhandled.ParameterInspectors.Count);
System\ServiceModel\Dispatcher\FlowThrottle.cs (1)
42this.warningRestoreLimit = (int)Math.Floor(0.7 * (double)capacity);
System\ServiceModel\Dispatcher\QueryFunctions.cs (5)
926context.SetValue(context, arg.basePtr, Math.Ceiling(context.PeekDouble(arg.basePtr))); 954context.SetValue(context, arg.basePtr, Math.Floor(context.PeekDouble(arg.basePtr))); 1157int startAt = ((int)Math.Round(context.PeekDouble(arg2.basePtr))) - 1; 1181int startAt = ((int)Math.Round(context.PeekDouble(argStartAt.basePtr))) - 1; 1186int length = (int)Math.Round(context.PeekDouble(argLimit.basePtr));
System\ServiceModel\Dispatcher\QueryModel.cs (2)
918return (-0.5 <= val && val <= 0.0) ? Math.Round(val) : Math.Floor(val + 0.5);
System\ServiceModel\Security\SendSecurityHeader.cs (1)
407int keyLength = Math.Max(128, this.AlgorithmSuite.DefaultSymmetricKeyLength);
System\ServiceModel\Security\SymmetricSecurityProtocol.cs (1)
240int keyLength = Math.Max(128, this.Factory.OutgoingAlgorithmSuite.DefaultSymmetricKeyLength);
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.Activities (2)
System\ServiceModel\Activities\Dispatcher\BufferedReceiveManager.cs (1)
388this.warningRestoreLimit = (int)Math.Floor(0.7 * (double)maxPendingMessagesPerChannel);
System\ServiceModel\Activities\Dispatcher\PersistenceProviderDirectory.cs (1)
1396this.warningRestoreLimit = (int)Math.Floor(0.7 * (double)maxCount);
System.ServiceModel.Channels (11)
System\ServiceModel\Channels\UdpChannelFactory.cs (1)
45int maxBufferSize = (int)Math.Min(transportBindingElement.MaxReceivedMessageSize, UdpConstants.MaxMessageSizeOverIPv4);
System\ServiceModel\Channels\UdpChannelListener.cs (1)
64int maxBufferSize = (int)Math.Min(udpTransportBindingElement.MaxReceivedMessageSize, UdpConstants.MaxMessageSizeOverIPv4);
System\ServiceModel\Channels\UdpOutputChannel.cs (1)
551this.CurrentDelay = Math.Min(this.CurrentDelay * 2, this.maxDelay);
System\ServiceModel\Channels\UdpRetransmissionSettings.cs (4)
267long diff = Math.Abs(ts1.Ticks - ts2.Ticks); 268long max = Math.Max(Math.Abs(ts1.Ticks), Math.Abs(ts2.Ticks));
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\UdpBinding.cs (2)
53this.MaxRetransmitCount = Math.Max(transport.RetransmissionSettings.MaxUnicastRetransmitCount, transport.RetransmissionSettings.MaxMulticastRetransmitCount); 92return Math.Max(this.udpTransport.RetransmissionSettings.MaxUnicastRetransmitCount, this.udpTransport.RetransmissionSettings.MaxMulticastRetransmitCount);
System.ServiceModel.Internals (3)
System\Runtime\BackoffTimeoutHelper.cs (1)
103return Ticks.ToTimeSpan(Math.Max(
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 (3)
System\ServiceModel\Description\WCFServiceClientProxyGenerator.cs (1)
212length = Math.Min(MaxIdentifierLength, length);
System\ServiceModel\Dispatcher\HelpExampleGenerator.cs (2)
524int hours = Math.Abs(ts.Hours); 526int minutes = Math.Abs(ts.Minutes);
System.Web (37)
Cache\SqlCacheDependency.cs (2)
798timeout = Math.Max(context.Timeout.Seconds / 3, 30); 1018timeout = Math.Max(context.Timeout.Seconds / 3, 30);
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 (4)
112_MemUsageLastReported = (int) Math.Min(Int32.MaxValue, Math.Max(0, memInKB)); // Make sure its within 0 and Int32.MaxValue 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 (2)
174_burstWaitTimeMs = Math.Min(_burstWaitTimeMs, _urgentFlushIntervalMs); 401toFlush = Math.Min(_buffer.Count, max);
Management\WebEvents.cs (2)
1065set { _level = Math.Max(value, 0); } 1070set { _tabSize = Math.Max(value, 0); }
Security\AntiXss\EncoderUtil.cs (1)
38charsToAllocate = (int)Math.Min(upperBound, worstCaseTotalChars);
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\CreateUserWizard.cs (1)
2113int length = Math.Max(10, Membership.MinRequiredPasswordLength);
UI\WebControls\DataGrid.cs (1)
1371firstPage = Math.Max(1, lastPage - pageSetSize + 1);
UI\WebControls\DetailsView.cs (1)
1986firstPage = Math.Max(1, lastPage - pageSetSize + 1);
UI\WebControls\FormView.cs (1)
1686firstPage = Math.Max(1, lastPage - pageSetSize + 1);
UI\WebControls\GridView.cs (4)
2548firstPage = Math.Max(1, lastPage - pageSetSize + 1); 2921int expectedRowCount = Math.Max(0, rowCount - affectedRows); 2929expectedPageCount = Math.Max(1, (expectedRowCount + PageSize - 1) / PageSize); 2933_pageIndex = Math.Min(_pageIndex, expectedPageCount - 1);
UI\WebControls\MenuRendererStandards.cs (1)
193lastIndex = Math.Max(lastIndex, Menu._levelMenuItemStyles.Count);
UI\WebControls\SiteMapDataSource.cs (1)
229Provider.HintNeighborhoodNodes(node, Math.Abs(startingNodeOffset), 0);
UI\WebControls\TreeView.cs (1)
3366populatedNodes = new Dictionary<int, TreeNode>(Math.Min(logLength, 16)); // don't eagerly allocate the maximum dictionary size
UI\WebParts\WebPartManager.cs (2)
1927int guidHash = Math.Abs(Guid.NewGuid().GetHashCode()); 1940int guidHash = Math.Abs(Guid.NewGuid().GetHashCode());
Util\CultureUtil.cs (1)
35int lastIndex = Math.Min(cultureNames.Length, maxCount) - 1;
Util\ReadWriteSpinLock.cs (4)
261double randomBackoffFactor = s_backOffFactors[Math.Abs(threadId) % BACK_OFF_FACTORS_LENGTH]; 263baseSpins = Math.Min(LOCK_MAXIMUM_SPINS, baseSpins); 264baseSpins = Math.Max(baseSpins, LOCK_MINIMUM_SPINS); 324baseSpins = Math.Max(baseSpins, LOCK_MINIMUM_SPINS); //= max(baseSpins, LOCK_MINIMUM_SPINS);
System.Web.DataVisualization (1055)
Common\Annotation\AnnotationBase.cs (9)
2810 float maxAnchorOffsetAbs = Math.Max(anchorOffsetAbs.X, anchorOffsetAbs.Y); 2976 newX = Math.Pow( horizAxis.logarithmBase, newX ); 2979 newAnchorX = Math.Pow( horizAxis.logarithmBase, newAnchorX ); 2992 newRight = Math.Pow( horizAxis.logarithmBase, newRight ); 3001 newRight = Math.Pow( horizAxis.logarithmBase, newRight ); 3019 newY = Math.Pow( vertAxis.logarithmBase, newY ); 3022 newAnchorY = Math.Pow( vertAxis.logarithmBase, newAnchorY ); 3035 newBottom = Math.Pow( vertAxis.logarithmBase, newBottom ); 3044 newBottom = Math.Pow( vertAxis.logarithmBase, newBottom );
Common\Annotation\ArrowAnnotation.cs (3)
398 float arrowLength = (float)Math.Sqrt(deltaX * deltaX + deltaY * deltaY); 453 float angle = (float)(Math.Atan(deltaY / deltaX) * 180f / Math.PI);
Common\Annotation\CalloutAnnotation.cs (4)
832 float radius = Math.Min(rectanglePositionAbs.Width, rectanglePositionAbs.Height); 937 float size = Math.Min(rectanglePositionAbs.Width, rectanglePositionAbs.Height); 1170 SizeF size = new SizeF(Math.Abs(cloudCenterAbs.X - point.X), Math.Abs(cloudCenterAbs.Y - point.Y));
Common\Annotation\LineAnnotation.cs (4)
520 if(Math.Round(point1.X , 3) == Math.Round(point2.X, 3)) 525 else if(Math.Round(point1.Y , 3) == Math.Round(point2.Y, 3))
Common\Annotation\TextAnnotation.cs (4)
526 spacingScaleX = Math.Max(1f, spacingScaleX); 531 spacingScaleY = Math.Max(1f, spacingScaleY); 971 spacingScaleX = Math.Max(1f, spacingScaleX); 976 spacingScaleY = Math.Max(1f, spacingScaleY);
Common\Borders3D\EmbedBorder.cs (6)
863 areasRect.Width -= (float)Math.Min(areasRect.Width, relSizeLeftTop.Width + relSizeRightBottom.Width); 865 areasRect.Height -= (float)Math.Min(areasRect.Height, relSizeLeftTop.Height + relSizeRightBottom.Height); 939radius = (float)Math.Max(radius, 2f * resolution / 96.0f); 940 radius = (float)Math.Min(radius, rect.Width/2f); 941 radius = (float)Math.Min(radius, rect.Height/2f); 942 radius = (float)Math.Ceiling(radius);
Common\Borders3D\EmbossBorder.cs (6)
120 areasRect.Width -= (float)Math.Min(areasRect.Width, borderSize.Width * 2.5f); 126 areasRect.Height -= (float)Math.Min(areasRect.Height, borderSize.Height * 2.5f); 194 radius = (float)Math.Max(radius, 2f * resolution / 96.0f); 195 radius = (float)Math.Min(radius, rect.Width/2f); 196 radius = (float)Math.Min(radius, rect.Height/2f); 197 radius = (float)Math.Ceiling(radius);
Common\ChartTypes\AreaChart.cs (25)
297point1.X = (float)Math.Round(point1.X); 298point1.Y = (float)Math.Round(point1.Y); 299point2.X = (float)Math.Round(point2.X); 300point2.Y = (float)Math.Round(point2.Y); 306axisPos.X = (float)Math.Round(axisPos.X); 307axisPos.Y = (float)Math.Round(axisPos.Y); 937 if(Math.Round(firstPoint.xPosition, 3) == Math.Round(secondPoint.xPosition, 3) && 938 Math.Round(firstPoint.yPosition, 3) == Math.Round(secondPoint.yPosition, 3)) 973 float axisPosition = (float)Math.Round(VAxis.GetPosition(this.VAxis.Crossing), 3); 979 float minX = (float)Math.Min(firstPoint.xPosition, secondPoint.xPosition); 980 float minY = (float)Math.Min(firstPoint.yPosition, secondPoint.yPosition); 981 minY = (float)Math.Min(minY, axisPosition); 982 float maxX = (float)Math.Max(firstPoint.xPosition, secondPoint.xPosition); 983 float maxY = (float)Math.Max(firstPoint.yPosition, secondPoint.yPosition); 984 maxY = (float)Math.Max(maxY, axisPosition); 1120 if( (Math.Round((decimal)firstPoint.yPosition, 3) > (decimal)axisPosition + 0.001M && Math.Round((decimal)secondPoint.yPosition, 3) < (decimal)axisPosition - 0.001M) || 1121 (Math.Round((decimal)firstPoint.yPosition, 3) < (decimal)axisPosition - 0.001M && Math.Round((decimal)secondPoint.yPosition, 3) > (decimal)axisPosition + 0.001M) ) 1176 if(Math.Round(firstPoint.xPosition, 3) == Math.Round(secondPoint.xPosition, 3) && 1177 Math.Round(firstPoint.yPosition, 3) == Math.Round(secondPoint.yPosition, 3))
Common\ChartTypes\BarChart.cs (16)
721pixelSize = (int)Math.Max(size.Width, size.Height); 927rectLabel.Width -= (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 930rectLabel.X += (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 952rectLabel.Width -= (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 955rectLabel.X += (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 1946rectLabel.Width -= (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 1949rectLabel.X += (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 1971rectLabel.Width -= (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 1974rectLabel.X += (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 2100float angleXAxis = (float)Math.Atan( 2103angleXAxis = (float)Math.Round(angleXAxis * 180f / (float)Math.PI); 2283 double yMin1 = Math.Min(point1.yPosition, point1.height); 2284 double yMax1 = Math.Max(point1.yPosition, point1.height); 2285 double yMin2 = Math.Min(point2.yPosition, point2.height); 2286 double yMax2 = Math.Max(point2.yPosition, point2.height);
Common\ChartTypes\BoxPlotChart.cs (17)
390 point.positionRel = new PointF((float)xPosition, (float)Math.Min(high, low)); 439 rectSize.Height = (float)Math.Abs(rectSize.Y - vAxis.GetPosition( point.YValues[2] )); 491 double brightness = Math.Sqrt(point.Color.R * point.Color.R + point.Color.G * point.Color.G + point.Color.B * point.Color.B); 544 dashWidth = Math.Max(dashWidth, minSize.Width); 553 new PointF((float) Math.Min(rectSize.Right, curPosition + dashWidth), medianValue), 577 areaRect.Y = (float)Math.Min(high, low); 579 areaRect.Height = (float)Math.Max(high, low) - areaRect.Y; 643 high = Math.Min(high, currentValue); 1169 point.positionRel = new PointF((float)xPosition, (float)Math.Min(high, low)); 1227 rectSize.Height = (float)Math.Abs(rectSize.Y - points[2].Y); 1271 double brightness = Math.Sqrt(point.Color.R * point.Color.R + point.Color.G * point.Color.G + point.Color.B * point.Color.B); 1324 dashWidth = Math.Max(dashWidth, minSize.Width); 1333 new PointF((float) Math.Min(rectSize.Right, curPosition + dashWidth), medianValue), 1364 areaRect.Y = (float)Math.Min(high, low); 1366 areaRect.Height = (float)Math.Max(high, low) - areaRect.Y; 1449 DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index); 1797double percentPointIndexInteger = Math.Floor(percentPointIndex);
Common\ChartTypes\BubbleChart.cs (14)
226 _minAll = Math.Min(_minAll, CommonElements.ParseDouble(ser[CustomPropertyName.BubbleScaleMin])); 230 _maxAll = Math.Max(_maxAll, CommonElements.ParseDouble(ser[CustomPropertyName.BubbleScaleMax])); 286minSer = Math.Min(minSer, point.YValues[1]); 287maxSer = Math.Max(maxSer, point.YValues[1]); 304 _maxBubleSize = (float)(Math.Min(areaSize.Width, areaSize.Height) / (100.0/_maxPossibleBubbleSize)); 305 _minBubleSize = (float)(Math.Min(areaSize.Width, areaSize.Height) / (100.0/_minPossibleBubbleSize)); 365 minAll = Math.Min(minAll, CommonElements.ParseDouble(ser[CustomPropertyName.BubbleScaleMin])); 369 maxAll = Math.Max(maxAll, CommonElements.ParseDouble(ser[CustomPropertyName.BubbleScaleMax])); 408minSer = Math.Min(minSer, point.YValues[1]); 409maxSer = Math.Max(maxSer, point.YValues[1]); 413minimum = Math.Min(minimum, point.YValues[0]); 414maximum = Math.Max(maximum, point.YValues[0]); 418minimum = Math.Min(minimum, point.XValue); 419maximum = Math.Max(maximum, point.XValue);
Common\ChartTypes\ErrorBarChart.cs (12)
550 point.positionRel = new PointF((float)xPosition, (float)Math.Min(high, low)); 595 areaRect.Y = (float)Math.Min(high, low); 597 areaRect.Height = (float)Math.Max(high, low) - areaRect.Y; 701 DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index); 1301 point.positionRel = new PointF((float)xPosition, (float)Math.Min(high, low)); 1359 areaRect.Y = (float)Math.Min(high, low); 1361 areaRect.Height = (float)Math.Max(high, low) - areaRect.Y; 1477 DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index); 1723 errorAmount += Math.Pow(point.YValues[0] - mean, 2); 1727 errorAmount = param * Math.Sqrt(errorAmount/ ( pointNumber - 1 ) ); 1746 errorAmount += Math.Pow(point.YValues[0], 2); 1750 errorAmount = param * Math.Sqrt( errorAmount/( pointNumber * ( pointNumber - 1 ) ) ) / 2.0;
Common\ChartTypes\FastLineChart.cs (4)
308 double axesValuesPixelSizeX = Math.Abs(hAxis.PositionToValue(axesMin.Width + pixelSize.Width, false) - hAxis.PositionToValue(axesMin.Width, false)); 399 if( Math.Abs(xValue - xValuePrev) < axesValuesPixelSizeX) 632if (Math.Abs(firstPointX - secondPointX) > Math.Abs(firstPointY - secondPointY))
Common\ChartTypes\FastPointChart.cs (10)
309 double axesValuesPixelSizeX = Math.Abs(hAxis.PositionToValue(axesMin.Width + pixelSize.Width, false) - hAxis.PositionToValue(axesMin.Width, false)); 310 double axesValuesPixelSizeY = Math.Abs(vAxis.PositionToValue(axesMin.Height + pixelSize.Height, false) - vAxis.PositionToValue(axesMin.Height, false)); 336markerSize = (int)Math.Max(markerSize * graph.Graphics.DpiX / 96, markerSize * graph.Graphics.DpiY / 96); 376 if(Math.Abs(xValue - xValuePrev) < axesValuesPixelSizeX && 377 Math.Abs(yValue - yValuePrev) < axesValuesPixelSizeY) 520 (int)Math.Round(markerBounds.X, 0), 521 (int)Math.Round(markerBounds.Y, 0), 522 (int)Math.Round(markerBounds.Width, 0), 523 (int)Math.Round(markerBounds.Height, 0) ); 531 float crossLineWidth = (float)Math.Ceiling(markerSize/4F);
Common\ChartTypes\FunnelChart.cs (29)
681 float topRotationHeight = (float)( (startWidth / 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) ); 682 float bottomRotationHeight = (float)( (endWidth / 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) ); 995 float topRotationHeight = (float)( (startWidth / 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) ); 996 float bottomRotationHeight = (float)( (endWidth / 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) ); 1865 Math.Max(this._funnelNeckSize.Width/2f, (topDiameter + bottomDiameter) / 4f); 1884 Math.Max(this._funnelNeckSize.Width/2f, (topDiameter + bottomDiameter) / 4f); 2035 labelInfo.Position.Y += (float)( ( (segmentInfo.EndWidth + segmentInfo.StartWidth) / 4f) * Math.Sin(this._rotation3D / 180F * Math.PI) ); 2211 float topSpacing = (float)Math.Abs( (plotAreaPositionAbs.Width/ 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) ); 2212 float bottomSpacing = (float)Math.Abs( (plotAreaPositionAbs.Width/ 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) ); 2246 float minSize = Math.Min(2f, this.funnelSegmentGap / 2f); 2639 percentages[loop] = Math.Sqrt((2 * sumArea) / baseRatio); 2655 this._yValueMax = Math.Max(this._yValueMax, yValue); 2763 yValue = Math.Abs(Math.Log( yValue, this.Area.AxisY.LogarithmBase )); 2767 yValue = Math.Abs( yValue ); 2786 return Math.Abs(Math.Log( point.XValue, this.Area.AxisX.LogarithmBase )); 2788 return Math.Abs(point.XValue); 2954 startWidth = (float)Math.Abs( plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f - 2956 endWidth = (float)Math.Abs( plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f -
Common\ChartTypes\KagiChart.cs (9)
417 else if( Math.Abs(dataPoint.YValues[yValueIndex] - prevClose) < reversalAmount) 541 point1.X = (float)Math.Round(point1.X); 542 point1.Y = (float)Math.Round(point1.Y); 543 point2.X = (float)Math.Round(point2.X); 544 point2.Y = (float)Math.Round(point2.Y); 545 point3.X = (float)Math.Round(point3.X); 546 point3.Y = (float)Math.Round(point3.Y); 549 point4.X = (float)Math.Round(point4.X); 550 point4.Y = (float)Math.Round(point4.Y);
Common\ChartTypes\LineChart.cs (29)
434 if( Math.Abs(dataPointPos[pointIndex - 1].X - dataPointPos[pointIndex].X ) < minDifference ) 445 if( Math.Abs(dataPointPos[pointIndex - 1].Y - dataPointPos[pointIndex].Y ) < minDifference ) 879if (Math.Abs(first.X - second.X) > Math.Abs(first.Y - second.Y)) 908if (Math.Abs(first.X - second.X) > Math.Abs(first.Y - second.Y)) 987bool topBottomLine = (Math.Abs(pt2.Y - pt1.Y) > Math.Abs(pt2.X - pt1.X)); 1580 if(Math.Abs(secondPoint.index - firstPoint.index) != 1) 1667 decimal plotAreaPositionX = Math.Round((decimal)area.PlotAreaPosition.X, decimals); 1668 decimal plotAreaPositionY = Math.Round((decimal)area.PlotAreaPosition.Y, decimals); 1669 decimal plotAreaPositionRight = Math.Round((decimal)area.PlotAreaPosition.Right, decimals); 1670 decimal plotAreaPositionBottom = Math.Round((decimal)area.PlotAreaPosition.Bottom, decimals); 1679 firstPoint.xPosition = Math.Round(firstPoint.xPosition, decimals); 1680 firstPoint.yPosition = Math.Round(firstPoint.yPosition, decimals); 1681 secondPoint.xPosition = Math.Round(secondPoint.xPosition, decimals); 1682 secondPoint.yPosition = Math.Round(secondPoint.yPosition, decimals); 2033 decimal plotAreaPositionX = Math.Round((decimal)area.PlotAreaPosition.X, decimals); 2034 decimal plotAreaPositionY = Math.Round((decimal)area.PlotAreaPosition.Y, decimals); 2035 decimal plotAreaPositionRight = Math.Round((decimal)area.PlotAreaPosition.Right, decimals); 2036 decimal plotAreaPositionBottom = Math.Round((decimal)area.PlotAreaPosition.Bottom, decimals); 2047 firstPoint.xPosition = Math.Round(firstPoint.xPosition, decimals); 2048 firstPoint.yPosition = Math.Round(firstPoint.yPosition, decimals); 2049 secondPoint.xPosition = Math.Round(secondPoint.xPosition, decimals); 2050 secondPoint.yPosition = Math.Round(secondPoint.yPosition, decimals); 2052 thirdPoint.X = (float)Math.Round(thirdPoint.X, decimals); 2053 thirdPoint.Y = (float)Math.Round(thirdPoint.Y, decimals); 2055 fourthPoint.X = (float)Math.Round(fourthPoint.X, decimals); 2056 fourthPoint.Y = (float)Math.Round(fourthPoint.Y, decimals);
Common\ChartTypes\PieChart.cs (132)
343 total += Math.Abs(dp.YValues[0]); 385 if(!dataPoint.IsEmpty && Math.Abs(dataPoint.YValues[0]) <= threshold) 389 collectedTotal += Math.Abs(dataPoint.YValues[0]); 735 sum += Math.Abs( point.YValues[0] ); 824 float sweepAngle = (float)( Math.Abs(point.YValues[0]) / sum * 360); 871 double xComponent = Math.Cos( midAngle * Math.PI / 180 ) * rectangle.Width / 10; 872 double yComponent = Math.Sin( midAngle * Math.PI / 180 ) * rectangle.Height / 10; 1034 point.positionRel.X = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * rectangle.Width * expShift / 2 + middlePoint.X; 1035 point.positionRel.Y = (float)Math.Sin( (midAngle) * Math.PI / 180 ) * rectangle.Height * expShift / 2 + middlePoint.Y; 1242 x = (float)Math.Cos( (startAngle + sweepAngle / 2) * Math.PI / 180 ) * width + middlePoint.X; 1243 y = (float)Math.Sin( (startAngle + sweepAngle / 2) * Math.PI / 180 ) * height + middlePoint.Y; 1309 float x1 = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * relativeSize.Width * expShift / 2 + middlePoint.X; 1310 float y1 = (float)Math.Sin( (midAngle) * Math.PI / 180 ) * relativeSize.Height * expShift / 2 + middlePoint.Y; 1312 float x2 = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * relativeSize.Width * shift * expShift + middlePoint.X; 1313 float y2 = (float)Math.Sin( (midAngle) * Math.PI / 180 ) * relativeSize.Height * shift * expShift + middlePoint.Y; 1333float y3 = (float)Math.Sin((midAngle) * Math.PI / 180) * relativeSize.Height * shift * expShift + middlePoint.Y; 1344x3 = (float)Math.Cos((midAngle) * Math.PI / 180) * relativeSize.Width * shift * expShift + middlePoint.X - relativeSize.Width / 10 * labelsHorizontalLineSize; 1361x3 = (float)Math.Cos((midAngle) * Math.PI / 180) * relativeSize.Width * shift * expShift + middlePoint.X + relativeSize.Width / 10 * labelsHorizontalLineSize; 1715 float y3 = (float)Math.Sin( (midAngle) * Math.PI / 180 ) * relativeSize.Height * shift * expShift + middlePoint.Y; 1720 x3 = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * relativeSize.Width * shift * expShift + middlePoint.X - relativeSize.Width / 10 * labelsHorizontalLineSize; 1724 x3 = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * relativeSize.Width * shift * expShift + middlePoint.X + relativeSize.Width / 10 * labelsHorizontalLineSize; 2270 SpreadInterval( startOfIntervals, endOfIntervals, index, Math.Floor( overlapRange / 2.0 ) ); 2425 sum += Math.Abs(point.YValues[0]); 2596 double xComponent = Math.Cos( midAngle * Math.PI / 180 ) * rectangle.Width / 10; 2597 double yComponent = Math.Sin( midAngle * Math.PI / 180 ) * rectangle.Height / 10; 3080 rectangle.X + (float)Math.Cos( 180 * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3081 rectangle.Y + (float)Math.Sin( 180 * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3086 rectangle.X + (float)Math.Cos( 180 * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3087 rectangle.Y + (float)Math.Sin( 180 * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3092 rectangle.X + (float)Math.Cos( 0 * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3093 rectangle.Y + (float)Math.Sin( 0 * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3098 rectangle.X + (float)Math.Cos( 0 * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3099 rectangle.Y + (float)Math.Sin( 0 * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3104 rectangle.X + (float)Math.Cos( startAngle * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3105 rectangle.Y + (float)Math.Sin( startAngle * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3110 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3111 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3116 rectangle.X + (float)Math.Cos( startAngle * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3117 rectangle.Y + (float)Math.Sin( startAngle * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3122 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3123 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3140 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3141 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3157 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Width * sizeOut / 2F + rectangle.Width / 2F, 3158 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Height * sizeOut / 2F + rectangle.Height / 2F, 3165 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Width * ( 1 + doughnutRadius ) / 4F + rectangle.Width / 2F, 3166 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Height * ( 1 + doughnutRadius ) / 4F + rectangle.Height / 2F, 3172 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Width * 0.5F / 2F + rectangle.Width / 2F, 3173 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Height * 0.5F / 2F + rectangle.Height / 2F, 3194 rectangle.X + (float)Math.Cos( 180 * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3195 rectangle.Y + (float)Math.Sin( 180 * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 3200 rectangle.X + (float)Math.Cos( 180 * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3201 rectangle.Y + (float)Math.Sin( 180 * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 3206 rectangle.X + (float)Math.Cos( 0 * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3207 rectangle.Y + (float)Math.Sin( 0 * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 3212 rectangle.X + (float)Math.Cos( 0 * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3213 rectangle.Y + (float)Math.Sin( 0 * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 3218 rectangle.X + (float)Math.Cos( startAngle * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3219 rectangle.Y + (float)Math.Sin( startAngle * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 3224 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3225 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 3230 rectangle.X + (float)Math.Cos( startAngle * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3231 rectangle.Y + (float)Math.Sin( startAngle * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 3236 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3237 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 4352 sum += Math.Abs(point.YValues[0]); 4392 sweepAngle = (float)( Math.Abs(point.YValues[0]) * 360 / sum ); 4959 angle = (float)Math.Atan( ( position.Y - _innerPlotPosition.Top - _innerPlotPosition.Height / 2) / ( position.X - _innerPlotPosition.Left - _innerPlotPosition.Width / 2 )); 4963 if( Math.Cos( angle ) == 0 ) 4969 correct = (float)(_innerPlotPosition.Width * 0.4 - _innerPlotPosition.Width * 0.4 / Math.Cos( angle )); 5146 if( Math.Abs( numEmptyUp - numEmptyDown ) < 2 ) 5240 numOfItems = Math.Max( numOfItems, maxNumOfRows ); 5321 maxSize = Math.Max( size.Width, maxSize ); 5322 maxSizeVertical = Math.Max( size.Height, maxSizeVertical );
Common\ChartTypes\PointAndFigureChart.cs (9)
586 numberOfBricks = (int)Math.Floor( 592 numberOfBricks = (int)Math.Floor( 599numberOfBricks = (int)Math.Floor( 616 numberOfBricks = (int)Math.Floor( 622 numberOfBricks = (int)Math.Floor( 629numberOfBricks = (int)Math.Floor( 748 double boxYSize = Math.Abs( 751 double boxXSize = Math.Abs( 810 boxSizeRel = Math.Abs(boxSizeRel -
Common\ChartTypes\PolarChart.cs (1)
160 sectorNumber = (int)(Math.Abs(max - min) / interval);
Common\ChartTypes\RadarChart.cs (1)
303 sectorNumber = (int)Math.Max(series.Points.Count, sectorNumber);
Common\ChartTypes\RangeChart.cs (12)
985if (Math.Abs(firstPoint.yPosition - (double)thirdPoint.Y) > smallDouble && 986Math.Abs(secondPoint.yPosition - (double)fourthPoint.Y) > smallDouble && 1104 float minX = (float)Math.Min(firstPoint.xPosition, secondPoint.xPosition); 1105 float minY = (float)Math.Min(firstPoint.yPosition, secondPoint.yPosition); 1106 minY = (float)Math.Min(minY, axisPosition); 1107 float maxX = (float)Math.Max(firstPoint.xPosition, secondPoint.xPosition); 1108 float maxY = (float)Math.Max(firstPoint.yPosition, secondPoint.yPosition); 1109 maxY = (float)Math.Max(maxY, axisPosition); 1157 firstPoint.xPosition = Math.Round(firstPoint.xPosition, 5); 1158 firstPoint.yPosition = Math.Round(firstPoint.yPosition, 5); 1159 secondPoint.xPosition = Math.Round(secondPoint.xPosition, 5); 1160 secondPoint.yPosition = Math.Round(secondPoint.yPosition, 5);
Common\ChartTypes\RenkoChart.cs (2)
466 numberOfBricks = (int)Math.Floor((dataPoint.YValues[yValueIndex] - prevHigh) / boxSize); 471 numberOfBricks = (int)Math.Floor((prevLow - dataPoint.YValues[yValueIndex]) / boxSize);
Common\ChartTypes\StackedAreaChart.cs (7)
186 _totalPerPoint[index] += Math.Abs(ser.Points[index].YValues[0]); 578 firstPoint.X = (float)Math.Round(firstPoint.X); 579 secondPoint.X = (float)Math.Round(secondPoint.X); 887 firstPoint.X = (float)Math.Round(firstPoint.X); 888 secondPoint.X = (float)Math.Round(secondPoint.X); 1006pointLabelValue = Math.Round(pointLabelValue, 2); 1492pointLabelValue = Math.Round(pointLabelValue, 2);
Common\ChartTypes\StackedBarChart.cs (15)
172 totals[index] += Math.Abs(ser.Points[index].YValues[0]); 482 float right = (float)Math.Ceiling(areaPosition.Right); 483 float bottom = (float)Math.Ceiling(areaPosition.Bottom); 484 areaPosition.X = (float)Math.Floor(areaPosition.X); 486 areaPosition.Y = (float)Math.Floor(areaPosition.Y); 759 yValue = Math.Log( yValue, hAxis.logarithmBase ); 849 barZeroValue = Math.Log( barZeroValue, hAxis.logarithmBase ); 961 yValue = Math.Pow( hAxis.logarithmBase, yValue ); 1055pointLabelValue = Math.Round(pointLabelValue, 2); 1711 yValue = Math.Log( yValue, hAxis.logarithmBase ); 1759 barZeroValue = Math.Log( barZeroValue, hAxis.logarithmBase ); 1826pointLabelValue = Math.Round(pointLabelValue, 2); 2012float angleXAxis = (float)Math.Atan( 2015angleXAxis = (float)Math.Round(angleXAxis * 180f / (float)Math.PI);
Common\ChartTypes\StackedColumnChart.cs (9)
165 totals[index] += Math.Abs(ser.Points[index].YValues[0]); 488 float right = (float)Math.Ceiling(areaPosition.Right); 489 float bottom = (float)Math.Ceiling(areaPosition.Bottom); 490 areaPosition.X = (float)Math.Floor(areaPosition.X); 492 areaPosition.Y = (float)Math.Floor(areaPosition.Y); 966 yValue = Math.Pow( vAxis.logarithmBase, yValue ); 1139pointLabelValue = Math.Round(pointLabelValue, 2); 1220absPosition.X = (float)Math.Ceiling(absPosition.X) + 1f; 1855pointLabelValue = Math.Round(pointLabelValue, 2);
Common\ChartTypes\StockChart.cs (12)
466 areaRect.Y = (float)Math.Min(high, low); 468 areaRect.Height = (float)Math.Max(high, low) - areaRect.Y; 622 DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index); 798 rect.Y = (float)Math.Min(open, close); 800 rect.Height = (float)Math.Max(open, close) - rect.Y; 1280 areaRect.Y = (float)Math.Min(high, low); 1282 areaRect.Height = (float)Math.Max(high, low) - areaRect.Y; 1360 DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index); 1623 rect.Y = (float)Math.Min(open, close); 1625 rect.Height = (float)Math.Max(open, close) - rect.Y; 1638 rect.Width = (float)Math.Abs(points[1].X - points[0].X); 1639 rect.Height = (float)Math.Abs(points[1].Y - points[0].Y);
Common\DataManager\DataManager.cs (43)
303 numberOfPoints = Math.Max(numberOfPoints, this._series[seriesName].Points.Count); 329 returnValue = Math.Max(returnValue, seriesPoint.YValues[valueIndex]); 359returnValue = Math.Max(returnValue, seriesPoint.YValues[0] + BubbleChart.AxisScaleBubbleSize(area.Common, area, seriesPoint.YValues[1], true)); 363returnValue = Math.Max(returnValue, seriesPoint.YValues[0]); 394returnValue = Math.Max(returnValue, seriesPoint.XValue + BubbleChart.AxisScaleBubbleSize(area.Common, area, seriesPoint.XValue, false)); 398returnValue = Math.Max(returnValue, seriesPoint.XValue); 429returnValue = Math.Min(returnValue, seriesPoint.XValue - BubbleChart.AxisScaleBubbleSize(area.Common, area, seriesPoint.YValues[1], false)); 433returnValue = Math.Min(returnValue, seriesPoint.XValue); 463 returnValue = Math.Max(returnValue, y); 483 returnValue = Math.Max(returnValue, seriesPoint.XValue); 503 max = Math.Max(max, seriesPoint.XValue); 504 min = Math.Min(min, seriesPoint.XValue); 533 max = Math.Max(max, yValue); 534 min = Math.Min(min, yValue); 565 max = Math.Max(max, y); 566 min = Math.Min(min, y); 598 max = Math.Max(max, y); 599 min = Math.Min(min, y); 641 noStackedMax = Math.Max(noStackedMax,this._series[seriesName].Points[pointIndex].YValues[valueIndex]); 645 stackedMax = Math.Max(stackedMax, noStackedMax); 646 returnValue = Math.Max(returnValue, stackedMax); 689noStackedMax = Math.Max(noStackedMax, this._series[seriesName].Points[pointIndex].YValues[valueIndex]); 693 maxValue = Math.Max(maxValue, noStackedMax); 694 returnValue = Math.Max(returnValue, maxValue); 721 returnValue = Math.Max(returnValue, doubleIndexValue); 747 returnValue = Math.Min(returnValue, seriesPoint.YValues[valueIndex]); 777returnValue = Math.Min(returnValue, seriesPoint.YValues[0] - BubbleChart.AxisScaleBubbleSize(area.Common, area, seriesPoint.YValues[1], true)); 781returnValue = Math.Min(returnValue, seriesPoint.YValues[0]); 811 returnValue = Math.Min(returnValue, y); 831 returnValue = Math.Min(returnValue, seriesPoint.XValue); 872 noStackedMin = Math.Min(noStackedMin,this._series[seriesName].Points[pointIndex].YValues[valueIndex]); 876 stackedMin = Math.Min(stackedMin, noStackedMin); 881 returnValue = Math.Min(returnValue, stackedMin); 927noStackedMin = Math.Min(noStackedMin, this._series[seriesName].Points[pointIndex].YValues[valueIndex]); 931 minValue = Math.Min(noStackedMin, minValue); 932returnValue = Math.Min(returnValue, minValue); 956 returnValue = Math.Min(returnValue, doubleIndexValue); 992 totalPerPoint += Math.Abs(ser.Points[pointIndex].YValues[0]); 1004 totalPerPoint = Math.Abs(totalPerPoint); 1009 returnValue = Math.Max(returnValue, 1052 totalPerPoint += Math.Abs(ser.Points[pointIndex].YValues[0]); 1065 totalPerPoint = Math.Abs(totalPerPoint); 1070 returnValue = Math.Min(returnValue,
Common\DataManager\DataPoint.cs (2)
2277 this._yValue[i] = Math.Floor(this._yValue[i]); 2281 this._yValue[i] = this._xValue - Math.Floor(this._yValue[i]);
Common\DataManager\DataSeries.cs (2)
1280keywordValue = Math.Max(keywordValue, point.YValues[yValueIndex]); 1292keywordValue = Math.Min(keywordValue, point.YValues[yValueIndex]);
Common\Formulas\Oscillator.cs (1)
124 int period = Math.Min(ExpAvg.Length,ExpAvgDistribution.Length);
Common\Formulas\PriceIndicators.cs (7)
492 tempPeriod = Math.Round(tempPeriod); 757 outputValues[1][point] = average[point] + Math.Sqrt(sum / period) * deviation; 758 outputValues[2][point] = average[point] - Math.Sqrt(sum / period) * deviation; 788 outputValues[1][point] = average[point] + Math.Sqrt(sum / period) * deviation; 789 outputValues[2][point] = average[point] - Math.Sqrt(sum / period) * deviation; 1048 outputValues[outIndex] = Math.Sqrt( sum / period ); 1066 outputValues[outIndex] = Math.Sqrt( sum / period );
Common\Formulas\StatisticalAnalysis.cs (27)
375 double correl = covar / Math.Sqrt( varianceX * varianceY ); 659 double dev = Math.Sqrt( variance1 / inputValues[1].Length + variance2 / inputValues[2].Length ); 812 T = ( mean1 - mean2 - HypothesizedMeanDifference ) / ( Math.Sqrt( s * ( 1.0 / inputValues[1].Length + 1.0 / inputValues[2].Length ) ) ); 822 freedom = (int)Math.Round(f); 824 s = Math.Sqrt( variance1 / inputValues[1].Length + variance2 / inputValues[2].Length ); 977 variance = Math.Sqrt( Variance( difference, true ) ); 979 double T = ( Math.Sqrt( inputValues[1].Length ) * ( mean - HypothesizedMeanDifference ) ) / variance; 1458 tmp -= ( x + 0.5 ) * Math.Log( tmp ); 1465 return -tmp + Math.Log( 2.5066282746310005 * sum / x ); 1476 return Math.Exp( GammLn( m ) + GammLn( n ) - GammLn( m + n ) ); 1500 if ( Math.Abs(d) < FPMIN ) d=FPMIN; 1512 if( Math.Abs(d) < FPMIN ) d=FPMIN; 1516 if( Math.Abs(c) < FPMIN ) c = FPMIN; 1528 if (Math.Abs(d) < FPMIN) d=FPMIN; 1532 if (Math.Abs(c) < FPMIN) c=FPMIN; 1541 if (Math.Abs(del-1.0) < EPS) 1562 return 0.398942280401433 * Math.Exp( -t * t / 2 ); 1583bt = Math.Exp(GammLn(a + b) - GammLn(a) - GammLn(b) + a * Math.Log(x) + b * Math.Log(1.0 - x)); 1819 outputValues[1][0] = Math.Exp( GammLn( m ) ); 1950 tValue = Math.Abs( tValue ); 1984 result = NormalDistributionFunction(zValue)/Math.Sqrt(1.0+zValue*zValue); 1993 result=1.0/(1+result*Math.Abs(zValue)); 2101 if ( Math.Abs(x) < 0.42 ) 2113 r = Math.Log( -Math.Log( r ) );
Common\Formulas\TechGeneralIndicators.cs (6)
179 distanceOne = Math.Abs( inputValues[1][index] - inputValues[2][index] ); 182 distanceTwo = Math.Abs( inputValues[3][index-1] - inputValues[1][index] ); 185 distanceTree = Math.Abs( inputValues[3][index-1] - inputValues[2][index] ); 188 trueRange[index-1] = Math.Max( Math.Max( distanceOne, distanceTwo ), distanceTree ); 772 sum += Math.Abs( movingAverage[index] - typicalPrice[indexSum] );
Common\Formulas\TimeSeriesAndForecasting.cs (19)
256error = Math.Sqrt(error); 266dev = Math.Sqrt(dev); 318 inputValues[1][index] = Math.Log( inputValues[1][index] ); 333 interval = Math.Abs( inputValues[0][0] - inputValues[0][inputValues[0].Length - 1] ) / ( inputValues[0].Length - 1 ); 340 inputValues[0][index] = Math.Log( inputValues[0][index] ); 368 interval = Math.Abs( inputValues[0][0] - inputValues[0][inputValues[0].Length - 1] ) / ( inputValues[0].Length - 1 ); 411 interval = Math.Abs( inputValues[0][0] - inputValues[0][inputValues[0].Length - 1] ) / ( inputValues[0].Length - 1 ); 437 inputValues[0][index] = Math.Log( inputValues[0][index] ); 438 inputValues[1][index] = Math.Log( inputValues[1][index] ); 456 mainDeterminant[i][k] += (double)Math.Pow( inputValues[0][j], (i+k) ); 471 coeffDeterminant[i][k] += (double)inputValues[1][j] * (double)Math.Pow( inputValues[0][j], k ); 493 outputValues[1][i]+= (double)coefficients[j]*Math.Pow(outputValues[0][i],j); 505 outputValues[1][i]= Math.Exp( coefficients[0] ) * Math.Exp( coefficients[1] * outputValues[0][i] ); 514 outputValues[0][i] = Math.Exp( inputValues[0][0] ) + i * logInterval; 516 outputValues[1][i]= coefficients[1] * Math.Log( outputValues[0][i] ) + coefficients[0]; 525 outputValues[0][i] = Math.Exp( inputValues[0][0] ) + i * logInterval; 527 outputValues[1][i]= Math.Exp( coefficients[0] ) * Math.Pow( outputValues[0][i], coefficients[1] );
Common\General\Axis.cs (125)
1972transformedTitlePosition.Width = Math.Abs(transformedTitlePosition.Width); 1977transformedTitlePosition.Height = Math.Abs(transformedTitlePosition.Height); 2353angleAxis = (float)Math.Atan( 2374angleAxis = -(float)Math.Atan( 2379angle += (int)Math.Round(angleAxis * 180f / (float)Math.PI); 2390dX = (float)(offset * Math.Cos(angleAxis)); 2395dX = (float)(offset * Math.Cos(angleAxis)); 2400dY = (float)(offset * Math.Cos(angleAxis)); 2401dX = (float)(offset * Math.Sin(angleAxis)); 2414dY = (float)(offset * Math.Cos(angleAxis)); 2415dX = (float)(offset * Math.Sin(angleAxis)); 3404this.titleSize = Math.Min(titleStringSize.Width, maxTitlesize); 3408this.titleSize = Math.Min(titleStringSize.Height, maxTitlesize); 3419 this.titleSize = Math.Min(titleStringSize.Width, maxTitlesize); 3423this.titleSize = Math.Min(titleStringSize.Height, maxTitlesize); 3483arrowSize = Math.Max(arrowSizePrimary.Height, arrowSizeSecondary.Height); 3488arrowSize = Math.Max(arrowSizePrimary.Width, arrowSizeSecondary.Width); 3532this.markSize += (float)Math.Max(majorTickSize, minorTickSize); 3542this.markSize = Math.Min(this.markSize, (plotArea.Height / 100F) * (Axis.maxAxisMarkSize / axesNumber)); 3548this.markSize = Math.Min(this.markSize, (plotArea.Width / 100F) * (Axis.maxAxisMarkSize / axesNumber)); 3599this.markSize = Math.Max(this.markSize, arrowSize - (this.markSize + this.scrollBarSize + this.titleSize)); 3600this.markSize = Math.Min(this.markSize, (plotArea.Width / 100F) * (Axis.maxAxisMarkSize / axesNumber)); 3719 size = (float)Math.Max(this.LabelAutoFitMaxFontSize, this.LabelAutoFitMinFontSize); 3720 _minLabelFontSize = Math.Min(this.LabelAutoFitMinFontSize, this.LabelAutoFitMaxFontSize); 3721 _aveLabelFontSize = _minLabelFontSize + Math.Abs(size - _minLabelFontSize)/2f; 3727size = (float)Math.Min(size, ChartArea.axesAutoFontSize); 4466 newInterval = Math.Round(oldInterval / 2.0); 4483 newInterval = Math.Round(oldInterval / 2.0); 4760 _minLabelFontSize = Math.Min(this.LabelAutoFitMinFontSize, this.LabelAutoFitMaxFontSize); 4765 Math.Max(this.LabelAutoFitMaxFontSize, this.LabelAutoFitMinFontSize), 4884float leftSideAngle = (float)(Math.Atan((textSize.Width / 2f) / plotAreaRadius) * 180f / Math.PI); 5157yValue = Math.Log(yValue, this.logarithmBase); 5302rect.X = (float)Math.Min(fromPosition, toPosition); 5303rect.Width = (float)Math.Max(fromPosition, toPosition) - rect.X; 5308rect.Y = (float)Math.Min(fromPosition, toPosition); 5309rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y; 5324axisLabelSize.Height = Math.Max(axisLabelSize.Height, imageRelSize.Height); 5340groupingLabelSizes[groupLevelIndex - 1] = (float)Math.Max(groupingLabelSizes[groupLevelIndex - 1], axisLabelSize.Height); 5346groupingLabelSizes[groupLevelIndex - 1] = (float)Math.Max(groupingLabelSizes[groupLevelIndex - 1], axisLabelSize.Width); 5350if (Math.Round(axisLabelSize.Width) >= Math.Round(rect.Width) && 5355if (Math.Round(axisLabelSize.Height) >= Math.Round(rect.Height) && 5411rect.Y = (float)Math.Min(fromPosition, toPosition); 5412rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y; 5497axisLabelSize.Width = Math.Max(axisLabelSize.Width, imageRelSize.Width); 5502axisLabelSize.Height = Math.Max(axisLabelSize.Height, imageRelSize.Height); 5527width = (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height; 5528width += (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width; 5530height = (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height; 5531height += (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width; 5535width = (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width; 5536width += (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height; 5538height = (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width; 5539height += (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height; 5664rect.Y = (float)Math.Min(fromPosition, toPosition); 5665rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y; 5699rect.Width = (float)Math.Ceiling(rect.Width); 5700rect.Height = (float)Math.Ceiling(rect.Height); 5732axisLabelSize.Width = Math.Max(axisLabelSize.Width, imageRelSize.Width); 5737axisLabelSize.Height = Math.Max(axisLabelSize.Height, imageRelSize.Height); 5757width = (float)Math.Cos((90 - Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width; 5758width += (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height; 5760height = (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height; 5761height += (float)Math.Sin((90 - Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width; 5764width = (float)Math.Ceiling(width) * 1.05f; 5765height = (float)Math.Ceiling(height) * 1.05f; 5766axisLabelSize.Width = (float)Math.Ceiling(axisLabelSize.Width) * 1.05f; 5767axisLabelSize.Height = (float)Math.Ceiling(axisLabelSize.Height) * 1.05f; 5775resultSize = Math.Max(resultSize, axisLabelSize.Height); 5776resultRotatedSize = Math.Max(resultRotatedSize, axisLabelSize.Height); 5779labelNearOffset = (float)Math.Min(labelNearOffset, (fromPosition + toPosition) / 2f - axisLabelSize.Width / 2f); 5780labelFarOffset = (float)Math.Max(labelFarOffset, (fromPosition + toPosition) / 2f + axisLabelSize.Width / 2f); 5785resultSize = Math.Max(resultSize, axisLabelSize.Height); 5786resultRotatedSize = Math.Max(resultRotatedSize, height); 5791labelFarOffset = (float)Math.Max(labelFarOffset, (fromPosition + toPosition) / 2f + width * 1.1f); 5795labelNearOffset = (float)Math.Min(labelNearOffset, (fromPosition + toPosition) / 2f - width * 1.1f); 5804resultSize = Math.Max(resultSize, axisLabelSize.Width); 5805resultRotatedSize = Math.Max(resultRotatedSize, axisLabelSize.Width); 5808labelNearOffset = (float)Math.Min(labelNearOffset, (fromPosition + toPosition) / 2f - axisLabelSize.Height / 2f); 5809labelFarOffset = (float)Math.Max(labelFarOffset, (fromPosition + toPosition) / 2f + axisLabelSize.Height / 2f); 5813resultSize = Math.Max(resultSize, axisLabelSize.Width); 5814resultRotatedSize = Math.Max(resultRotatedSize, width); 5819labelFarOffset = (float)Math.Max(labelFarOffset, (fromPosition + toPosition) / 2f + height * 1.1f); 5823labelNearOffset = (float)Math.Min(labelNearOffset, (fromPosition + toPosition) / 2f - height * 1.1f); 5891groupLabelLevel = Math.Max(groupLabelLevel, label.RowIndex); 5939axisLabelSize.Width = (float)Math.Ceiling(axisLabelSize.Width); 5940axisLabelSize.Height = (float)Math.Ceiling(axisLabelSize.Height); 5952 axisLabelSize.Height = Math.Max(axisLabelSize.Height, imageRelSize.Height); 5970resultSize[groupLevelIndex - 1] = Math.Max(resultSize[groupLevelIndex - 1], axisLabelSize.Height); 5977resultSize[groupLevelIndex - 1] = Math.Max(resultSize[groupLevelIndex - 1], axisLabelSize.Width); 6320if (Math.Abs(GetAxisPosition() - edgePosition) < 0.0015) 6434axisPoints[0].X = (float)Math.Round(axisPoints[0].X, 4); 6435axisPoints[0].Y = (float)Math.Round(axisPoints[0].Y, 4); 6436axisPoints[1].X = (float)Math.Round(axisPoints[1].X, 4); 6437axisPoints[1].Y = (float)Math.Round(axisPoints[1].Y, 4); 6443angle = Math.Atan((axisPoints[1].Y - axisPoints[0].Y) / (axisPoints[1].X - axisPoints[0].X)); 6447angle = Math.Atan((axisPoints[1].X - axisPoints[0].X) / (axisPoints[1].Y - axisPoints[0].Y)); 6451return (angle * 180.0) / Math.PI;
Common\General\AxisLabels.cs (10)
604 labValue = Math.Pow( this.logarithmBase, labValue ); 707 double inter = Math.Log(labelStyle.GetInterval()); 708 double valu = Math.Log(Math.Abs(labValue)); 709 int digits = (int)Math.Abs(inter)+5; 716 if( Math.Abs(inter) < Math.Abs(valu)-5 ) 718 labValue = Math.Round(labValue,digits); 729 labValue = Math.Pow( this.logarithmBase, labValue ); 807maxPointCount = Math.Max(maxPointCount, ser.Points.Count);
Common\General\AxisScale.cs (18)
658 return Math.Pow( this.logarithmBase, GetCrossing() ); 958 axisValue = Math.Log( axisValue, this.logarithmBase ); 1259 min = (double)( ((decimal)Math.Ceiling( min / inter ) - 1m ) * (decimal)inter ); 1274 max = (double)( ((decimal)Math.Floor( max / inter ) + 1m ) * (decimal)inter ); 1326 double tempDiff = diff / Math.Pow( power, step ); 1336 return tempDiff * Math.Pow( power, step ); 1576 return Math.Floor( years / 5 ); 1590 return (int)Math.Round((max - min) / current); 1938 viewMaximum = Math.Pow( this.logarithmBase, viewMaximum ); 1939 viewMinimum = Math.Pow( this.logarithmBase, viewMinimum ); 1971 axisInterval = Math.Round( axisInterval ); 1978 minimum = Math.Floor( minimum ); 2105 crossingValue = Math.Log( crossingValue, this.logarithmBase ); 2108 minimumValue = Math.Log( minimumValue, this.logarithmBase ); 2109 maximumValue = Math.Log( maximumValue, this.logarithmBase ); 2117 axisInterval = Math.Floor( diff ); 2179 axisInterval = Math.Floor( axisInterval / this.interval3DCorrection ); 2217 (double)((Math.Floor(numberOfUnits / axisInterval / margin * 100)+2) * axisInterval * margin / 100),
Common\General\AxisScaleBreaks.cs (7)
682 double minSize = Math.Min(this._minSegmentSize, Math.Floor(100.0 / axisSegments.Count)); 689 axisSegments[index].Size = Math.Round(((int)axisSegments[index].Tag) / (totalPointNumber / 100.0),5); 967numberOfPoints = Math.Max(numberOfPoints, series.Points.Count); 1011 int segmentIndex = (int)Math.Floor((dataPoint.YValues[yValueIndex] - minYValue) / segmentSize); 1032 segmentMaxValue[segmentIndex] = Math.Max(segmentMaxValue[segmentIndex], dataPoint.YValues[yValueIndex]); 1033 segmentMinValue[segmentIndex] = Math.Min(segmentMinValue[segmentIndex], dataPoint.YValues[yValueIndex]);
Common\General\AxisScaleSegments.cs (10)
414 size = Math.Min(size, breakPosition.Height); 418 size = Math.Min(size, breakPosition.Width); 697 breakPosition.Y = (float)Math.Min(from, to); 698 breakPosition.Height = (float)Math.Max(from, to); 702 breakPosition.X = (float)Math.Min(from, to); 703 breakPosition.Width = (float)Math.Max(from, to);; 712 breakPosition.Height = (float)Math.Abs(breakPosition.Y - breakPosition.Height); 718 breakPosition.Width = (float)Math.Abs(breakPosition.X - breakPosition.Width); 987 if( Math.Abs(this[index].ScaleMinimum - axisValue) < Math.Abs(axisValue - this[index - 1].ScaleMaximum))
Common\General\Chart.cs (10)
320image = new Bitmap(Math.Max(1,Width), Math.Max(1,Height)); 345float newResolution = Math.Max(resolution / 2, 96); 346Width = (int)Math.Ceiling(Width * newResolution / resolution); 347Height = (int)Math.Ceiling(Height * newResolution / resolution); 1623Bitmap image = new Bitmap(Math.Max(1,Width), Math.Max(1,Height)); 2178 int areaColumns = (int)Math.Floor(Math.Sqrt(areaNumber)); 2183 int areaRows = (int)Math.Ceiling(((float)areaNumber) / ((float)areaColumns));
Common\General\ChartArea.cs (37)
1540 axesAutoFontSize = Math.Min(axesAutoFontSize, axis.autoLabelFont.Size); 1708if (Math.Abs(offset) > plottingRect.Width * 0.3f) 1715rectLabelSideSpacing.X = (float)Math.Max(offset, rectLabelSideSpacing.X); 1722rectLabelSideSpacing.Width = (float)Math.Max(axis.labelFarOffset - Position.Right, rectLabelSideSpacing.Width); 1726rectLabelSideSpacing.Width = (float)Math.Max(plottingRect.Width * 0.3f, rectLabelSideSpacing.Width); 1736if (Math.Abs(offset) > plottingRect.Height * 0.3f) 1743rectLabelSideSpacing.Y = (float)Math.Max(offset, rectLabelSideSpacing.Y); 1750rectLabelSideSpacing.Height = (float)Math.Max(axis.labelFarOffset - Position.Bottom, rectLabelSideSpacing.Height); 1754rectLabelSideSpacing.Height = (float)Math.Max(plottingRect.Height * 0.3f, rectLabelSideSpacing.Height); 1797 float xTitleSize = (float)Math.Max(this.AxisY.titleSize, this.AxisY2.titleSize); 1803 float yTitleSize = (float)Math.Max(this.AxisX.titleSize, this.AxisX2.titleSize); 1844 (float)Math.Round((plottingRect.X - Position.X) / (Position.Width / 100F), 5), 1845 (float)Math.Round((plottingRect.Y - Position.Y) / (Position.Height / 100F), 5), 1846 (float)Math.Round(plottingRect.Width / (Position.Width / 100F), 5), 1847 (float)Math.Round(plottingRect.Height / (Position.Height / 100F), 5)); 1907 if(Math.Round(labelsPosition, 2) < Math.Round(axis.PlotAreaPosition.Bottom, 2)) 1956 if(Math.Round(labelsPosition, 2) < Math.Round(axis.PlotAreaPosition.Y, 2)) 2603 labelsSizeEstimate = (float)Math.Min(labelsSizeEstimate * 1.1f, plotAreaRectAbs.Width / 5f); 2618 labelsSize = (float)Math.Min(labelsSize, plotAreaRectAbs.Width / 2.5f); 2692 textSize.Width = (float)Math.Ceiling(textSize.Width * 1.1f); 2693 textSize.Height = (float)Math.Ceiling(textSize.Height * 1.1f); 2701 labelsSize = (float)Math.Max( 2710 float width = (float)Math.Cos(textAngle/180F*Math.PI) * textSize.Width; 2711 float height = (float)Math.Sin(textAngle/180F*Math.PI) * textSize.Width; 2712 width = (float)Math.Abs(Math.Ceiling(width)); 2713 height = (float)Math.Abs(Math.Ceiling(height)); 2724 labelsSize = (float)Math.Max( 2726 Math.Max(width, height)); 2751 labelsSize = (float)Math.Max( 2753 Math.Max(width, textSize.Height)); 2944 double scaleRatio = 360.0 / Math.Abs(this.AxisX.Maximum - this.AxisX.Minimum);
Common\General\ChartArea3D.cs (8)
1375 size = Math.Sqrt( 1982 double yMin1 = Math.Min(point1.yPosition, point1.height); 1983 double yMax1 = Math.Max(point1.yPosition, point1.height); 1984 double yMin2 = Math.Min(point2.yPosition, point2.height); 1985 double yMax2 = Math.Max(point2.yPosition, point2.height); 2123 Math.Abs(points[1].X - points[0].X) >= interval.Width) 2128 Math.Abs(points[1].Y - points[0].Y) >= interval.Height) 2133 Math.Abs(points[1].Z - points[0].Z) >= interval.Width)
Common\General\ChartAreaAxes.cs (11)
246axisX.SetInterval = Math.Abs(axisX.maximum - axisX.minimum) / 12.0; 1141 stackMaxBarColumn = Math.Max(stackMaxBarColumn, stackMaxBarColumnForGroup); 1142 stackMinBarColumn = Math.Min(stackMinBarColumn, stackMinBarColumnForGroup); 1143 stackMaxArea = Math.Max(stackMaxArea, stackMaxAreaForGroup); 1144 stackMinArea = Math.Min(stackMinArea, stackMinAreaForGroup); 1148 autoMaximum = Math.Max(stackMaxBarColumn,stackMaxArea); 1149 autoMinimum = Math.Min(stackMinBarColumn,stackMinArea); 1347 axisInterval = Math.Ceiling( axisInterval / axis.interval3DCorrection ); 1800 prevXValue = Math.Log(dataSeries.Points[0].XValue, logarithmicBase); 1811 curentXValue = Math.Log(point.XValue, logarithmicBase); 1837 double interval = Math.Abs( (double)seriesXValues[seriesIndex][ point - 1 ] - (double)seriesXValues[seriesIndex][ point ] );
Common\General\ChartElement.cs (6)
1170 int pointIndex = (int)Math.Ceiling(current - 1); 1322 date = date.AddMonths((int)Math.Floor(interval)); 1323 span = TimeSpan.FromDays(30.0 * ( interval - Math.Floor(interval) )); 1335 date = date.AddYears((int)Math.Floor(interval)); 1336 span = TimeSpan.FromDays(365.0 * ( interval - Math.Floor(interval) )); 1343 result = Math.Abs(result);
Common\General\ChartGraphics.cs (69)
259 (float)Math.Round(firstPoint.X), 260 (float)Math.Round(firstPoint.Y), 261 (float)Math.Round(secondPoint.X), 262 (float)Math.Round(secondPoint.Y) ); 474 angle = (float)(Math.Atan(rectangle.Width / rectangle.Height)* 180 / Math.PI); 478 angle = (float)(180 - Math.Atan(rectangle.Width / rectangle.Height)* 180 / Math.PI); 891this.DrawRectangle(new Pen(markerBorderColor, markerBorderSize), (int)Math.Round(rect.X, 0), (int)Math.Round(rect.Y, 0), (int)Math.Round(rect.Width, 0), (int)Math.Round(rect.Height, 0)); 897float crossLineWidth = (float)Math.Ceiling(markerSize / 4F); 1034float diamondSize = markerSize * (float)Math.Sin(45f / 180f * Math.PI); 2018offsetY = (float)Math.Sin((90 - angle) / 180F * Math.PI) * labelRect.Height / 2F; 2019offsetX = (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * labelRect.Height / 2F; 2073float sizeChange = truncateRect.Width / (float)Math.Cos(Math.Abs(angle) / 180F * Math.PI); 2076sizeChange -= labelRect.Height * (float)Math.Tan(Math.Abs(angle) / 180F * Math.PI); 2084sizeChange -= labelRect.Height * (float)Math.Tan(Math.Abs(angle) / 180F * Math.PI); 2420 absPositionRounded.Width = (int)Math.Round(absPosition.Right) - absPositionRounded.X; 2421 absPositionRounded.Height = (int)Math.Round(absPosition.Bottom) - absPositionRounded.Y; 2559 absPositionRounded.Width = (int)Math.Round(absPosition.Right) - absPositionRounded.X; 2560 absPositionRounded.Height = (int)Math.Round(absPosition.Bottom) - absPositionRounded.Y; 2572 leftLine[2].X = (float)Math.Round((double)center.X - labelSize.Width/2F - 1F); 2579 rightLine[2].X = (float)Math.Round((double)center.X + labelSize.Width/2F - 1F); 2681 return new Size( (int)Math.Ceiling(size.Width), (int)Math.Ceiling(size.Height)); 2697 return new Size( (int)Math.Ceiling(size.Width), (int)Math.Ceiling(size.Height)); 2972 gradientRect.Height = (float)Math.Floor(gradientRect.Height / 3f); 2976 gradientRect.X = gradientRect.Right - (float)Math.Floor(gradientRect.Width / 3f); 2977 gradientRect.Width = (float)Math.Floor(gradientRect.Width / 3f); 3000 gradientRect.Y = gradientRect.Bottom - (float)Math.Floor(gradientRect.Height / 3f); 3001 gradientRect.Height = (float)Math.Floor(gradientRect.Height / 3f); 3005 gradientRect.Width = (float)Math.Floor(gradientRect.Width / 3f); 3547imageRect.Width = Math.Min(fillRect.Width, imageAbsSize.Width); 3548imageRect.Height = Math.Min(fillRect.Height, imageAbsSize.Height); 3595 new Rectangle((int)Math.Round(imageRect.X),(int)Math.Round(imageRect.Y), (int)Math.Round(imageRect.Width), (int)Math.Round(imageRect.Height)), 3788 radius = (float)Math.Max(radius, 2f); 3789 radius = (float)Math.Min(radius, offset.Width/4f); 3790 radius = (float)Math.Min(radius, offset.Height/4f); 3791 radius = (float)Math.Ceiling(radius); 4270 new Rectangle((int)Math.Round(imageRect.X),(int)Math.Round(imageRect.Y), (int)Math.Round(imageRect.Width), (int)Math.Round(imageRect.Height)), 4568 new Rectangle((int)Math.Round(imageRect.X),(int)Math.Round(imageRect.Y), (int)Math.Round(imageRect.Width), (int)Math.Round(imageRect.Height)), 5135 float minSize = (float)Math.Min(position.Width, position.Height); 5192 float minSize = (float)Math.Min(position.Width, position.Height); 5570 float left = (float)Math.Round( (double)rect.Left ); 5571 float right = (float)Math.Round( (double)rect.Right ); 5572 float top = (float)Math.Round( (double)rect.Top ); 5573 float bottom = (float)Math.Round( (double)rect.Bottom );
Common\General\ChartGraphics3D.cs (85)
362 point1.X = Math.Min(point1.X, point2.X); 366 point1.X = Math.Max(point1.X, point2.X); 383 point1.Y = Math.Max(point1.Y, point2.Y); 432if (Math.Abs(points[0].X - points[1].X) > Math.Abs(points[0].Y - points[1].Y)) 1135 angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI); 1140 angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI); 1146 angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI); 1152 angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI); 1158 angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI); 1332 (float)Math.Round(frontLinePoint1.X), 1333 (float)Math.Round(frontLinePoint1.Y), 1334 (float)Math.Round(frontLinePoint2.X), 1335 (float)Math.Round(frontLinePoint2.Y) ); 1811 decimal plotAreaPositionX = Math.Round((decimal)area.PlotAreaPosition.X, decimals); 1812 decimal plotAreaPositionY = Math.Round((decimal)area.PlotAreaPosition.Y, decimals); 1813 decimal plotAreaPositionRight = Math.Round((decimal)area.PlotAreaPosition.Right, decimals); 1814 decimal plotAreaPositionBottom = Math.Round((decimal)area.PlotAreaPosition.Bottom, decimals); 2219 float minX = (float)Math.Min(points3D[0].X, points3D[1].X); 2220 float minY = (float)Math.Min(points3D[0].Y, points3D[1].Y); 2221 float maxX = (float)Math.Max(points3D[0].X, points3D[1].X); 2222 float maxY = (float)Math.Max(points3D[0].Y, points3D[1].Y); 2294 (float)Math.Round(polygonPoints[0].X), 2295 (float)Math.Round(polygonPoints[0].Y), 2296 (float)Math.Round(polygonPoints[1].X), 2297 (float)Math.Round(polygonPoints[1].Y) ); 2305 (float)Math.Round(polygonPoints[0].X), 2306 (float)Math.Round(polygonPoints[0].Y), 2307 (float)Math.Round(polygonPoints[1].X), 2308 (float)Math.Round(polygonPoints[1].Y)); 2329 (float)Math.Round(polygonPoints[3].X), 2330 (float)Math.Round(polygonPoints[3].Y), 2331 (float)Math.Round(polygonPoints[0].X), 2332 (float)Math.Round(polygonPoints[0].Y) ); 2340 (float)Math.Round(polygonPoints[3].X), 2341 (float)Math.Round(polygonPoints[3].Y), 2342 (float)Math.Round(polygonPoints[0].X), 2343 (float)Math.Round(polygonPoints[0].Y)); 2359 (float)Math.Round(polygonPoints[1].X), 2360 (float)Math.Round(polygonPoints[1].Y), 2361 (float)Math.Round(polygonPoints[2].X), 2362 (float)Math.Round(polygonPoints[2].Y) ); 2370 (float)Math.Round(polygonPoints[1].X), 2371 (float)Math.Round(polygonPoints[1].Y), 2372 (float)Math.Round(polygonPoints[2].X), 2373 (float)Math.Round(polygonPoints[2].Y)); 2390 (float)Math.Round(frontLinePoint1.X), 2391 (float)Math.Round(frontLinePoint1.Y), 2392 (float)Math.Round(frontLinePoint2.X), 2393 (float)Math.Round(frontLinePoint2.Y) ); 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); 2500 leftPoint = ChartGraphics.FindPointByIndex(points, Math.Max(firstPoint.index, secondPoint.index) + 1, (multiSeries) ? secondPoint : null, ref pointArrayIndex); 2551 rightPoint = ChartGraphics.FindPointByIndex(points, Math.Max(firstPoint.index, secondPoint.index) + 1, (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); 3249 gradientRect.Height = (float)Math.Floor(gradientRect.Height / 3f); 3253 gradientRect.X = gradientRect.Right - (float)Math.Floor(gradientRect.Width / 3f); 3254 gradientRect.Width = (float)Math.Floor(gradientRect.Width / 3f); 3305 gradientRect.Y = gradientRect.Bottom - (float)Math.Floor(gradientRect.Height / 3f); 3306 gradientRect.Height = (float)Math.Floor(gradientRect.Height / 3f); 3310 gradientRect.Width = (float)Math.Floor(gradientRect.Width / 3f); 4087 cylinderAngle = (float)Math.Atan( 4090 cylinderAngle = (float)Math.Round(cylinderAngle * 180f / (float)Math.PI); 4179 double centralLineAngle = ((cylinderAngle) * Math.PI / 180f); 4193 centralLinePoint.Y = (float)(Math.Tan(centralLineAngle) * centralLinePoint.X); 4194 centralLinePoint.Y += (float)(boundsRectMiddlePoint.Y - Math.Tan(centralLineAngle) * boundsRectMiddlePoint.X); 4199 centralLinePoint.X = (float)(centralLinePoint.Y - (boundsRectMiddlePoint.Y - Math.Tan(centralLineAngle) * boundsRectMiddlePoint.X)); 4200 centralLinePoint.X /= (float)(Math.Tan(centralLineAngle));
Common\General\DataManipulator.cs (11)
605 double fromX = Math.Min(fromXValue, toXValue); 606 double toX = Math.Max(fromXValue, toXValue); 621 toX = Math.Max(toX, ser.Points[ser.Points.Count - 1].XValue); 632 fromX = Math.Min(fromX, ser.Points[0].XValue); 2853 Math.Min(pointTempValues[functionInfo.outputIndex], point.YValues[funcIndex-1]); 2859 Math.Max(pointTempValues[functionInfo.outputIndex], point.YValues[funcIndex-1]); 2903 Math.Max(pointTempValues[functionInfo.outputIndex], point.YValues[funcIndex-1]); 2906 Math.Min(pointTempValues[functionInfo.outputIndex + 1], point.YValues[funcIndex-1]); 2984 Math.Pow(series.Points[secondPassIndex].YValues[funcIndex-1] - average, 2); 2995 Math.Sqrt(pointTempValues[functionInfo.outputIndex]); 3020 numberOfYValues = (int)Math.Max(numberOfYValues, series.YValuesPerPoint);
Common\General\GridTickMarks.cs (14)
408logInterval = Math.Log(1 + this.interval * logStep, Axis.logarithmBase); 501 RectangleF rect = new RectangleF( first.X - 0.5f, first.Y - 0.5f, Math.Abs( second.X - first.X ) + 1, Math.Abs( second.Y - first.Y ) + 1 ); 515 RectangleF rect = new RectangleF( first.X - 0.5f, first.Y - 0.5f, Math.Abs( second.X - first.X ) + 1, Math.Abs( second.Y - first.Y ) + 1 ); 576 return viewMinimum + Math.Floor( ( current - viewMinimum )); 750 RectangleF rect = new RectangleF( first.X - 0.5f, first.Y - 0.5f, Math.Abs( second.X - first.X ) + 1, Math.Abs( second.Y - first.Y ) + 1 ); 1387 double logInterval = Math.Log( 1 + this.interval * logStep, _axis.logarithmBase ); 1450 return viewMinimum + Math.Floor( ( current - viewMinimum )); 1498if (Math.Abs(first.X - second.X) > Math.Abs(first.Y - second.Y)) 1593if (Math.Abs(first.X - second.X) > Math.Abs(first.Y - second.Y))
Common\General\ImageMap.cs (7)
381if ((int)Math.Round(transformedCoord[0]) == (int)Math.Round(transformedCoord[2])) 383transformedCoord[2] = (float)Math.Round(transformedCoord[2]) + 1; 385if ((int)Math.Round(transformedCoord[1]) == (int)Math.Round(transformedCoord[3])) 387transformedCoord[3] = (float)Math.Round(transformedCoord[3]) + 1; 414tagStringBuilder.Append((int)Math.Round(f));
Common\General\Label.cs (14)
271 double fromX = Math.Min(min, max); 272 double toX = Math.Max(min, max); 1746rect.X = (float)Math.Min(fromPosition, toPosition); 1747rect.Width = (float)Math.Max(fromPosition, toPosition) - rect.X; 1759rect.Y = (float)Math.Min(fromPosition, toPosition); 1760rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y; 1837 rectLabels.Width = (float)Math.Max(rectLabels.Width, rectLabels.X - labelsAxis.PlotAreaPosition.X); 1861 rectLabels.Width = (float)Math.Max(rectLabels.Width, labelsAxis.PlotAreaPosition.Right - rectLabels.X); 1883 rectLabels.Height = (float)Math.Max(rectLabels.Height, rectLabels.Y - labelsAxis.PlotAreaPosition.Y); 1907 rectLabels.Height = (float)Math.Max(rectLabels.Height, labelsAxis.PlotAreaPosition.Bottom - rectLabels.Y); 2260rect.X = (float)Math.Min(fromPosition, toPosition); 2261rect.Width = (float)Math.Max(fromPosition, toPosition) - rect.X; 2277rect.Y = (float)Math.Min(fromPosition, toPosition); 2278rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y;
Common\General\Legend.cs (34)
453 this._offset.Width = (int)Math.Ceiling(singleWCharacterSize.Width / 2f); 454 this._offset.Height = (int)Math.Ceiling(singleWCharacterSize.Width / 3f); 477 Math.Min(legendPosition.Height, titleSize.Height)); 502 highestHeader.Height = Math.Max(highestHeader.Height, headerSize.Height); 514 Math.Min(legendPosition.Height - this._titlePosition.Height, highestHeader.Height)); 515 this._headerPosition.Height = Math.Max(this._headerPosition.Height, 0); 584 int newFontSize = (int)Math.Round(this.Font.Size - this._autoFitFontSizeAdjustment); 632 Math.Min(this._numberOfLegendItemsToProcess, this._numberOfRowsPerColumn[0]); 639 Math.Min(this._numberOfLegendItemsToProcess, this._itemColumns); 920 this._offset.Width = (int)Math.Ceiling(singleWCharacterSize.Width / 2f); 921 this._offset.Height = (int)Math.Ceiling(singleWCharacterSize.Width / 3f); 952 highestHeader.Height = Math.Max(highestHeader.Height, headerSize.Height); 1005 int newFontSize = (int)Math.Round(this.Font.Size - this._autoFitFontSizeAdjustment); 1027 horizSpaceLeft -= Math.Min(4, horizSpaceLeft); 1028 vertSpaceLeft -= Math.Min(2, vertSpaceLeft); 1035 optimalSize.Width = Math.Max(optimalSize.Width, titleSize.Width); 1332 averageColumnWidth = (int)Math.Round((double)(legendSize.Width - horSpaceLeft) / columnNumber) / 2; 1398 maxColumnHeight = Math.Max(maxColumnHeight, columnHeight); 1680 maxNumberOfColumns = Math.Max(maxNumberOfColumns, rowsPerColumn[columnIndex]); 1796 cellSize.Width = (int)Math.Max(cellSize.Width, legendColumn.MinimumWidth * singleWCharacterSize.Width / 100f); 1800 cellSize.Width = (int)Math.Min(cellSize.Width, legendColumn.MaximumWidth * singleWCharacterSize.Width / 100f); 1813 Math.Max(cellHeights[currentColumn, currentRow], cellSize.Height); 1869 width = Math.Max(width, cellWidth ); 1902 (int)Math.Max(subColumnSizes[currentColumn, currentSubColumn], legendColumn.MinimumWidth * singleWCharacterSize.Width / 100f); 1907 (int)Math.Min(subColumnSizes[currentColumn, currentSubColumn], legendColumn.MaximumWidth * singleWCharacterSize.Width / 100f); 1979 width = Math.Max(width, subColumnSizes[currentColumn, currentSubColumn]); 2019 totalHeight = Math.Max(totalHeight, columnHeight); 2056 this._numberOfCells = Math.Max(this._numberOfCells, legendItem.Cells.Count); 2537 step = (int)Math.Min(step, 10); 2541 this._legendItemsAreaPosition.X + this._legendItemsAreaPosition.Width / 2 - step * (float)Math.Floor(markerCount/2f), 4926 float areaSpacing = Math.Min((chartAreasRectangle.Height/100F) * elementSpacing, (chartAreasRectangle.Width/100F) * elementSpacing); 5028 float areaSpacing = Math.Min((legendPlottingRectangle.Height/100F) * elementSpacing, (legendPlottingRectangle.Width/100F) * elementSpacing); 6214int maxBorderWidth = (int)Math.Round((2 * dpi) / 96); 6228borderWidth <= (int)Math.Round(dpi / 96) )
Common\General\LegendColumns.cs (13)
1500 cellSize.Width = (int)(Math.Abs(this.SeriesSymbolSize.Width) * singleWCharacterSize.Width / 100f); 1501 cellSize.Height = (int)(Math.Abs(this.SeriesSymbolSize.Height) * singleWCharacterSize.Height / 100f); 1518 cellSize.Width = (int)(Math.Abs(this.ImageSize.Width) * singleWCharacterSize.Width / 100f); 1519 cellSize.Height = (int)(Math.Abs(this.ImageSize.Height) * singleWCharacterSize.Height / 100f); 1676 int newFontSize = (int)Math.Round(cellFont.Size - fontSizeReducedBy); 2137 scaleValue = Math.Max(scaleValue, (float)imagePosition.Width / (float)imageCellPosition.Width); 2307scaleValue = Math.Max(scaleValue, (float)imageScale.Width / (float)seriesMarkerPosition.Width); 2339int maxShadowOffset = (int)Math.Round((3 * chartGraph.Graphics.DpiX) / 96); 2340int maxBorderWidth = (int)Math.Round((3 * chartGraph.Graphics.DpiX) / 96); 2344int maxBorderWidthRect = (int)Math.Round((2 * chartGraph.Graphics.DpiX) / 96); 2407 int markerSize = (int)Math.Min(seriesMarkerPosition.Width, seriesMarkerPosition.Height); 2408 markerSize = (int)Math.Min(legendItem.markerSize, (legendItem.style == LegendImageStyle.Line) ? 2f*(markerSize/3f) : markerSize); 2448 scaleValue = Math.Max(scaleValue, (float)imageScale.Width / (float)seriesMarkerPosition.Width);
Common\General\Matrix3D.cs (47)
258 angleX = angleX / 180F * (float)Math.PI; 259 angleY = angleY / 180F * (float)Math.PI; 281 Rotate( Math.PI / 2, RotationAxis.Y ); 286 Rotate( -Math.PI / 2, RotationAxis.Y ); 329 if( point.X - _translateX < 0F && Math.Abs( point.X - _translateX ) > minX ) 330 minX = Math.Abs( point.X - _translateX ); 332 if( point.X - _translateX >=0F && Math.Abs( point.X - _translateX ) > maxX ) 333 maxX = Math.Abs( point.X - _translateX ); 335 if( point.Y - _translateY < 0F && Math.Abs( point.Y - _translateY ) > minY ) 336 minY = Math.Abs( point.Y - _translateY ); 338 if( point.Y - _translateY >=0F && Math.Abs( point.Y - _translateY ) > maxY ) 339 maxY = Math.Abs( point.Y - _translateY ); 357 if( maxXScale < Math.Abs(point.X - _translateX) / width * 2 ) 358 maxXScale = Math.Abs(point.X - _translateX) / width * 2; 361 if( maxYScale < Math.Abs(point.Y - _translateY) / height * 2 ) 362 maxYScale = Math.Abs(point.Y - _translateY) / height * 2; 728 rotationMatrix[1][1] = (float)Math.Cos( angle ); 729 rotationMatrix[1][2] = (float)-Math.Sin( angle ); 730 rotationMatrix[2][1] = (float)Math.Sin( angle ); 731 rotationMatrix[2][2] = (float)Math.Cos( angle ); 736 rotationMatrix[0][0] = (float)Math.Cos( angle ); 737 rotationMatrix[0][2] = (float)Math.Sin( angle ); 738 rotationMatrix[2][0] = (float)-Math.Sin( angle ); 739 rotationMatrix[2][2] = (float)Math.Cos( angle ); 744 rotationMatrix[0][0] = (float)Math.Cos( angle ); 745 rotationMatrix[0][1] = (float)-Math.Sin( angle ); 746 rotationMatrix[1][0] = (float)Math.Sin( angle ); 747 rotationMatrix[1][1] = (float)Math.Cos( angle ); 955 front = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[1])/Math.PI ); 957 back = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[2])/Math.PI ); 969 left = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[3])/Math.PI ); 971 right = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[4])/Math.PI ); 974 top = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[5])/Math.PI ); 976 bottom = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[6])/Math.PI ); 987 front = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[1])/Math.PI ); 989 back = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[2])/Math.PI ); 991 left = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[3])/Math.PI ); 993 right = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[4])/Math.PI ); 995 top = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[5])/Math.PI ); 997 bottom = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[6])/Math.PI ); 1113 if( Math.Abs( angleLeft - angleRight ) < 0.01 ) 1157 color = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[2])/Math.PI ); 1162 color = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[1])/Math.PI ); 1171 color = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,normalVector)/Math.PI ); 1215 angle = Math.Acos( ( a.X * b.X + a.Y * b.Y + a.Z * b.Z ) / ( Math.Sqrt( a.X * a.X + a.Y * a.Y + a.Z * a.Z ) * Math.Sqrt( b.X * b.X + b.Y * b.Y + b.Z * b.Z ) ) );
Common\General\SmartLabels.cs (2)
809 float minMove = (float)Math.Min(smartLabelStyle.MinMovingDistance, smartLabelStyle.MaxMovingDistance); 810 float maxMove = (float)Math.Max(smartLabelStyle.MinMovingDistance, smartLabelStyle.MaxMovingDistance);
Common\General\StripLine.cs (7)
369 rect.Y = (float)Math.Min(pos1, pos2); 370 rect.Height = (float)Math.Max(pos1, pos2) - rect.Y; 379 rect.X = (float)Math.Min(pos1, pos2); 380 rect.Width = (float)Math.Max(pos1, pos2) - rect.X; 786float angleXAxis = (float)Math.Atan( 789angleXAxis = (float)Math.Round(angleXAxis * 180f / (float)Math.PI);
Common\General\Title.cs (2)
2065 float areaSpacing = Math.Min((chartAreasRectangle.Height/100F) * elementSpacing, (chartAreasRectangle.Width/100F) * elementSpacing); 2198 float areaSpacing = Math.Min((titlePlottingRectangle.Height/100F) * elementSpacing, (titlePlottingRectangle.Width/100F) * elementSpacing);
System.Web.Extensions (1)
UI\WebControls\Dynamic.cs (1)
618typeof(Math),
System.Web.Mobile (10)
UI\MobileControls\Adapters\HtmlCalendarAdapter.cs (3)
129int deltaR = System.Math.Abs(backColor.R - 0xC0); 130int deltaG = System.Math.Abs(backColor.G - 0xC0); 131int deltaB = System.Math.Abs(backColor.B - 0xC0);
UI\MobileControls\Form.cs (3)
529int page = Math.Max(Math.Min(_currentPage, _pageCount), 1); 611this.LastPage = Math.Max(pager.PageCount, 1);
UI\MobileControls\ItemPager.cs (4)
67pager.RemainingWeight = Math.Max(0, pager.PageWeight - _lastPageItemCount * itemWeight); 84_fullPageItemCount = Math.Max(1, pager.PageWeight / itemWeight); 104_firstPageItemCount = Math.Min(_fullPageItemCount, itemCount); 110_lastPageItemCount = Math.Min(_fullPageItemCount, itemCount);
System.Windows.Forms (653)
misc\DpiHelper.cs (4)
429int dpiScalePercent = (int)Math.Round(LogicalToDeviceUnitsScalingFactor * 100); 508return (int)Math.Round(LogicalToDeviceUnitsScalingFactor * (double)value); 511return (int)Math.Round(scalingFactor * (double)value); 601var scaledValue = (int)Math.Round(value * pixelFactor);
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\WindowsFont.cs (1)
150int pixelsY = (int) Math.Ceiling( WindowsGraphicsCacheManager.MeasurementGraphics.DeviceContext.DpiY * size / 72); // 1 point = 1/72 inch.;
misc\GDI\WindowsGraphics2.cs (5)
91int sideLength = Math.Min(bounds.Width, bounds.Height); 347leftMargin = (int) Math.Ceiling(overhangPadding); 348rightMargin = (int) Math.Ceiling(overhangPadding * (1 + ItalicPaddingFactor)); 354leftMargin = (int) Math.Ceiling(2 * overhangPadding); 355rightMargin = (int) Math.Ceiling(overhangPadding * (2 + ItalicPaddingFactor));
winforms\Managed\System\WinForms\ButtonInternal\ButtonBaseAdapter.cs (20)
505size = System.Math.Min(size, System.Math.Min(r.Width, r.Height)); 985return Math.Max(checkSize, imageSize + textSize); 987return Math.Max(imageSize, textSize) + checkSize; 989return Math.Max(Math.Max(checkSize, imageSize), textSize); 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); 1422layout.textBounds.Y = Math.Max(layout.textBounds.Y, maxBounds.Y); 1427bottom = Math.Min(layout.textBounds.Bottom, layout.field.Bottom); 1428layout.textBounds.Y = Math.Max(layout.textBounds.Y, layout.field.Y);
winforms\Managed\System\WinForms\CheckBox.cs (1)
381size.Height = DpiHelper.EnableDpiChangedHighDpiImprovements ? Math.Max(size.Height + 5, flatSystemStyleMinimumHeight) : size.Height + 5; // ensure minimum height to avoid truncation of check-box or text
winforms\Managed\System\WinForms\CheckedListBox.cs (2)
687int centeringFactor = Math.Max((height - idealCheckSize) / 2, 0); 783if (Math.Abs(tabOffset) < tabDistance) {
winforms\Managed\System\WinForms\ColorDialog.cs (1)
145int length = value == null? 0: Math.Min(value.Length, 16);
winforms\Managed\System\WinForms\ColumnHeader.cs (2)
136int lowDI = Math.Min(this.DisplayIndexInternal, value); 137int hiDI = Math.Max(this.DisplayIndexInternal, value);
winforms\Managed\System\WinForms\ComboBox.cs (2)
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\ContainerControl.cs (1)
768retval.Width = (int)Math.Round(((float)size.cx) / ((float)fontMeasureString.Length));
winforms\Managed\System\WinForms\Control.cs (20)
6167int width = Math.Min(this.Width, targetBounds.Width); 6168int height = Math.Min(this.Height, targetBounds.Height); 6612sx = (int)Math.Round(bounds.X * dx); 6616sy = (int)Math.Round(bounds.Y * dy); 6628sw = (int)Math.Round(localWidth * dx) + adornmentWidth; 6633sh = (int)Math.Round(localHeight * dy) + adornmentHeight; 11510padding.Left = (int)Math.Round(padding.Left * dx); 11511padding.Right = (int)Math.Round(padding.Right * dx); 11512margins.Left = (int)Math.Round(margins.Left * dx); 11513margins.Right = (int)Math.Round(margins.Right * dx); 11517padding.Top = (int)Math.Round(padding.Top * dy); 11518padding.Bottom = (int)Math.Round(padding.Bottom * dy); 11519margins.Top = (int)Math.Round(margins.Top * dy); 11520margins.Bottom = (int)Math.Round(margins.Bottom * dy); 11583int sx = (int)Math.Round(x * dx); 11584int sy = (int)Math.Round(y * dy); 11588sw = (int)(Math.Round((x + width) * dx)) - sx; 11592sh = (int)(Math.Round((y + height) * dy)) - sy; 11624size.Width = (int)Math.Round((float)size.Width * x); 11627size.Height = (int)Math.Round((float)size.Height * y);
winforms\Managed\System\WinForms\ControlPaint.cs (5)
1910int minDim = Math.Min(width, height); 2825max = Math.Max( Math.Max(r,g), b); 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 (41)
1402vertScrollBar.Maximum = Math.Max(0, DataGridRowsLength - 1); 1689this.RowHeaderWidth = Math.Max(this.minRowHeaderWidth, this.RowHeaderWidth); 1691this.myGridTable.RowHeaderWidth = Math.Max(this.minRowHeaderWidth, this.RowHeaderWidth); 2768int rowCount = Math.Min(currentDataGridRows.Length, dataGridRows.Length); 2913value = Math.Max(this.minRowHeaderWidth, value); 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); 4126int upperRow = Math.Max(lastRowSelected, location.row); 4270int lowerRow = Math.Min(lastRowSelected, rowOver); 4271int upperRow = Math.Max(lastRowSelected, rowOver); 4386newRow = Math.Max(0, Math.Min(newRow, DataGridRowsLength - numTotallyVisibleRows)); 4704r.Y = Math.Min(inside.Bottom - 3, r.Y); 4705r.Y = Math.Max(r.Y , 0); 4712r.X = Math.Min(inside.Right - 3, r.X); 4713r.X = Math.Max(r.X , 0); 4932int x = rightToLeft ? Math.Max(e.X, layout.Data.X) : Math.Min(e.X, layout.Data.Right + 1); 4939proposed = Math.Max(proposed, 3); 5063resizeHeight = Math.Max(resizeHeight, columns[col].GetPreferredHeight(g, value)); 5135int y = Math.Min(e.Y, layout.Data.Y + layout.Data.Height + 1); 5140proposed = Math.Max(proposed, 3); 6227int lastCol = Math.Min(col, columns.Count); 6272nExpandableRows = Math.Max(nExpandableRows-1,0); 6344int lastRow = Math.Min(row, DataGridRowsLength); 6749int totalWidth = Math.Max(0, GetColumnWidthSum()); 6823horizScrollBar.LargeChange = Math.Max(totalWidth - widthNotVisible, 0); 6901for (int i = 0; i < Math.Min(newDataGridRowsLength, DataGridRowsLength); i++) { 7250int deflateValue = Math.Max(0,(textBounds.Height - 5) / 2); 7789CurrentRow = Math.Max(0, DataGridRowsLength - (policy.AllowAdd ? 2:1)); 7806CurrentRow = Math.Max(0, DataGridRowsLength - (policy.AllowAdd ? 2 : 1)); 7908CurrentRow = Math.Min(DataGridRowsLength - (policy.AllowAdd ? 2:1), currentRow + numTotallyVisibleRows); 7929CurrentRow = Math.Min(DataGridRowsLength - (policy.AllowAdd ? 2:1), 7942CurrentRow = Math.Max(0, CurrentRow - numTotallyVisibleRows); 7964CurrentRow = Math.Max(0, 8111CurrentRow = Math.Max(0, 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\DataGridBoolColumn.cs (2)
161return new Rectangle(Math.Max(0,bounds.X +((bounds.Width - idealCheckSize) /2)), 162Math.Max(0,bounds.Y +((bounds.Height - idealCheckSize) / 2)),
winforms\Managed\System\WinForms\DataGridCaption.cs (1)
482Math.Min(textWidthLeft, 2 * textPadding + textSize.Width),
winforms\Managed\System\WinForms\DataGridParentRows.cs (10)
364colsHeight = Math.Max(colsHeight, cols[j].GetMinimumHeight()); 366height = Math.Max(colsHeight, textRegionHeight); 589width = Math.Max(size, width); 608width = Math.Max(size, width); 627width = Math.Max(size, width); 638colNum = Math.Max(colNum, dgs.GridColumnStyles.Count); 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\DataGridRelationshipRow.cs (1)
646int paintedWidth = Math.Max(dataWidth, relRect.Width);
winforms\Managed\System\WinForms\DataGridRow.cs (2)
114h = Math.Max(h, columns[i].GetMinimumHeight()); 175height = Math.Max(0, value);
winforms\Managed\System\WinForms\DataGridTable.cs (3)
384focusedTextWidth = (int) Math.Ceiling(g.MeasureString(((string) RelationsList[focusedRelation]), DataGrid.LinkFont).Width); 918int rwidth = (int) Math.Ceiling(g.MeasureString(((string) this.RelationsList[r]), this.DataGrid.LinkFont).Width) 1176value = Math.Max(this.DataGrid.MinimumRowHeaderWidth(), value);
winforms\Managed\System\WinForms\DataGridViewButtonCell.cs (2)
427preferredSize.Width = Math.Max(preferredSize.Width, borderAndPaddingWidths + DATAGRIDVIEWCELL_iconMarginWidth * 2 + iconsWidth); 436preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + DATAGRIDVIEWCELL_iconMarginHeight * 2 + iconsHeight);
winforms\Managed\System\WinForms\DataGridViewCellStyle.cs (4)
438value.Left = Math.Max(0, value.Left); 439value.Right = Math.Max(0, value.Right); 440value.Top = Math.Max(0, value.Top); 441value.Bottom = Math.Max(0, value.Bottom);
winforms\Managed\System\WinForms\DataGridViewCheckBoxCell.cs (2)
853preferredSize.Width = Math.Max(preferredSize.Width, 858preferredSize.Height = Math.Max(preferredSize.Height,
winforms\Managed\System\WinForms\DataGridViewColumnHeaderCell.cs (7)
559Math.Max(1, constraintSize.Height - borderAndPaddingHeights - 2 * DATAGRIDVIEWCOLUMNHEADERCELL_verticalMargin), 583preferredSize.Width = Math.Max(preferredSize.Width, 1); 648preferredSize.Height = Math.Max(preferredSize.Height, glyphSize.Height); 649preferredSize.Height = Math.Max(preferredSize.Height, 1); 678preferredSize.Height = Math.Max(preferredSize.Height, sortGlyphHeight); 680preferredSize.Width = Math.Max(preferredSize.Width, 1); 681preferredSize.Height = Math.Max(preferredSize.Height, 1);
winforms\Managed\System\WinForms\DataGridViewComboBoxCell.cs (7)
761dropHeight = Math.Min(GetDropDownButtonHeight(g, cellStyle), adjustedSize.Height - 2); 764int dropWidth = Math.Min(SystemInformation.HorizontalScrollBarThumbWidth, adjustedSize.Width - 2 * DATAGRIDVIEWCOMBOBOXCELL_margin - 1); 1470preferredSize.Width = Math.Max(preferredSize.Width, borderAndPaddingWidths + SystemInformation.HorizontalScrollBarThumbWidth + 1 + DATAGRIDVIEWCELL_iconMarginWidth * 2 + iconsWidth); 1487preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + DATAGRIDVIEWCELL_iconMarginHeight * 2 + iconsHeight); 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 (2)
706int lo = Math.Min(e.OldIndex, e.NewIndex); 707int hi = Math.Max(e.OldIndex, e.NewIndex);
winforms\Managed\System\WinForms\DataGridViewImageCell.cs (6)
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); 587preferredSize.Width = Math.Max(preferredSize.Width, borderAndPaddingWidths + DATAGRIDVIEWCELL_iconMarginWidth * 2 + iconsWidth); 596preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + DATAGRIDVIEWCELL_iconMarginHeight * 2 + iconsHeight);
winforms\Managed\System\WinForms\DataGridViewLinkCell.cs (4)
687Math.Max(1, maxHeight), 698Math.Max(1, constraintSize.Width - borderAndPaddingWidths - DATAGRIDVIEWLINKCELL_horizontalTextMarginLeft - DATAGRIDVIEWLINKCELL_horizontalTextMarginRight), 743preferredSize.Width = Math.Max(preferredSize.Width, borderAndPaddingWidths + DATAGRIDVIEWCELL_iconMarginWidth * 2 + iconsWidth); 756preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + DATAGRIDVIEWCELL_iconMarginHeight * 2 + iconsHeight);
winforms\Managed\System\WinForms\DataGridViewMethods.cs (87)
675dataGridViewColumnTmp.UsedFillWeight = Math.Max(dataGridViewColumnTmp.FillWeight * usedWeightSumNoneMinimal / weightSumNoneMinimal, 841dataGridViewColumnTmp.UsedFillWeight = Math.Max(dataGridViewColumnTmp.FillWeight * usedWeightSumNoneMinimal / weightSumNoneMinimal, 1006dataGridViewColumn.DesiredFillWidth = (int)Math.Round(desiredFillWidth, MidpointRounding.AwayFromZero); 1121int widthLoss = Math.Min(stepDownAvailableWidthForFillColumns - availableWidth, Math.Max(1, (int)(stepDownAvailableWidthForFillColumns * 0.1F))); 1152mostDeservingDataGridViewColumn.DesiredFillWidth = Math.Min(oldDesiredWidth, (int)Math.Round(floatDesiredWidth, MidpointRounding.AwayFromZero)); 1203mostDeservingDataGridViewColumn.DesiredFillWidth = Math.Max(availableWidth - usedWidth, mostDeservingDataGridViewColumn.MinimumWidth); 1212weightDiscrepancy = Math.Abs(dataGridViewColumn.UsedFillWeight - dataGridViewColumn.FillWeight) / dataGridViewColumn.FillWeight; 1220mostDeservingDataGridViewColumn.DesiredFillWidth = Math.Max(mostDeservingDataGridViewColumn.MinimumWidth, (int)Math.Round(floatDesiredWidth, MidpointRounding.AwayFromZero)); 1759preferredHeight = Math.Max(preferredHeight, this.Columns[columnIndex].HeaderCell.GetPreferredHeight(-1, this.Columns[columnIndex].Thickness)); 1763preferredHeight = Math.Max(preferredHeight, this.Columns[columnIndex].HeaderCell.GetPreferredSize(-1).Height); 1832preferredHeight = Math.Max(preferredHeight, this.Columns[columnIndexTmp].HeaderCell.GetPreferredHeight(-1, this.Columns[columnIndexTmp].Thickness)); 1836preferredHeight = Math.Max(preferredHeight, this.Columns[columnIndexTmp].HeaderCell.GetPreferredSize(-1).Height); 2034preferredWidth = Math.Max(preferredWidth, this.Rows.SharedRow(rowIndex).HeaderCell.GetPreferredWidth(rowIndex, this.Rows.SharedRow(rowIndex).GetHeight(rowIndex))); 2038preferredWidth = Math.Max(preferredWidth, this.Rows.SharedRow(rowIndex).HeaderCell.GetPreferredSize(rowIndex).Width); 2054preferredWidth = Math.Max(preferredWidth, dataGridViewRow.HeaderCell.GetPreferredWidth(rowIndex, dataGridViewRowHeight)); 2058preferredWidth = Math.Max(preferredWidth, dataGridViewRow.HeaderCell.GetPreferredSize(rowIndex).Width); 2073preferredWidth = Math.Max(preferredWidth, dataGridViewRow.HeaderCell.GetPreferredWidth(rowIndex, dataGridViewRowHeight)); 2077preferredWidth = Math.Max(preferredWidth, dataGridViewRow.HeaderCell.GetPreferredSize(rowIndex).Width); 2092preferredWidth = Math.Max(preferredWidth, this.Rows.SharedRow(rowIndex).HeaderCell.GetPreferredWidth(rowIndex, this.Rows.SharedRow(rowIndex).GetHeight(rowIndex))); 2096preferredWidth = Math.Max(preferredWidth, this.Rows.SharedRow(rowIndex).HeaderCell.GetPreferredSize(rowIndex).Width); 2207preferredWidth = Math.Max(preferredWidth, this.Rows.SharedRow(rowIndexTmp).HeaderCell.GetPreferredWidth(rowIndexTmp, this.Rows.SharedRow(rowIndexTmp).GetHeight(rowIndexTmp))); 2211preferredWidth = Math.Max(preferredWidth, this.Rows.SharedRow(rowIndexTmp).HeaderCell.GetPreferredSize(rowIndexTmp).Width); 2227preferredWidth = Math.Max(preferredWidth, dataGridViewRow.HeaderCell.GetPreferredWidth(rowIndexTmp, dataGridViewRowHeight)); 2231preferredWidth = Math.Max(preferredWidth, dataGridViewRow.HeaderCell.GetPreferredSize(rowIndexTmp).Width); 2246preferredWidth = Math.Max(preferredWidth, dataGridViewRow.HeaderCell.GetPreferredWidth(rowIndexTmp, dataGridViewRowHeight)); 2250preferredWidth = Math.Max(preferredWidth, dataGridViewRow.HeaderCell.GetPreferredSize(rowIndexTmp).Width); 2265preferredWidth = Math.Max(preferredWidth, this.Rows.SharedRow(rowIndexTmp).HeaderCell.GetPreferredWidth(rowIndexTmp, this.Rows.SharedRow(rowIndexTmp).GetHeight(rowIndexTmp))); 2269preferredWidth = Math.Max(preferredWidth, this.Rows.SharedRow(rowIndexTmp).HeaderCell.GetPreferredSize(rowIndexTmp).Width); 2494cursorClip.Width = Math.Min(frozenWidth, this.layout.Data.Width); 2507cursorClip.Width = Math.Min(scrollingWidth, this.layout.Data.Width); 3026r.X = Math.Max(inside.Left, r.X); 3027r.X = Math.Min(r.X, inside.Right - r.Width); 3032r.X = Math.Min(inside.Right - r.Width, r.X); 3033r.X = Math.Max(r.X, inside.Left); 3044r.X = Math.Max(inside.Left, r.X); 3048r.X = Math.Min(inside.Right - 3, r.X); 3049r.X = Math.Max(r.X, 0); 3058r.Y = Math.Min(inside.Bottom - 3, r.Y); 3059r.Y = Math.Max(r.Y, 0); 4358colHeaders.Height = Math.Min(this.columnHeadersHeight, colHeaders.Height); 4372rowHeaders.Width = Math.Min(this.rowHeadersWidth, rowHeaders.Width); 4390topLeft.Width = Math.Min(this.rowHeadersWidth, topLeft.Width); 4508int oldThumbHeight = Math.Max(((this.vertScrollBar.Height - 2*SystemInformation.VerticalScrollBarArrowHeight) * this.vertScrollBar.LargeChange) / this.vertScrollBar.Maximum, 8); 4518oldThumbHeight != Math.Max(((this.vertScrollBar.Height - 2*SystemInformation.VerticalScrollBarArrowHeight) * this.vertScrollBar.LargeChange) / this.vertScrollBar.Maximum, 8))) 5722rectInsertionBar.X = Math.Max(this.layout.ColumnHeaders.X, 5727rectInsertionBar.X = Math.Min(GetColumnXFromIndex(this.trackColumnEdge) + this.Columns[this.trackColumnEdge].Width - offsetFromCenter, 5842if (Math.Abs(dgvcme.X - this.lastMouseClickInfo.x) <= hotDoubleClickZone.Width / 2 && 5843Math.Abs(dgvcme.Y - this.lastMouseClickInfo.y) <= hotDoubleClickZone.Height / 2) 6085int y = Math.Min(e.Y + this.mouseBarOffset, this.layout.Data.Bottom - 1); 6150newX = Math.Max(x + this.mouseBarOffset, this.layout.Data.X); 6155newX = Math.Min(x + this.mouseBarOffset, this.layout.Data.Right - 1); 6324x = Math.Max(e.X + this.mouseBarOffset, this.layout.Data.Left - 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); 6361proposedHeight = Math.Max(proposedHeight, minimumHeight); 8512return Math.Max(1, 4000 / xOffset); 8646int emptyBackgroundWidth = Math.Max(0, this.layout.Data.Width - this.Columns.GetColumnsWidth(DataGridViewElementStates.Visible)); 8647int emptyBackgroundHeight = Math.Max(0, this.layout.Data.Height - frozenVisibleRowsHeight - trailingScrollingRowsHeight); 9080int preferredWidth = Math.Min(minimumWidth + this.Columns.GetColumnsWidth(DataGridViewElementStates.Visible), proposedConstraints.Width); 9095int preferredHeight = Math.Min(minimumHeight + this.Rows.GetRowsHeight(DataGridViewElementStates.Visible), proposedConstraints.Height); 9272return Math.Max(1, 600 / yOffset); 9795int absXOffset = Math.Abs(xOffset), normOffset = xOffset / absXOffset; 9810hti = HitTest(ptMouse.X+(this.RightToLeftInternal?1:-1)*(xOffset+normOffset), ptMouse.Y-yOffset-(yOffset/Math.Abs(yOffset))); 10493this.horizScrollBar.LargeChange = Math.Max(totalVisibleWidth - totalVisibleFrozenWidth - widthNotVisible, 0); 11386dataGridViewColumn.ThicknessInternal = Math.Max(dataGridViewColumn.MinimumWidth, dataGridViewColumn.CachedThickness); 11465dataGridViewColumn.ThicknessInternal = Math.Max(dataGridViewColumn.MinimumWidth, dataGridViewColumn.CachedThickness); 13041if (Math.Abs(this.ptMouseDownGridCoord.X - ptGridCoord.X) >= DataGridView.DragSize.Width || 13042Math.Abs(this.ptMouseDownGridCoord.Y - ptGridCoord.Y) >= DataGridView.DragSize.Height) 14865dataGridViewColumn.ThicknessInternal = Math.Max(dataGridViewColumn.MinimumWidth, dataGridViewColumn.CachedThickness); 16724this.HorizScrollTimer.Interval = GetColumnScrollRate(Math.Abs(xOffset)); 16739this.VertScrollTimer.Interval = GetRowScrollRate(Math.Abs(yOffset)); 16960if (Math.Abs(this.VerticalOffset - originalVerticalOffset) >= Math.Abs(fullNotches * this.vertScrollBar.LargeChange)) 16973if (Math.Abs(this.HorizontalOffset - originalHorizontalOffset) >= Math.Abs(fullNotches * this.horizScrollBar.LargeChange)) 17056absScrollBands = Math.Abs(scrollBands); 17380dataGridViewColumn.ThicknessInternal = Math.Max(dataGridViewColumn.MinimumWidth, dataGridViewColumn.CachedThickness); 17433dataGridViewRow.ThicknessInternal = Math.Max(dataGridViewRow.MinimumHeight, dataGridViewRow.CachedThickness); 18165rowIndex = Math.Min(rowIndex, this.Rows.Count - 1); 19177dataGridViewRow.ThicknessInternal = Math.Max(dataGridViewRow.MinimumHeight, dataGridViewRow.CachedThickness); 20378editingZone.Width = Math.Max(0, editingZone.Width - totalVisibleFrozenWidth); 28514this.VerticalOffset += Math.Max(firstDisplayedScrollingRowHeight, this.vertScrollBar.LargeChange); 29763int absYOffset = Math.Abs(yOffset), normOffset = yOffset / absYOffset; 29778hti = HitTest(ptMouse.X - xOffset - (xOffset / Math.Abs(xOffset)), ptMouse.Y - yOffset - normOffset);
winforms\Managed\System\WinForms\DataGridViewRow.cs (2)
1408preferredRowThickness = Math.Max(preferredRowThickness, this.HeaderCell.GetPreferredHeight(rowIndex, this.DataGridView.RowHeadersWidth)); 1412preferredRowThickness = Math.Max(preferredRowThickness, this.HeaderCell.GetPreferredSize(rowIndex).Height);
winforms\Managed\System\WinForms\DataGridViewTextBoxCell.cs (11)
208editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetLeft - 2); 213editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetLeft - 1); 221editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - 3); 231editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetRight); 236editingControlBounds.Width = Math.Max(0, editingControlBounds.Width - DATAGRIDVIEWTEXTBOXCELL_horizontalTextOffsetRight - 1); 247editingControlBounds.Height = Math.Max(0, editingControlBounds.Height - DATAGRIDVIEWTEXTBOXCELL_verticalTextOffsetTop); 259editingControlBounds.Height = Math.Max(0, editingControlBounds.Height - DATAGRIDVIEWTEXTBOXCELL_verticalTextOffsetBottom); 457Math.Max(1, constraintSize.Height - borderAndPaddingHeights - DATAGRIDVIEWTEXTBOXCELL_verticalTextMarginTopWithWrapping - DATAGRIDVIEWTEXTBOXCELL_verticalTextMarginBottom), 468Math.Max(1, constraintSize.Width - borderAndPaddingWidths - DATAGRIDVIEWTEXTBOXCELL_horizontalTextMarginLeft - DATAGRIDVIEWTEXTBOXCELL_horizontalTextMarginRight), 513preferredSize.Width = Math.Max(preferredSize.Width, borderAndPaddingWidths + DATAGRIDVIEWCELL_iconMarginWidth * 2 + iconsWidth); 523preferredSize.Height = Math.Max(preferredSize.Height, borderAndPaddingHeights + DATAGRIDVIEWCELL_iconMarginHeight * 2 + iconsHeight);
winforms\Managed\System\WinForms\DataGridViewUtilities.cs (3)
214preferredWidth = Math.Max(preferredWidth, 1); 264return new Size(0, Math.Max(minHeightIcon, minHeightContent) + borderAndPaddingHeights); 297preferredSize.Height = Math.Max(preferredSize.Height,
winforms\Managed\System\WinForms\Form.cs (19)
613return new Size((int)Math.Round(real.Width), (int)Math.Round(real.Height)); 1608Size = new Size(Math.Min(size.Width, value.Width), Math.Min(size.Height, value.Height)); 1772Size = new Size(Math.Max(size.Width, value.Width), Math.Max(size.Height, value.Height)); 2077value = Math.Max(value, .50f); 3372Size newVar = new Size((int)Math.Round(newVarF.Width), (int)Math.Round(newVarF.Height)); 4023cp.X = Math.Max(clientRect.X,clientRect.X + (clientRect.Width - cp.Width)/2); 4024cp.Y = Math.Max(clientRect.Y,clientRect.Y + (clientRect.Height - cp.Height)/2); 4039cp.X = Math.Max(screenRect.X,screenRect.X + (screenRect.Width - cp.Width)/2); 4040cp.Y = Math.Max(screenRect.Y,screenRect.Y + (screenRect.Height - cp.Height)/2); 4507p.X = Math.Max(screenRect.X,screenRect.X + (screenRect.Width - Width)/2); 4508p.Y = Math.Max(screenRect.Y,screenRect.Y + (screenRect.Height - Height)/2); 7212mmi.ptMaxTrackSize.x = Math.Max(maxTrack.Width, minTrackWindowSize.Width); 7213mmi.ptMaxTrackSize.y = Math.Max(maxTrack.Height, minTrackWindowSize.Height); 7224mmi.ptMinTrackSize.x = Math.Max(mmi.ptMinTrackSize.x, 100); 7225mmi.ptMinTrackSize.y = Math.Max(mmi.ptMinTrackSize.y, SystemInformation.CaptionButtonSize.Height * 3);
winforms\Managed\System\WinForms\GroupBox.cs (3)
220return new Rectangle(padding.Left, fontHeight + padding.Top, Math.Max(size.Width - padding.Horizontal, 0), Math.Max(size.Height - fontHeight - padding.Vertical, 0)); 622int textRight = Math.Min( textLeft + textSize.Width, Width - 6);
winforms\Managed\System\WinForms\GroupBoxRenderer.cs (1)
195clipMiddle.Width = Math.Max(0, textBounds.Width - 3); // -3 to account for the margin built in the MeasureText result
winforms\Managed\System\WinForms\ImageList.cs (1)
654UnsafeNativeMethods.CopyMemory(new HandleRef(this, destPtr), new HandleRef(this, srcPtr), Math.Abs(targetData.Stride));
winforms\Managed\System\WinForms\Layout\CommonProperties.cs (4)
214bounds.Width = Math.Min(bounds.Width, value.Width); 215bounds.Height = Math.Min(bounds.Height, value.Height); 236bounds.Width = Math.Max(bounds.Width, value.Width); 237bounds.Height = Math.Max(bounds.Height, value.Height);
winforms\Managed\System\WinForms\Layout\DockAndAnchorLayout.cs (22)
195left = Math.Max(Math.Abs(left), Math.Abs(cachedBounds.Left)); 197right = left + Math.Max(element.Bounds.Width, cachedBounds.Width) + Math.Abs(right); 201right = right > 0 ? right : element.Bounds.Right + Math.Abs(right); 209top = Math.Max(Math.Abs(top), Math.Abs(cachedBounds.Top)); 211bottom = top + Math.Max(element.Bounds.Height, cachedBounds.Height) + Math.Abs(bottom); 215bottom = bottom > 0 ? bottom : element.Bounds.Bottom + Math.Abs(bottom); 350Math.Max(0, newElementBounds.Width - remainingBounds.Width), 351Math.Max(0, newElementBounds.Height - remainingBounds.Height)); 395newSize.Width = Math.Max(newSize.Width, remainingSize.Width); 410newSize.Height = Math.Max(newSize.Height, remainingSize.Height); 836prefSize.Width = Math.Max(prefSize.Width, elementSpace.Right); 842prefSize.Height = Math.Max(prefSize.Height, elementSpace.Bottom); 851prefSize.Width = Math.Max(prefSize.Width, elementSpace.Right + anchorDest.Width); 854prefSize.Width = Math.Max(prefSize.Width, anchorDest.Right); 863prefSize.Height = Math.Max(prefSize.Height, elementSpace.Bottom + anchorDest.Height); 866prefSize.Height = Math.Max(prefSize.Height, anchorDest.Bottom);
winforms\Managed\System\WinForms\Layout\FlowLayout.cs (2)
135layoutSize.Width = Math.Max(layoutSize.Width, rowSize.Width); 252rowSize.Height = Math.Max(rowSize.Height, requiredSize.Height);
winforms\Managed\System\WinForms\Layout\LayoutUtils.cs (12)
58largestSize.Width = Math.Max(largestSize.Width, textSize.Width); 59largestSize.Height = Math.Max(largestSize.Height, textSize.Height); 140padding.Left = Math.Max(0, padding.Left); 141padding.Top = Math.Max(0, padding.Top); 142padding.Right = Math.Max(0, padding.Right); 143padding.Bottom = Math.Max(0, padding.Bottom); 198Math.Max(a.Width, b.Width), 199Math.Max(a.Height, b.Height)); 204Math.Min(a.Width, b.Width), 205Math.Min(a.Height, b.Height)); 345currentSize.Width = Math.Max(currentSize.Width, contentSize.Width); 349currentSize.Height = Math.Max(currentSize.Height, contentSize.Height);
winforms\Managed\System\WinForms\Layout\TableLayout.cs (45)
196containerSize.Width = Math.Max(containerSize.Width, 1); 197containerSize.Height = Math.Max(containerSize.Height, 1); 255containerSize.Width = Math.Max(containerSize.Width, 1); 256containerSize.Height = Math.Max(containerSize.Height, 1); 258containerInfo.ColumnStyles[0].SetSize(Math.Max(oldWidth, Math.Min(proposedConstraints.Width, containerSize.Width))); 268proposedConstraints.Width = Math.Max(proposedConstraints.Width, 1); 269proposedConstraints.Height = Math.Max(proposedConstraints.Height, 1); 348numRows = Math.Max(1, numRows); 349numCols = Math.Max(1, numCols); 365int estimatedCols = Math.Max((int)Math.Ceiling((float)minSpace / numRows), minColumn); 368estimatedCols = Math.Max(estimatedCols, 1); 379xAssignRowsAndColumns(containerInfo, childrenInfo, /* numCols = */ Math.Max(minColumn,1), /* numRows = */ Int32.MaxValue, growStyle); 442rowStop = Math.Min(currentRow + flowElement.RowSpan, maxRows); 459fixedElement.RowStart = Math.Min(fixedElement.RowPosition, maxRows - 1); 460fixedElement.ColumnStart = Math.Min(fixedElement.ColumnPosition, maxColumns - 1); 467fixedElement.ColumnStart = Math.Max(fixedElement.ColumnStart, currentCol); 472fixedElement.RowStart = Math.Max(fixedElement.RowStart, currentRow); 496colStop = Math.Min(fixedElement.ColumnStart + fixedElement.ColumnSpan, maxColumns); 497rowStop = Math.Min(fixedElement.RowStart + fixedElement.RowSpan, maxRows); 505numRows = (numRows == Int32.MaxValue) ? rowStop : Math.Max(numRows, rowStop); 506numColumns = (numColumns == Int32.MaxValue) ? colStop : Math.Max(numColumns, colStop); 521 numRows = Math.Max(containerInfo.MaxRows, numRows); 525numColumns = Math.Max(containerInfo.MaxColumns, numColumns); 624colStop = Math.Min(layoutInfo.ColumnSpan, maxColumns); 665int expandLastElementWidth = Math.Max(0,proposedConstraints.Width - preferredSize.Width); 677strip.MinSize = (int)Math.Round((double)((TableLayoutStyle)styles[i]).Size); 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++) { 891desiredLength = Math.Max(0, desiredLength); 933int offset = Math.Min(sizeProxy.Size, missingLength); 1052totalPercentAllocatedSpace = Math.Max(0, maxSize - totalAbsoluteAndAutoSizeAllocatedSpace); 1106int totalWidth = (int)Math.Round(((strip.MinSize * totalPercent)/ style.Size)); 1107maxPercentWidth = Math.Max(maxPercentWidth, totalWidth); 1129remainingSpace -= (int) Math.Ceiling(desiredScaleSpace); 1135int delta = Math.Min(strip.MaxSize - strip.MinSize, remainingSpace); 1229cellBounds.Width = Math.Max(cellBounds.Width, 1); 1230cellBounds.Height = Math.Max(cellBounds.Height , 1); 1238elementBounds.Width = Math.Min(cellBounds.Width, elementBounds.Width); 1239elementBounds.Height = Math.Min(cellBounds.Height, elementBounds.Height); 1694_minColumns = Math.Max(_minColumns, layoutInfo.ColumnPosition + layoutInfo.ColumnSpan); 1695_minRows = Math.Max(_minRows, layoutInfo.RowPosition + layoutInfo.RowSpan);
winforms\Managed\System\WinForms\LinkLabel.cs (3)
765int length = (int) Math.Min(link.Length, textLen - link.Start); 1846int maxStart = Math.Max(left.Start, right.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\ListBox.cs (9)
1361return Math.Max(oldMax, textSize.Width); 2240width = (int)(Math.Ceiling(graphics.MeasureString(GetItemText(item), this.Font).Width)); 2333bounds.Width = Math.Max(ColumnWidth, bounds.Width); 2336bounds.Width = Math.Max(MaxItemWidth, bounds.Width); 2484Height = Math.Max(Height,ItemHeight); 2593entries = new Entry[Math.Max(elements, 4)]; 2596int newLength = Math.Max(entries.Length * 2, entries.Length + elements); 3621innerArray = new int[Math.Max(elements, 4)]; 3624int newLength = Math.Max(innerArray.Length * 2, innerArray.Length + elements);
winforms\Managed\System\WinForms\ListView.cs (10)
1840topIndex = Math.Min(topIndex, this.VirtualListSize - 1); 3133y = Math.Max(itemBounds.Top, iconBounds.Top) - 1; 3136y = Math.Max(itemBounds.Top, iconBounds.Top) + 1; 3139x = Math.Max(itemBounds.Left, iconBounds.Left) - 1; 3142x = Math.Max(itemBounds.Left, iconBounds.Left) + 1; 3905lvItem.cColumns = this.columnHeaders != null ? Math.Min(MAXTILECOLUMNS, this.columnHeaders.Length) : 0; 5681int lowDI = Math.Min(from, to); 5682int hiDI = Math.Max(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\MDIClient.cs (4)
212int sx = (int)Math.Round(bounds.X * dx); 213int sy = (int)Math.Round(bounds.Y * dy); 214int sw = (int)Math.Round((bounds.X + bounds.Width) * dx - sx); 215int sh = (int)Math.Round((bounds.Y + bounds.Height) * dy - sy);
winforms\Managed\System\WinForms\NativeWindow.cs (1)
968int target = (int)Math.Sqrt(j);
winforms\Managed\System\WinForms\NumericUpDown.cs (7)
823int numDigits = (int)Math.Floor(Math.Log(Math.Max(-(double)Minimum, (double)Maximum), baseSize)); 826maxDigits = (int)Math.Floor(Math.Log(Int64.MaxValue, baseSize)); 829maxDigits = (int)Math.Floor(Math.Log((double)decimal.MaxValue, baseSize));
winforms\Managed\System\WinForms\PictureBox.cs (1)
462float ratio = Math.Min((float)ClientRectangle.Width / (float)imageSize.Width, (float)ClientRectangle.Height / (float)imageSize.Height);
winforms\Managed\System\WinForms\Printing\PageSetupDialog.cs (4)
400data.marginLeft = Math.Max(data.marginLeft, data.minMarginLeft); 401data.marginTop = Math.Max(data.marginTop, data.minMarginTop); 402data.marginRight = Math.Max(data.marginRight, data.minMarginRight); 403data.marginBottom = Math.Max(data.marginBottom, data.minMarginBottom);
winforms\Managed\System\WinForms\Printing\PrintPreviewControl.cs (16)
286value = Math.Min(value, pageInfo.Length - (rows * columns)); 288value = Math.Max(value, 0); 438zoom = Math.Min(zoomX, zoomY); 579Point offset = new Point(Math.Max(0, (Size.Width - virtualPixels.X) / 2), 580Math.Max(0, (Size.Height - virtualPixels.Y) / 2)); 607zoom = Math.Min(zoomX, zoomY); 619maxImageHeight = Math.Max(maxImageHeight, imagePixels.Y); 733int maxPos = Math.Max(Width, virtualSize.Width /*- Width*/); 743position.X = Math.Min(position.X, virtualSize.Width - Width); 744position.Y = Math.Min(position.Y, virtualSize.Height - Height); 767info.nMax = Math.Max(Height, virtualSize.Height) - 1; 773info.nMax = Math.Max(Width, virtualSize.Width) - 1; 796int maxPos = Math.Max(Height, virtualSize.Height/* - Height*/); 839maxPos = Math.Max(Width, virtualSize.Width /*- Width*/); 878maxPos = Math.Max(Height, virtualSize.Height/* - Height*/); 903maxPos = Math.Max(Width, virtualSize.Width /*- Width*/);
winforms\Managed\System\WinForms\PropertyGrid.cs (13)
2309if (Math.Abs(gridBottom - y) <= 1 && y > gridTop) { 2334cyNew = Math.Min((rectTarget.Y + rectTarget.Height - 15),cyNew); 2337cyNew = Math.Max(DividerLimitHigh(target), cyNew); 2963int sx = (int)Math.Round(Left * dx); 2964int sy = (int)Math.Round(Top * dy); 2966sw = (int)Math.Round((Left + Width) * dx - sx); 2968sh = (int)Math.Round((Top + Height) * dy - sy); 3071height = Math.Min(dcRequestedHeight, maxSpace); 3079height = Math.Min(dcRequestedHeight, maxSpace / 2 - 1); 3082height = Math.Max(height, cyDivider * 2); 3106height = Math.Min(hcRequestedHeight, maxSpace); 3113height = Math.Max(height, cyDivider * 2); 3202size.Height = Math.Max(0,yNew);
winforms\Managed\System\WinForms\PropertyGridInternal\DocComment.cs (6)
96return Math.Max(height + 2 * padding, DpiHelper.EnableDpiChangedHighDpiImprovements ? LogicalToDeviceUnits(CYDEF) : CYDEF); 144size.Width = Math.Max(0, size.Width - 2 * cBorder); 145size.Height = Math.Max(0, size.Height - 2 * cBorder); 150Math.Min(lineHeight, size.Height), 156Math.Max(0, size.Height - lineHeight - (DpiHelper.EnableDpiChangedHighDpiImprovements ? LogicalToDeviceUnits(1) : 1)), 192int lines = Math.Max(MIN_LINES, cyNew/lineHeight);
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\GridErrorDlg.cs (2)
323int detailsWidth = (int) Math.Ceiling(sizef.Width); 325detailsBtn.Width = (int) Math.Ceiling(detailsWidth * (ownerGrid.UseCompatibleTextRendering ? 1.15f : 1.4f));
winforms\Managed\System\WinForms\PropertyGridInternal\PropertyGridView.cs (39)
509requiredLabelPaintMargin = (short)Math.Max(Math.Max(value, requiredLabelPaintMargin), GDIPLUS_SPACE); 1636size.Width = Math.Max(rect.Width + 1, size.Width); 1641loc.X = Math.Min(rectScreen.X + rectScreen.Width - size.Width, 1642Math.Max(rectScreen.X, loc.X + rect.X + rect.Width - size.Width)); 1715size.Width = Math.Max(rect.Width + 1, size.Width); 1720loc.X = Math.Min(rectScreen.X + rectScreen.Width - size.Width, 1721Math.Max(rectScreen.X, loc.X + rect.X + rect.Width - size.Width)); 2349int pos = Math.Max(Math.Min(xpos,widthPS-10),GetOutlineIconSize() * 2); 2813if (Math.Abs(screenPoint.X - rowSelectPos.X) < SystemInformation.DoubleClickSize.Width && 2814Math.Abs(screenPoint.Y - rowSelectPos.Y) < SystemInformation.DoubleClickSize.Height) { 3369int newOffset = Math.Max(0,initialOffset - large); 3370newOffset = Math.Min(newOffset, totalProps - visibleRows+1); 3374if (Math.Abs(initialOffset - originalOffset) >= Math.Abs(fullNotches * this.scrollBar.LargeChange)) { 3400int newOffset = Math.Max(0,initialOffset - scrollBands); 3401newOffset = Math.Min(newOffset, totalProps - visibleRows+1); 3464startRow = Math.Max(0,posStart.Y); 3471int cPropsVisible = Math.Min(totalProps - GetScrollOffset(),1+visibleRows); 3503cPropsVisible = Math.Min(cPropsVisible, endRow+1); 3887maxWidth = Math.Max((int) textSize.cx, maxWidth); 3907DropDownListBox.Height = Math.Max(tm.tmHeight + 2, Math.Min(maxListBoxHeight, DropDownListBox.PreferredHeight)); 3908DropDownListBox.Width = Math.Max(maxWidth, GetRectangle(row,ROWVALUE).Width); 4318int maxRows = (int)Math.Ceiling(((double)GetOurSize().Height)/(1+RowHeight)); 4530visibleRows = (int)Math.Ceiling(((double)size.Height)/(1+RowHeight)); 4535labelRatio = Math.Max(Math.Min(labelRatio, 9), 1.1); 4665int posNew = Math.Max(0, Math.Min(totalProps - visibleRows + 1, cOffset)); 4890ScrollBar.Maximum = Math.Max(0,totalProps - 1); 5113return(Math.Abs(x - InternalLabelWidth) < 4); 5389m.Result = (IntPtr)Math.Min(visibleRows, totalProps); 5772else if (!resizeUp && Math.Abs(Height - y) < ResizeBorderSize) 5776else if (resizeUp && Math.Abs(y) < ResizeBorderSize) 5838newBounds.Height = Math.Max(MinDropDownSize.Height, dragBaseRect.Height + (dragPoint.Y - dragStart.Y)); 5988lb.Height = Math.Max(lb.Height, lb.ItemHeight); 6132this.Height = (int)Math.Round(factor * this.Height);
winforms\Managed\System\WinForms\RadioButton.cs (1)
324size.Height = DpiHelper.EnableDpiChangedHighDpiImprovements ? Math.Max(size.Height + 5, flatSystemStyleMinimumHeight) : size.Height + 5; // ensure minimum height to avoid truncation of RadioButton circle or text
winforms\Managed\System\WinForms\RichTextBox.cs (4)
2166txrg.chrg.cpMax = Math.Min(txrg.chrg.cpMax, end); 2331index = Math.Max(t.Length - 1, 0); 2823numerator = (int)Math.Ceiling(multiplier); 2825numerator = (int)Math.Floor(multiplier);
winforms\Managed\System\WinForms\ScrollableControl.cs (8)
288displayRectangle.Width = Math.Max(displayRectangle.Width, AutoScrollMinSize.Width); 289displayRectangle.Height = Math.Max(displayRectangle.Height, AutoScrollMinSize.Height); 713pos = Math.Max(pos - e.Delta, 0); 714pos = Math.Min(pos, maxPos); 728pos = Math.Max(pos - e.Delta, 0); 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 (7)
323return Math.Min(largeChange, maximum - minimum + 1); 416return Math.Min(smallChange, LargeChange); 730while (Math.Abs(wheelDelta) >= NativeMethods.WHEEL_DELTA) { 876newValue = Math.Max(value - SmallChange, minimum); 880newValue = Math.Min(value + SmallChange, maximum - LargeChange + 1); // max - lChange + 1); 884newValue = Math.Max(value - LargeChange, minimum); 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 (25)
1153splitterDistance = (splitterDistance < Panel1MinSize) ? splitterDistance + SplitterIncrement : Math.Max(splitterDistance, BORDERSIZE); 1276x = Math.Max(Math.Min(x, Width - Panel2MinSize), Panel1MinSize); 1277y = Math.Max(y, 0); 1280y = Math.Max(Math.Min(y, Height - Panel2MinSize), Panel1MinSize); 1281x = Math.Max(x, 0); 1666size = Math.Max(panel1.Width + delta, BORDERSIZE); 1670size = Math.Max(panel1.Width - delta, BORDERSIZE); 1674size = Math.Max(panel1.Height + delta, BORDERSIZE); 1678return Math.Max(Math.Min(size, Width - Panel2MinSize), Panel1MinSize); 1681return Math.Max(Math.Min(size, Height - Panel2MinSize), Panel1MinSize); 1772panel2.Size = new Size(Math.Max(Width - panelSize - SplitterWidthInternal, Panel2MinSize), Height); 1776splitterDistance = Math.Max(Width - panelSize - SplitterWidthInternal, Panel1MinSize); 1782splitterDistance = Math.Max((int)(Math.Floor(this.Width / ratioWidth)), Panel1MinSize); 1786panel2.Size = new Size(Math.Max(Width - splitterDistance - SplitterWidthInternal, Panel2MinSize), Height); 1819panel2.Size = new Size(Width, Math.Max(Height - panel2Start, Panel2MinSize)); 1825splitterDistance = Math.Max(Height - Panel2.Height - SplitterWidthInternal, Panel1MinSize); 1835splitterDistance = Math.Max((int)(Math.Floor(this.Height / ratioHeight )), Panel1MinSize); 1840panel2.Size = new Size(Width,Math.Max(Height - panel2Start, Panel2MinSize)); 1896SplitterWidth = (int)Math.Round((float)SplitterWidth * scale);
winforms\Managed\System\WinForms\Splitter.cs (2)
859return Math.Max(Math.Min(size, maxSize), minSize);
winforms\Managed\System\WinForms\StatusBar.cs (1)
114sizeGripWidth = Math.Max(sizeGripWidth, 16);
winforms\Managed\System\WinForms\StatusBarPanel.cs (1)
563return Math.Max(width, minWidth);
winforms\Managed\System\WinForms\StatusStrip.cs (5)
228int gripHeight = Math.Min(DefaultSize.Height, statusStripSize.Height); 494TableLayoutSettings.RowStyles[0].Height = Math.Max(0,this.DisplayRectangle.Height); 537TableLayoutSettings.ColumnStyles[0].Width = Math.Max(0,this.DisplayRectangle.Width); 583int deltaBottomEdge = Math.Abs(rootHwndClientArea.bottom - gripLocation.y); 584int deltaRightEdge = Math.Abs(rootHwndClientArea.right - gripLocation.x);
winforms\Managed\System\WinForms\TableLayoutPanel.cs (4)
528cs.Width = (float)Math.Round(lastColumnHeight * factor.Width); 531cs.Width = (float)Math.Round(cs.Width * factor.Width); 544rs.Height = (float)Math.Round(lastRowHeight * factor.Height); 547rs.Height = (float)Math.Round(rs.Height * factor.Height);
winforms\Managed\System\WinForms\TextBoxBase.cs (6)
990textSize.Height = Math.Max(textSize.Height, FontHeight); 1019start = Math.Max( 0, start ); 1021end = Math.Max( 0, end ); 1391Height = Math.Max(saveHeight, PreferredHeight + 2); // 2 = fudge factor 1768index = Math.Max(t.Length - 1, 0); 1929long longLength = Math.Min(0, (long)length + start - textLen);
winforms\Managed\System\WinForms\ThreadExceptionDialog.cs (2)
253int buttonTop = Math.Max(textSize.Height, scaledMaxTextHeight) + scaledPaddingHeight; 292scaledMessageTopPadding + (scaledMaxTextHeight - Math.Min(textSize.Height, scaledMaxTextHeight)) / 2,
winforms\Managed\System\WinForms\ToolStrip.cs (15)
2381double hypotenuse = Math.Sqrt(adjacentSide*adjacentSide + oppositeSide*oppositeSide); 2389double tan = Math.Abs(Math.Atan(oppositeSide/adjacentSide)); 2392minTan = Math.Min(minTan, tan); 2393minHypotenuse = Math.Min(minHypotenuse, hypotenuse); 2482maxSize.Height = Math.Max(0, defaultSize.Height); 2496maxSize.Height = Math.Max(maxSize.Height, itemMargin.Vertical + prefItemSize.Height); 2551maxSize.Width = Math.Max(maxSize.Width, itemMargin.Horizontal + preferredSize.Width); 3046startIndex = Math.Max(0, startIndex); 4291gripRectangle.X = Math.Max(0, displayRect.X - Grip.GripThickness); 4292gripRectangle.Y = Math.Max(0,displayRect.Top - Grip.Margin.Top); 5423int insertIndex = Math.Max(0, toolStripItemIndex); 5438insertIndex = Math.Max(0, (owner.RightToLeft == RightToLeft.Yes) ? insertIndex + 1 : insertIndex); 5446insertIndex = Math.Max(0, (owner.RightToLeft == RightToLeft.No) ? insertIndex + 1 : insertIndex); 5457owner.Items.MoveItem(Math.Max(0,insertIndex), droppedItem);
winforms\Managed\System\WinForms\ToolStripButton.cs (1)
211prefSize.Width = Math.Max(prefSize.Width, standardButtonWidth);
winforms\Managed\System\WinForms\ToolStripComboBox.cs (1)
496preferredSize.Width = Math.Max(preferredSize.Width, 75);
winforms\Managed\System\WinForms\ToolStripDropDown.cs (2)
755value = Math.Max(value, .50f); 2111countDropDownItemsAssignedTo = Math.Max(--countDropDownItemsAssignedTo, 0);
winforms\Managed\System\WinForms\ToolStripDropDownMenu.cs (16)
355menuItemTextSize.Height = Math.Max(menuItemTextSize.Height, shortcutTextSize.Height); 359maxTextSize.Width = Math.Max(maxTextSize.Width, menuItemTextSize.Width); 360maxTextSize.Height = Math.Max(maxTextSize.Height, menuItemTextSize.Height); 368maxImageSize.Width = Math.Max(maxImageSize.Width, imageSize.Width); 369maxImageSize.Height = Math.Max(maxImageSize.Height, imageSize.Height); 373maxCheckSize.Width = Math.Max(checkedImageSize.Width, maxCheckSize.Width); 374maxCheckSize.Height = Math.Max(checkedImageSize.Height, maxCheckSize.Height); 378maxNonMenuItemSize.Height = Math.Max(item.Bounds.Height, maxNonMenuItemSize.Height); 379maxNonMenuItemSize.Width = Math.Max(item.Bounds.Width, maxNonMenuItemSize.Width); 383this.maxItemSize.Height = Math.Max(maxTextSize.Height + scaledTextPadding.Vertical, Math.Max(maxCheckSize.Height + scaledCheckPadding.Vertical, maxArrowSize.Height + scaledArrowPadding.Vertical)); 387this.maxItemSize.Height = Math.Max(maxImageSize.Height + scaledImagePadding.Vertical, maxItemSize.Height); 400maxTextSize.Width = Math.Max(maxTextSize.Width, maxNonMenuItemSize.Width); 405int extraImageWidth = Math.Max(0, maxImageSize.Width - scaledDefaultImageSize.Width); 818minY = Math.Min(minY, item.Bounds.Top); 819maxY = Math.Max(maxY, item.Bounds.Bottom);
winforms\Managed\System\WinForms\ToolStripManager.cs (4)
407&& Math.Abs(nextControl.TabIndex - startTabIndex) <= 1) { 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\ToolStripMenuItem.cs (2)
1195rect.X = Math.Max(rect.X,0); 1299slowShow = Math.Max(quickShow, SystemInformation.MenuShowDelay);
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\ToolStripPanelRow.cs (11)
428cachedBounds.X -= Math.Max(0, margins[i] - c.Margin.Left); 458cellOffsets[j] += Math.Max(0,currentCell.CachedBounds.Width-cachedBounds.Width); 510cachedBounds.X = Math.Max(0, cachedBounds.X - margins[i] - c.Margin.Top); 540cellOffsets[j] += Math.Max(0,currentCell.CachedBounds.Height-cachedBounds.Height); 1037return requiredSpace - Math.Max(0,spaceToFree); 1349nextCellMargin.Left = Math.Max(0, nextCellMargin.Left - freedSpace); 1365lastCellMargin.Left = Math.Max(0,locationToDrag.X - nextCell.Bounds.Right); 1411cellMargin.Left = Math.Max(0,locationToDrag.X-Row.Margin.Left); 1548return requiredSpace - Math.Max(0,spaceToFree); 1897lastCellMargin.Top = Math.Max(0,locationToDrag.Y - nextCell.Bounds.Bottom); 1937cellMargin.Top = Math.Max(0,locationToDrag.Y-Row.Margin.Top);
winforms\Managed\System\WinForms\ToolStripProfessionalRenderer.cs (1)
1273bounds.Height = Math.Max(0, bounds.Height -6);
winforms\Managed\System\WinForms\ToolStripSplitButton.cs (3)
372dropDownButtonBounds = new Rectangle(Point.Empty, new Size(Math.Min(this.Width, DropDownButtonWidth), this.Height)); 375int splitButtonButtonWidth = Math.Max(0, this.Width - dropDownButtonBounds.Width); 376int splitButtonButtonHeight = Math.Max(0, this.Height);
winforms\Managed\System\WinForms\ToolStripSplitStackLayout.cs (2)
363itemSize.Height = Math.Max(displayRectangle.Height - itemMargin.Vertical, 0); 488itemSize.Width = Math.Max(toolStripPreferredSize.Width - itemMargin.Horizontal -1, 0);
winforms\Managed\System\WinForms\ToolStripSystemRenderer.cs (1)
269bounds.Y = Math.Max(0,(e.GripBounds.Height - bounds.Height -2/*number of pixels for border*/) / 2);
winforms\Managed\System\WinForms\ToolTip.cs (8)
1819locationWeights[i] += Math.Abs((long)intersection.Width * intersection.Height); // Intersection is a weight 1830locationClippedAreas[i] = (Math.Abs((long)possibleLocations[i].Width) - Math.Abs((long)locationAreaWithinScreen.Width)) 1831* (Math.Abs((long)possibleLocations[i].Height) - Math.Abs((long)locationAreaWithinScreen.Height)); 1842locationWithinTopControlAreas[i] = Math.Abs((long)locationWithinTopControlRectangle.Height * locationWithinTopControlRectangle.Width); 2337Math.Min(currentTooltipSize.Width-2*XBALLOONOFFSET, screen.WorkingArea.Width): 2338Math.Min(currentTooltipSize.Width, screen.WorkingArea.Width);
winforms\Managed\System\WinForms\TrackBar.cs (2)
1007Value = Math.Min(absScrollBands+Value, Maximum); 1012Value = Math.Max(Value-absScrollBands, Minimum);
winforms\Managed\System\WinForms\TrackBarRenderer.cs (2)
174visualStyleRenderer.DrawEdge(g, new Rectangle((int)Math.Round(x), bounds.Y, lineWidth, bounds.Height), Edges.Left, edgeStyle, EdgeEffects.None); 205visualStyleRenderer.DrawEdge(g, new Rectangle(bounds.X, (int)Math.Round(y), bounds.Width, lineWidth), Edges.Top, edgeStyle, EdgeEffects.None);
winforms\Managed\System\WinForms\TreeNode.cs (1)
1963item.iImage = Math.Max(0, ((ImageIndexer.ActualIndex >= tv.ImageList.Images.Count) ? tv.ImageList.Images.Count - 1 : ImageIndexer.ActualIndex));
winforms\Managed\System\WinForms\TreeView.cs (3)
562return Math.Max(0, imageList.Images.Count - 1); 797return Math.Max(16, FontHeight + 3); 1052return Math.Max(0, imageList.Images.Count - 1);
winforms\Managed\System\WinForms\Triangle.cs (2)
63int updnHeight =(int)Math.Ceiling((updnWidth/2) * TRI_HEIGHT_RATIO); 68int lrHeight =(int)Math.Ceiling((lrWidth/2) * TRI_HEIGHT_RATIO);
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 (1057)
Common\Annotation\AnnotationBase.cs (9)
2810 float maxAnchorOffsetAbs = Math.Max(anchorOffsetAbs.X, anchorOffsetAbs.Y); 2976 newX = Math.Pow( horizAxis.logarithmBase, newX ); 2979 newAnchorX = Math.Pow( horizAxis.logarithmBase, newAnchorX ); 2992 newRight = Math.Pow( horizAxis.logarithmBase, newRight ); 3001 newRight = Math.Pow( horizAxis.logarithmBase, newRight ); 3019 newY = Math.Pow( vertAxis.logarithmBase, newY ); 3022 newAnchorY = Math.Pow( vertAxis.logarithmBase, newAnchorY ); 3035 newBottom = Math.Pow( vertAxis.logarithmBase, newBottom ); 3044 newBottom = Math.Pow( vertAxis.logarithmBase, newBottom );
Common\Annotation\ArrowAnnotation.cs (3)
398 float arrowLength = (float)Math.Sqrt(deltaX * deltaX + deltaY * deltaY); 453 float angle = (float)(Math.Atan(deltaY / deltaX) * 180f / Math.PI);
Common\Annotation\CalloutAnnotation.cs (4)
832 float radius = Math.Min(rectanglePositionAbs.Width, rectanglePositionAbs.Height); 937 float size = Math.Min(rectanglePositionAbs.Width, rectanglePositionAbs.Height); 1170 SizeF size = new SizeF(Math.Abs(cloudCenterAbs.X - point.X), Math.Abs(cloudCenterAbs.Y - point.Y));
Common\Annotation\LineAnnotation.cs (4)
520 if(Math.Round(point1.X , 3) == Math.Round(point2.X, 3)) 525 else if(Math.Round(point1.Y , 3) == Math.Round(point2.Y, 3))
Common\Annotation\TextAnnotation.cs (4)
526 spacingScaleX = Math.Max(1f, spacingScaleX); 531 spacingScaleY = Math.Max(1f, spacingScaleY); 971 spacingScaleX = Math.Max(1f, spacingScaleX); 976 spacingScaleY = Math.Max(1f, spacingScaleY);
Common\Borders3D\EmbedBorder.cs (6)
863 areasRect.Width -= (float)Math.Min(areasRect.Width, relSizeLeftTop.Width + relSizeRightBottom.Width); 865 areasRect.Height -= (float)Math.Min(areasRect.Height, relSizeLeftTop.Height + relSizeRightBottom.Height); 939radius = (float)Math.Max(radius, 2f * resolution / 96.0f); 940 radius = (float)Math.Min(radius, rect.Width/2f); 941 radius = (float)Math.Min(radius, rect.Height/2f); 942 radius = (float)Math.Ceiling(radius);
Common\Borders3D\EmbossBorder.cs (6)
120 areasRect.Width -= (float)Math.Min(areasRect.Width, borderSize.Width * 2.5f); 126 areasRect.Height -= (float)Math.Min(areasRect.Height, borderSize.Height * 2.5f); 194 radius = (float)Math.Max(radius, 2f * resolution / 96.0f); 195 radius = (float)Math.Min(radius, rect.Width/2f); 196 radius = (float)Math.Min(radius, rect.Height/2f); 197 radius = (float)Math.Ceiling(radius);
Common\ChartTypes\AreaChart.cs (25)
297point1.X = (float)Math.Round(point1.X); 298point1.Y = (float)Math.Round(point1.Y); 299point2.X = (float)Math.Round(point2.X); 300point2.Y = (float)Math.Round(point2.Y); 306axisPos.X = (float)Math.Round(axisPos.X); 307axisPos.Y = (float)Math.Round(axisPos.Y); 937 if(Math.Round(firstPoint.xPosition, 3) == Math.Round(secondPoint.xPosition, 3) && 938 Math.Round(firstPoint.yPosition, 3) == Math.Round(secondPoint.yPosition, 3)) 973 float axisPosition = (float)Math.Round(VAxis.GetPosition(this.VAxis.Crossing), 3); 979 float minX = (float)Math.Min(firstPoint.xPosition, secondPoint.xPosition); 980 float minY = (float)Math.Min(firstPoint.yPosition, secondPoint.yPosition); 981 minY = (float)Math.Min(minY, axisPosition); 982 float maxX = (float)Math.Max(firstPoint.xPosition, secondPoint.xPosition); 983 float maxY = (float)Math.Max(firstPoint.yPosition, secondPoint.yPosition); 984 maxY = (float)Math.Max(maxY, axisPosition); 1120 if( (Math.Round((decimal)firstPoint.yPosition, 3) > (decimal)axisPosition + 0.001M && Math.Round((decimal)secondPoint.yPosition, 3) < (decimal)axisPosition - 0.001M) || 1121 (Math.Round((decimal)firstPoint.yPosition, 3) < (decimal)axisPosition - 0.001M && Math.Round((decimal)secondPoint.yPosition, 3) > (decimal)axisPosition + 0.001M) ) 1176 if(Math.Round(firstPoint.xPosition, 3) == Math.Round(secondPoint.xPosition, 3) && 1177 Math.Round(firstPoint.yPosition, 3) == Math.Round(secondPoint.yPosition, 3))
Common\ChartTypes\BarChart.cs (16)
721pixelSize = (int)Math.Max(size.Width, size.Height); 927rectLabel.Width -= (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 930rectLabel.X += (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 952rectLabel.Width -= (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 955rectLabel.X += (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 1946rectLabel.Width -= (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 1949rectLabel.X += (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 1971rectLabel.Width -= (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 1974rectLabel.X += (float)Math.Min(rectLabel.Width, markerSize.Width / 2F); 2100float angleXAxis = (float)Math.Atan( 2103angleXAxis = (float)Math.Round(angleXAxis * 180f / (float)Math.PI); 2283 double yMin1 = Math.Min(point1.yPosition, point1.height); 2284 double yMax1 = Math.Max(point1.yPosition, point1.height); 2285 double yMin2 = Math.Min(point2.yPosition, point2.height); 2286 double yMax2 = Math.Max(point2.yPosition, point2.height);
Common\ChartTypes\BoxPlotChart.cs (17)
390 point.positionRel = new PointF((float)xPosition, (float)Math.Min(high, low)); 439 rectSize.Height = (float)Math.Abs(rectSize.Y - vAxis.GetPosition( point.YValues[2] )); 491 double brightness = Math.Sqrt(point.Color.R * point.Color.R + point.Color.G * point.Color.G + point.Color.B * point.Color.B); 544 dashWidth = Math.Max(dashWidth, minSize.Width); 553 new PointF((float) Math.Min(rectSize.Right, curPosition + dashWidth), medianValue), 577 areaRect.Y = (float)Math.Min(high, low); 579 areaRect.Height = (float)Math.Max(high, low) - areaRect.Y; 643 high = Math.Min(high, currentValue); 1169 point.positionRel = new PointF((float)xPosition, (float)Math.Min(high, low)); 1227 rectSize.Height = (float)Math.Abs(rectSize.Y - points[2].Y); 1271 double brightness = Math.Sqrt(point.Color.R * point.Color.R + point.Color.G * point.Color.G + point.Color.B * point.Color.B); 1324 dashWidth = Math.Max(dashWidth, minSize.Width); 1333 new PointF((float) Math.Min(rectSize.Right, curPosition + dashWidth), medianValue), 1364 areaRect.Y = (float)Math.Min(high, low); 1366 areaRect.Height = (float)Math.Max(high, low) - areaRect.Y; 1449 DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index); 1797double percentPointIndexInteger = Math.Floor(percentPointIndex);
Common\ChartTypes\BubbleChart.cs (14)
226 _minAll = Math.Min(_minAll, CommonElements.ParseDouble(ser[CustomPropertyName.BubbleScaleMin])); 230 _maxAll = Math.Max(_maxAll, CommonElements.ParseDouble(ser[CustomPropertyName.BubbleScaleMax])); 286minSer = Math.Min(minSer, point.YValues[1]); 287maxSer = Math.Max(maxSer, point.YValues[1]); 304 _maxBubleSize = (float)(Math.Min(areaSize.Width, areaSize.Height) / (100.0/_maxPossibleBubbleSize)); 305 _minBubleSize = (float)(Math.Min(areaSize.Width, areaSize.Height) / (100.0/_minPossibleBubbleSize)); 365 minAll = Math.Min(minAll, CommonElements.ParseDouble(ser[CustomPropertyName.BubbleScaleMin])); 369 maxAll = Math.Max(maxAll, CommonElements.ParseDouble(ser[CustomPropertyName.BubbleScaleMax])); 408minSer = Math.Min(minSer, point.YValues[1]); 409maxSer = Math.Max(maxSer, point.YValues[1]); 413minimum = Math.Min(minimum, point.YValues[0]); 414maximum = Math.Max(maximum, point.YValues[0]); 418minimum = Math.Min(minimum, point.XValue); 419maximum = Math.Max(maximum, point.XValue);
Common\ChartTypes\ErrorBarChart.cs (12)
550 point.positionRel = new PointF((float)xPosition, (float)Math.Min(high, low)); 595 areaRect.Y = (float)Math.Min(high, low); 597 areaRect.Height = (float)Math.Max(high, low) - areaRect.Y; 701 DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index); 1301 point.positionRel = new PointF((float)xPosition, (float)Math.Min(high, low)); 1359 areaRect.Y = (float)Math.Min(high, low); 1361 areaRect.Height = (float)Math.Max(high, low) - areaRect.Y; 1477 DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index); 1723 errorAmount += Math.Pow(point.YValues[0] - mean, 2); 1727 errorAmount = param * Math.Sqrt(errorAmount/ ( pointNumber - 1 ) ); 1746 errorAmount += Math.Pow(point.YValues[0], 2); 1750 errorAmount = param * Math.Sqrt( errorAmount/( pointNumber * ( pointNumber - 1 ) ) ) / 2.0;
Common\ChartTypes\FastLineChart.cs (4)
308 double axesValuesPixelSizeX = Math.Abs(hAxis.PositionToValue(axesMin.Width + pixelSize.Width, false) - hAxis.PositionToValue(axesMin.Width, false)); 399 if( Math.Abs(xValue - xValuePrev) < axesValuesPixelSizeX) 632if (Math.Abs(firstPointX - secondPointX) > Math.Abs(firstPointY - secondPointY))
Common\ChartTypes\FastPointChart.cs (10)
309 double axesValuesPixelSizeX = Math.Abs(hAxis.PositionToValue(axesMin.Width + pixelSize.Width, false) - hAxis.PositionToValue(axesMin.Width, false)); 310 double axesValuesPixelSizeY = Math.Abs(vAxis.PositionToValue(axesMin.Height + pixelSize.Height, false) - vAxis.PositionToValue(axesMin.Height, false)); 336markerSize = (int)Math.Max(markerSize * graph.Graphics.DpiX / 96, markerSize * graph.Graphics.DpiY / 96); 376 if(Math.Abs(xValue - xValuePrev) < axesValuesPixelSizeX && 377 Math.Abs(yValue - yValuePrev) < axesValuesPixelSizeY) 520 (int)Math.Round(markerBounds.X, 0), 521 (int)Math.Round(markerBounds.Y, 0), 522 (int)Math.Round(markerBounds.Width, 0), 523 (int)Math.Round(markerBounds.Height, 0) ); 531 float crossLineWidth = (float)Math.Ceiling(markerSize/4F);
Common\ChartTypes\FunnelChart.cs (29)
681 float topRotationHeight = (float)( (startWidth / 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) ); 682 float bottomRotationHeight = (float)( (endWidth / 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) ); 995 float topRotationHeight = (float)( (startWidth / 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) ); 996 float bottomRotationHeight = (float)( (endWidth / 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) ); 1865 Math.Max(this._funnelNeckSize.Width/2f, (topDiameter + bottomDiameter) / 4f); 1884 Math.Max(this._funnelNeckSize.Width/2f, (topDiameter + bottomDiameter) / 4f); 2035 labelInfo.Position.Y += (float)( ( (segmentInfo.EndWidth + segmentInfo.StartWidth) / 4f) * Math.Sin(this._rotation3D / 180F * Math.PI) ); 2211 float topSpacing = (float)Math.Abs( (plotAreaPositionAbs.Width/ 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) ); 2212 float bottomSpacing = (float)Math.Abs( (plotAreaPositionAbs.Width/ 2f) * Math.Sin(this._rotation3D / 180F * Math.PI) ); 2246 float minSize = Math.Min(2f, this.funnelSegmentGap / 2f); 2639 percentages[loop] = Math.Sqrt((2 * sumArea) / baseRatio); 2655 this._yValueMax = Math.Max(this._yValueMax, yValue); 2763 yValue = Math.Abs(Math.Log( yValue, this.Area.AxisY.LogarithmBase )); 2767 yValue = Math.Abs( yValue ); 2786 return Math.Abs(Math.Log( point.XValue, this.Area.AxisX.LogarithmBase )); 2788 return Math.Abs(point.XValue); 2954 startWidth = (float)Math.Abs( plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f - 2956 endWidth = (float)Math.Abs( plotAreaPositionAbs.X + plotAreaPositionAbs.Width / 2f -
Common\ChartTypes\KagiChart.cs (9)
417 else if( Math.Abs(dataPoint.YValues[yValueIndex] - prevClose) < reversalAmount) 541 point1.X = (float)Math.Round(point1.X); 542 point1.Y = (float)Math.Round(point1.Y); 543 point2.X = (float)Math.Round(point2.X); 544 point2.Y = (float)Math.Round(point2.Y); 545 point3.X = (float)Math.Round(point3.X); 546 point3.Y = (float)Math.Round(point3.Y); 549 point4.X = (float)Math.Round(point4.X); 550 point4.Y = (float)Math.Round(point4.Y);
Common\ChartTypes\LineChart.cs (29)
434 if( Math.Abs(dataPointPos[pointIndex - 1].X - dataPointPos[pointIndex].X ) < minDifference ) 445 if( Math.Abs(dataPointPos[pointIndex - 1].Y - dataPointPos[pointIndex].Y ) < minDifference ) 879if (Math.Abs(first.X - second.X) > Math.Abs(first.Y - second.Y)) 908if (Math.Abs(first.X - second.X) > Math.Abs(first.Y - second.Y)) 987bool topBottomLine = (Math.Abs(pt2.Y - pt1.Y) > Math.Abs(pt2.X - pt1.X)); 1580 if(Math.Abs(secondPoint.index - firstPoint.index) != 1) 1667 decimal plotAreaPositionX = Math.Round((decimal)area.PlotAreaPosition.X, decimals); 1668 decimal plotAreaPositionY = Math.Round((decimal)area.PlotAreaPosition.Y, decimals); 1669 decimal plotAreaPositionRight = Math.Round((decimal)area.PlotAreaPosition.Right, decimals); 1670 decimal plotAreaPositionBottom = Math.Round((decimal)area.PlotAreaPosition.Bottom, decimals); 1679 firstPoint.xPosition = Math.Round(firstPoint.xPosition, decimals); 1680 firstPoint.yPosition = Math.Round(firstPoint.yPosition, decimals); 1681 secondPoint.xPosition = Math.Round(secondPoint.xPosition, decimals); 1682 secondPoint.yPosition = Math.Round(secondPoint.yPosition, decimals); 2033 decimal plotAreaPositionX = Math.Round((decimal)area.PlotAreaPosition.X, decimals); 2034 decimal plotAreaPositionY = Math.Round((decimal)area.PlotAreaPosition.Y, decimals); 2035 decimal plotAreaPositionRight = Math.Round((decimal)area.PlotAreaPosition.Right, decimals); 2036 decimal plotAreaPositionBottom = Math.Round((decimal)area.PlotAreaPosition.Bottom, decimals); 2047 firstPoint.xPosition = Math.Round(firstPoint.xPosition, decimals); 2048 firstPoint.yPosition = Math.Round(firstPoint.yPosition, decimals); 2049 secondPoint.xPosition = Math.Round(secondPoint.xPosition, decimals); 2050 secondPoint.yPosition = Math.Round(secondPoint.yPosition, decimals); 2052 thirdPoint.X = (float)Math.Round(thirdPoint.X, decimals); 2053 thirdPoint.Y = (float)Math.Round(thirdPoint.Y, decimals); 2055 fourthPoint.X = (float)Math.Round(fourthPoint.X, decimals); 2056 fourthPoint.Y = (float)Math.Round(fourthPoint.Y, decimals);
Common\ChartTypes\PieChart.cs (132)
343 total += Math.Abs(dp.YValues[0]); 385 if(!dataPoint.IsEmpty && Math.Abs(dataPoint.YValues[0]) <= threshold) 389 collectedTotal += Math.Abs(dataPoint.YValues[0]); 735 sum += Math.Abs( point.YValues[0] ); 824 float sweepAngle = (float)( Math.Abs(point.YValues[0]) / sum * 360); 871 double xComponent = Math.Cos( midAngle * Math.PI / 180 ) * rectangle.Width / 10; 872 double yComponent = Math.Sin( midAngle * Math.PI / 180 ) * rectangle.Height / 10; 1034 point.positionRel.X = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * rectangle.Width * expShift / 2 + middlePoint.X; 1035 point.positionRel.Y = (float)Math.Sin( (midAngle) * Math.PI / 180 ) * rectangle.Height * expShift / 2 + middlePoint.Y; 1242 x = (float)Math.Cos( (startAngle + sweepAngle / 2) * Math.PI / 180 ) * width + middlePoint.X; 1243 y = (float)Math.Sin( (startAngle + sweepAngle / 2) * Math.PI / 180 ) * height + middlePoint.Y; 1309 float x1 = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * relativeSize.Width * expShift / 2 + middlePoint.X; 1310 float y1 = (float)Math.Sin( (midAngle) * Math.PI / 180 ) * relativeSize.Height * expShift / 2 + middlePoint.Y; 1312 float x2 = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * relativeSize.Width * shift * expShift + middlePoint.X; 1313 float y2 = (float)Math.Sin( (midAngle) * Math.PI / 180 ) * relativeSize.Height * shift * expShift + middlePoint.Y; 1333float y3 = (float)Math.Sin((midAngle) * Math.PI / 180) * relativeSize.Height * shift * expShift + middlePoint.Y; 1344x3 = (float)Math.Cos((midAngle) * Math.PI / 180) * relativeSize.Width * shift * expShift + middlePoint.X - relativeSize.Width / 10 * labelsHorizontalLineSize; 1361x3 = (float)Math.Cos((midAngle) * Math.PI / 180) * relativeSize.Width * shift * expShift + middlePoint.X + relativeSize.Width / 10 * labelsHorizontalLineSize; 1715 float y3 = (float)Math.Sin( (midAngle) * Math.PI / 180 ) * relativeSize.Height * shift * expShift + middlePoint.Y; 1720 x3 = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * relativeSize.Width * shift * expShift + middlePoint.X - relativeSize.Width / 10 * labelsHorizontalLineSize; 1724 x3 = (float)Math.Cos( (midAngle) * Math.PI / 180 ) * relativeSize.Width * shift * expShift + middlePoint.X + relativeSize.Width / 10 * labelsHorizontalLineSize; 2270 SpreadInterval( startOfIntervals, endOfIntervals, index, Math.Floor( overlapRange / 2.0 ) ); 2425 sum += Math.Abs(point.YValues[0]); 2596 double xComponent = Math.Cos( midAngle * Math.PI / 180 ) * rectangle.Width / 10; 2597 double yComponent = Math.Sin( midAngle * Math.PI / 180 ) * rectangle.Height / 10; 3080 rectangle.X + (float)Math.Cos( 180 * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3081 rectangle.Y + (float)Math.Sin( 180 * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3086 rectangle.X + (float)Math.Cos( 180 * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3087 rectangle.Y + (float)Math.Sin( 180 * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3092 rectangle.X + (float)Math.Cos( 0 * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3093 rectangle.Y + (float)Math.Sin( 0 * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3098 rectangle.X + (float)Math.Cos( 0 * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3099 rectangle.Y + (float)Math.Sin( 0 * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3104 rectangle.X + (float)Math.Cos( startAngle * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3105 rectangle.Y + (float)Math.Sin( startAngle * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3110 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3111 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3116 rectangle.X + (float)Math.Cos( startAngle * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3117 rectangle.Y + (float)Math.Sin( startAngle * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3122 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3123 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3140 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Width / 2F + rectangle.Width / 2F, 3141 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Height / 2F + rectangle.Height / 2F, 3157 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Width * sizeOut / 2F + rectangle.Width / 2F, 3158 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Height * sizeOut / 2F + rectangle.Height / 2F, 3165 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Width * ( 1 + doughnutRadius ) / 4F + rectangle.Width / 2F, 3166 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Height * ( 1 + doughnutRadius ) / 4F + rectangle.Height / 2F, 3172 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Width * 0.5F / 2F + rectangle.Width / 2F, 3173 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle / 2 ) * Math.PI / 180 ) * rectangle.Height * 0.5F / 2F + rectangle.Height / 2F, 3194 rectangle.X + (float)Math.Cos( 180 * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3195 rectangle.Y + (float)Math.Sin( 180 * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 3200 rectangle.X + (float)Math.Cos( 180 * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3201 rectangle.Y + (float)Math.Sin( 180 * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 3206 rectangle.X + (float)Math.Cos( 0 * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3207 rectangle.Y + (float)Math.Sin( 0 * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 3212 rectangle.X + (float)Math.Cos( 0 * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3213 rectangle.Y + (float)Math.Sin( 0 * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 3218 rectangle.X + (float)Math.Cos( startAngle * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3219 rectangle.Y + (float)Math.Sin( startAngle * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 3224 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3225 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 3230 rectangle.X + (float)Math.Cos( startAngle * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3231 rectangle.Y + (float)Math.Sin( startAngle * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 3236 rectangle.X + (float)Math.Cos( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Width * doughnutRadius / 2F + rectangle.Width / 2F, 3237 rectangle.Y + (float)Math.Sin( ( startAngle + sweepAngle ) * Math.PI / 180 ) * rectangle.Height * doughnutRadius / 2F + rectangle.Height / 2F, 4352 sum += Math.Abs(point.YValues[0]); 4392 sweepAngle = (float)( Math.Abs(point.YValues[0]) * 360 / sum ); 4959 angle = (float)Math.Atan( ( position.Y - _innerPlotPosition.Top - _innerPlotPosition.Height / 2) / ( position.X - _innerPlotPosition.Left - _innerPlotPosition.Width / 2 )); 4963 if( Math.Cos( angle ) == 0 ) 4969 correct = (float)(_innerPlotPosition.Width * 0.4 - _innerPlotPosition.Width * 0.4 / Math.Cos( angle )); 5146 if( Math.Abs( numEmptyUp - numEmptyDown ) < 2 ) 5240 numOfItems = Math.Max( numOfItems, maxNumOfRows ); 5321 maxSize = Math.Max( size.Width, maxSize ); 5322 maxSizeVertical = Math.Max( size.Height, maxSizeVertical );
Common\ChartTypes\PointAndFigureChart.cs (9)
586 numberOfBricks = (int)Math.Floor( 592 numberOfBricks = (int)Math.Floor( 599numberOfBricks = (int)Math.Floor( 616 numberOfBricks = (int)Math.Floor( 622 numberOfBricks = (int)Math.Floor( 629numberOfBricks = (int)Math.Floor( 748 double boxYSize = Math.Abs( 751 double boxXSize = Math.Abs( 810 boxSizeRel = Math.Abs(boxSizeRel -
Common\ChartTypes\PolarChart.cs (1)
160 sectorNumber = (int)(Math.Abs(max - min) / interval);
Common\ChartTypes\RadarChart.cs (1)
303 sectorNumber = (int)Math.Max(series.Points.Count, sectorNumber);
Common\ChartTypes\RangeChart.cs (12)
985if (Math.Abs(firstPoint.yPosition - (double)thirdPoint.Y) > smallDouble && 986Math.Abs(secondPoint.yPosition - (double)fourthPoint.Y) > smallDouble && 1104 float minX = (float)Math.Min(firstPoint.xPosition, secondPoint.xPosition); 1105 float minY = (float)Math.Min(firstPoint.yPosition, secondPoint.yPosition); 1106 minY = (float)Math.Min(minY, axisPosition); 1107 float maxX = (float)Math.Max(firstPoint.xPosition, secondPoint.xPosition); 1108 float maxY = (float)Math.Max(firstPoint.yPosition, secondPoint.yPosition); 1109 maxY = (float)Math.Max(maxY, axisPosition); 1157 firstPoint.xPosition = Math.Round(firstPoint.xPosition, 5); 1158 firstPoint.yPosition = Math.Round(firstPoint.yPosition, 5); 1159 secondPoint.xPosition = Math.Round(secondPoint.xPosition, 5); 1160 secondPoint.yPosition = Math.Round(secondPoint.yPosition, 5);
Common\ChartTypes\RenkoChart.cs (2)
466 numberOfBricks = (int)Math.Floor((dataPoint.YValues[yValueIndex] - prevHigh) / boxSize); 471 numberOfBricks = (int)Math.Floor((prevLow - dataPoint.YValues[yValueIndex]) / boxSize);
Common\ChartTypes\StackedAreaChart.cs (7)
186 _totalPerPoint[index] += Math.Abs(ser.Points[index].YValues[0]); 578 firstPoint.X = (float)Math.Round(firstPoint.X); 579 secondPoint.X = (float)Math.Round(secondPoint.X); 887 firstPoint.X = (float)Math.Round(firstPoint.X); 888 secondPoint.X = (float)Math.Round(secondPoint.X); 1006pointLabelValue = Math.Round(pointLabelValue, 2); 1492pointLabelValue = Math.Round(pointLabelValue, 2);
Common\ChartTypes\StackedBarChart.cs (15)
172 totals[index] += Math.Abs(ser.Points[index].YValues[0]); 482 float right = (float)Math.Ceiling(areaPosition.Right); 483 float bottom = (float)Math.Ceiling(areaPosition.Bottom); 484 areaPosition.X = (float)Math.Floor(areaPosition.X); 486 areaPosition.Y = (float)Math.Floor(areaPosition.Y); 759 yValue = Math.Log( yValue, hAxis.logarithmBase ); 849 barZeroValue = Math.Log( barZeroValue, hAxis.logarithmBase ); 961 yValue = Math.Pow( hAxis.logarithmBase, yValue ); 1055pointLabelValue = Math.Round(pointLabelValue, 2); 1711 yValue = Math.Log( yValue, hAxis.logarithmBase ); 1759 barZeroValue = Math.Log( barZeroValue, hAxis.logarithmBase ); 1826pointLabelValue = Math.Round(pointLabelValue, 2); 2012float angleXAxis = (float)Math.Atan( 2015angleXAxis = (float)Math.Round(angleXAxis * 180f / (float)Math.PI);
Common\ChartTypes\StackedColumnChart.cs (9)
165 totals[index] += Math.Abs(ser.Points[index].YValues[0]); 488 float right = (float)Math.Ceiling(areaPosition.Right); 489 float bottom = (float)Math.Ceiling(areaPosition.Bottom); 490 areaPosition.X = (float)Math.Floor(areaPosition.X); 492 areaPosition.Y = (float)Math.Floor(areaPosition.Y); 966 yValue = Math.Pow( vAxis.logarithmBase, yValue ); 1139pointLabelValue = Math.Round(pointLabelValue, 2); 1220absPosition.X = (float)Math.Ceiling(absPosition.X) + 1f; 1855pointLabelValue = Math.Round(pointLabelValue, 2);
Common\ChartTypes\StockChart.cs (12)
466 areaRect.Y = (float)Math.Min(high, low); 468 areaRect.Height = (float)Math.Max(high, low) - areaRect.Y; 622 DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index); 798 rect.Y = (float)Math.Min(open, close); 800 rect.Height = (float)Math.Max(open, close) - rect.Y; 1280 areaRect.Y = (float)Math.Min(high, low); 1282 areaRect.Height = (float)Math.Max(high, low) - areaRect.Y; 1360 DrawLabel(common, area, graph, ser, point, new PointF(xPosition, (float)Math.Min(high, low)), index); 1623 rect.Y = (float)Math.Min(open, close); 1625 rect.Height = (float)Math.Max(open, close) - rect.Y; 1638 rect.Width = (float)Math.Abs(points[1].X - points[0].X); 1639 rect.Height = (float)Math.Abs(points[1].Y - points[0].Y);
Common\DataManager\DataManager.cs (43)
303 numberOfPoints = Math.Max(numberOfPoints, this._series[seriesName].Points.Count); 329 returnValue = Math.Max(returnValue, seriesPoint.YValues[valueIndex]); 359returnValue = Math.Max(returnValue, seriesPoint.YValues[0] + BubbleChart.AxisScaleBubbleSize(area.Common, area, seriesPoint.YValues[1], true)); 363returnValue = Math.Max(returnValue, seriesPoint.YValues[0]); 394returnValue = Math.Max(returnValue, seriesPoint.XValue + BubbleChart.AxisScaleBubbleSize(area.Common, area, seriesPoint.XValue, false)); 398returnValue = Math.Max(returnValue, seriesPoint.XValue); 429returnValue = Math.Min(returnValue, seriesPoint.XValue - BubbleChart.AxisScaleBubbleSize(area.Common, area, seriesPoint.YValues[1], false)); 433returnValue = Math.Min(returnValue, seriesPoint.XValue); 463 returnValue = Math.Max(returnValue, y); 483 returnValue = Math.Max(returnValue, seriesPoint.XValue); 503 max = Math.Max(max, seriesPoint.XValue); 504 min = Math.Min(min, seriesPoint.XValue); 533 max = Math.Max(max, yValue); 534 min = Math.Min(min, yValue); 565 max = Math.Max(max, y); 566 min = Math.Min(min, y); 598 max = Math.Max(max, y); 599 min = Math.Min(min, y); 641 noStackedMax = Math.Max(noStackedMax,this._series[seriesName].Points[pointIndex].YValues[valueIndex]); 645 stackedMax = Math.Max(stackedMax, noStackedMax); 646 returnValue = Math.Max(returnValue, stackedMax); 689noStackedMax = Math.Max(noStackedMax, this._series[seriesName].Points[pointIndex].YValues[valueIndex]); 693 maxValue = Math.Max(maxValue, noStackedMax); 694 returnValue = Math.Max(returnValue, maxValue); 721 returnValue = Math.Max(returnValue, doubleIndexValue); 747 returnValue = Math.Min(returnValue, seriesPoint.YValues[valueIndex]); 777returnValue = Math.Min(returnValue, seriesPoint.YValues[0] - BubbleChart.AxisScaleBubbleSize(area.Common, area, seriesPoint.YValues[1], true)); 781returnValue = Math.Min(returnValue, seriesPoint.YValues[0]); 811 returnValue = Math.Min(returnValue, y); 831 returnValue = Math.Min(returnValue, seriesPoint.XValue); 872 noStackedMin = Math.Min(noStackedMin,this._series[seriesName].Points[pointIndex].YValues[valueIndex]); 876 stackedMin = Math.Min(stackedMin, noStackedMin); 881 returnValue = Math.Min(returnValue, stackedMin); 927noStackedMin = Math.Min(noStackedMin, this._series[seriesName].Points[pointIndex].YValues[valueIndex]); 931 minValue = Math.Min(noStackedMin, minValue); 932returnValue = Math.Min(returnValue, minValue); 956 returnValue = Math.Min(returnValue, doubleIndexValue); 992 totalPerPoint += Math.Abs(ser.Points[pointIndex].YValues[0]); 1004 totalPerPoint = Math.Abs(totalPerPoint); 1009 returnValue = Math.Max(returnValue, 1052 totalPerPoint += Math.Abs(ser.Points[pointIndex].YValues[0]); 1065 totalPerPoint = Math.Abs(totalPerPoint); 1070 returnValue = Math.Min(returnValue,
Common\DataManager\DataPoint.cs (2)
2277 this._yValue[i] = Math.Floor(this._yValue[i]); 2281 this._yValue[i] = this._xValue - Math.Floor(this._yValue[i]);
Common\DataManager\DataSeries.cs (2)
1280keywordValue = Math.Max(keywordValue, point.YValues[yValueIndex]); 1292keywordValue = Math.Min(keywordValue, point.YValues[yValueIndex]);
Common\Formulas\Oscillator.cs (1)
124 int period = Math.Min(ExpAvg.Length,ExpAvgDistribution.Length);
Common\Formulas\PriceIndicators.cs (7)
492 tempPeriod = Math.Round(tempPeriod); 757 outputValues[1][point] = average[point] + Math.Sqrt(sum / period) * deviation; 758 outputValues[2][point] = average[point] - Math.Sqrt(sum / period) * deviation; 788 outputValues[1][point] = average[point] + Math.Sqrt(sum / period) * deviation; 789 outputValues[2][point] = average[point] - Math.Sqrt(sum / period) * deviation; 1048 outputValues[outIndex] = Math.Sqrt( sum / period ); 1066 outputValues[outIndex] = Math.Sqrt( sum / period );
Common\Formulas\StatisticalAnalysis.cs (27)
375 double correl = covar / Math.Sqrt( varianceX * varianceY ); 659 double dev = Math.Sqrt( variance1 / inputValues[1].Length + variance2 / inputValues[2].Length ); 812 T = ( mean1 - mean2 - HypothesizedMeanDifference ) / ( Math.Sqrt( s * ( 1.0 / inputValues[1].Length + 1.0 / inputValues[2].Length ) ) ); 822 freedom = (int)Math.Round(f); 824 s = Math.Sqrt( variance1 / inputValues[1].Length + variance2 / inputValues[2].Length ); 977 variance = Math.Sqrt( Variance( difference, true ) ); 979 double T = ( Math.Sqrt( inputValues[1].Length ) * ( mean - HypothesizedMeanDifference ) ) / variance; 1458 tmp -= ( x + 0.5 ) * Math.Log( tmp ); 1465 return -tmp + Math.Log( 2.5066282746310005 * sum / x ); 1476 return Math.Exp( GammLn( m ) + GammLn( n ) - GammLn( m + n ) ); 1500 if ( Math.Abs(d) < FPMIN ) d=FPMIN; 1512 if( Math.Abs(d) < FPMIN ) d=FPMIN; 1516 if( Math.Abs(c) < FPMIN ) c = FPMIN; 1528 if (Math.Abs(d) < FPMIN) d=FPMIN; 1532 if (Math.Abs(c) < FPMIN) c=FPMIN; 1541 if (Math.Abs(del-1.0) < EPS) 1562 return 0.398942280401433 * Math.Exp( -t * t / 2 ); 1583bt = Math.Exp(GammLn(a + b) - GammLn(a) - GammLn(b) + a * Math.Log(x) + b * Math.Log(1.0 - x)); 1819 outputValues[1][0] = Math.Exp( GammLn( m ) ); 1950 tValue = Math.Abs( tValue ); 1984 result = NormalDistributionFunction(zValue)/Math.Sqrt(1.0+zValue*zValue); 1993 result=1.0/(1+result*Math.Abs(zValue)); 2101 if ( Math.Abs(x) < 0.42 ) 2113 r = Math.Log( -Math.Log( r ) );
Common\Formulas\TechGeneralIndicators.cs (6)
179 distanceOne = Math.Abs( inputValues[1][index] - inputValues[2][index] ); 182 distanceTwo = Math.Abs( inputValues[3][index-1] - inputValues[1][index] ); 185 distanceTree = Math.Abs( inputValues[3][index-1] - inputValues[2][index] ); 188 trueRange[index-1] = Math.Max( Math.Max( distanceOne, distanceTwo ), distanceTree ); 772 sum += Math.Abs( movingAverage[index] - typicalPrice[indexSum] );
Common\Formulas\TimeSeriesAndForecasting.cs (19)
256error = Math.Sqrt(error); 266dev = Math.Sqrt(dev); 318 inputValues[1][index] = Math.Log( inputValues[1][index] ); 333 interval = Math.Abs( inputValues[0][0] - inputValues[0][inputValues[0].Length - 1] ) / ( inputValues[0].Length - 1 ); 340 inputValues[0][index] = Math.Log( inputValues[0][index] ); 368 interval = Math.Abs( inputValues[0][0] - inputValues[0][inputValues[0].Length - 1] ) / ( inputValues[0].Length - 1 ); 411 interval = Math.Abs( inputValues[0][0] - inputValues[0][inputValues[0].Length - 1] ) / ( inputValues[0].Length - 1 ); 437 inputValues[0][index] = Math.Log( inputValues[0][index] ); 438 inputValues[1][index] = Math.Log( inputValues[1][index] ); 456 mainDeterminant[i][k] += (double)Math.Pow( inputValues[0][j], (i+k) ); 471 coeffDeterminant[i][k] += (double)inputValues[1][j] * (double)Math.Pow( inputValues[0][j], k ); 493 outputValues[1][i]+= (double)coefficients[j]*Math.Pow(outputValues[0][i],j); 505 outputValues[1][i]= Math.Exp( coefficients[0] ) * Math.Exp( coefficients[1] * outputValues[0][i] ); 514 outputValues[0][i] = Math.Exp( inputValues[0][0] ) + i * logInterval; 516 outputValues[1][i]= coefficients[1] * Math.Log( outputValues[0][i] ) + coefficients[0]; 525 outputValues[0][i] = Math.Exp( inputValues[0][0] ) + i * logInterval; 527 outputValues[1][i]= Math.Exp( coefficients[0] ) * Math.Pow( outputValues[0][i], coefficients[1] );
Common\General\Axis.cs (125)
1972transformedTitlePosition.Width = Math.Abs(transformedTitlePosition.Width); 1977transformedTitlePosition.Height = Math.Abs(transformedTitlePosition.Height); 2353angleAxis = (float)Math.Atan( 2374angleAxis = -(float)Math.Atan( 2379angle += (int)Math.Round(angleAxis * 180f / (float)Math.PI); 2390dX = (float)(offset * Math.Cos(angleAxis)); 2395dX = (float)(offset * Math.Cos(angleAxis)); 2400dY = (float)(offset * Math.Cos(angleAxis)); 2401dX = (float)(offset * Math.Sin(angleAxis)); 2414dY = (float)(offset * Math.Cos(angleAxis)); 2415dX = (float)(offset * Math.Sin(angleAxis)); 3404this.titleSize = Math.Min(titleStringSize.Width, maxTitlesize); 3408this.titleSize = Math.Min(titleStringSize.Height, maxTitlesize); 3419 this.titleSize = Math.Min(titleStringSize.Width, maxTitlesize); 3423this.titleSize = Math.Min(titleStringSize.Height, maxTitlesize); 3483arrowSize = Math.Max(arrowSizePrimary.Height, arrowSizeSecondary.Height); 3488arrowSize = Math.Max(arrowSizePrimary.Width, arrowSizeSecondary.Width); 3532this.markSize += (float)Math.Max(majorTickSize, minorTickSize); 3542this.markSize = Math.Min(this.markSize, (plotArea.Height / 100F) * (Axis.maxAxisMarkSize / axesNumber)); 3548this.markSize = Math.Min(this.markSize, (plotArea.Width / 100F) * (Axis.maxAxisMarkSize / axesNumber)); 3599this.markSize = Math.Max(this.markSize, arrowSize - (this.markSize + this.scrollBarSize + this.titleSize)); 3600this.markSize = Math.Min(this.markSize, (plotArea.Width / 100F) * (Axis.maxAxisMarkSize / axesNumber)); 3719 size = (float)Math.Max(this.LabelAutoFitMaxFontSize, this.LabelAutoFitMinFontSize); 3720 _minLabelFontSize = Math.Min(this.LabelAutoFitMinFontSize, this.LabelAutoFitMaxFontSize); 3721 _aveLabelFontSize = _minLabelFontSize + Math.Abs(size - _minLabelFontSize)/2f; 3727size = (float)Math.Min(size, ChartArea.axesAutoFontSize); 4466 newInterval = Math.Round(oldInterval / 2.0); 4483 newInterval = Math.Round(oldInterval / 2.0); 4760 _minLabelFontSize = Math.Min(this.LabelAutoFitMinFontSize, this.LabelAutoFitMaxFontSize); 4765 Math.Max(this.LabelAutoFitMaxFontSize, this.LabelAutoFitMinFontSize), 4884float leftSideAngle = (float)(Math.Atan((textSize.Width / 2f) / plotAreaRadius) * 180f / Math.PI); 5157yValue = Math.Log(yValue, this.logarithmBase); 5302rect.X = (float)Math.Min(fromPosition, toPosition); 5303rect.Width = (float)Math.Max(fromPosition, toPosition) - rect.X; 5308rect.Y = (float)Math.Min(fromPosition, toPosition); 5309rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y; 5324axisLabelSize.Height = Math.Max(axisLabelSize.Height, imageRelSize.Height); 5340groupingLabelSizes[groupLevelIndex - 1] = (float)Math.Max(groupingLabelSizes[groupLevelIndex - 1], axisLabelSize.Height); 5346groupingLabelSizes[groupLevelIndex - 1] = (float)Math.Max(groupingLabelSizes[groupLevelIndex - 1], axisLabelSize.Width); 5350if (Math.Round(axisLabelSize.Width) >= Math.Round(rect.Width) && 5355if (Math.Round(axisLabelSize.Height) >= Math.Round(rect.Height) && 5411rect.Y = (float)Math.Min(fromPosition, toPosition); 5412rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y; 5497axisLabelSize.Width = Math.Max(axisLabelSize.Width, imageRelSize.Width); 5502axisLabelSize.Height = Math.Max(axisLabelSize.Height, imageRelSize.Height); 5527width = (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height; 5528width += (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width; 5530height = (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height; 5531height += (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width; 5535width = (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width; 5536width += (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height; 5538height = (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width; 5539height += (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height; 5664rect.Y = (float)Math.Min(fromPosition, toPosition); 5665rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y; 5699rect.Width = (float)Math.Ceiling(rect.Width); 5700rect.Height = (float)Math.Ceiling(rect.Height); 5732axisLabelSize.Width = Math.Max(axisLabelSize.Width, imageRelSize.Width); 5737axisLabelSize.Height = Math.Max(axisLabelSize.Height, imageRelSize.Height); 5757width = (float)Math.Cos((90 - Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width; 5758width += (float)Math.Cos((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height; 5760height = (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Height; 5761height += (float)Math.Sin((90 - Math.Abs(angle)) / 180F * Math.PI) * axisLabelSize.Width; 5764width = (float)Math.Ceiling(width) * 1.05f; 5765height = (float)Math.Ceiling(height) * 1.05f; 5766axisLabelSize.Width = (float)Math.Ceiling(axisLabelSize.Width) * 1.05f; 5767axisLabelSize.Height = (float)Math.Ceiling(axisLabelSize.Height) * 1.05f; 5775resultSize = Math.Max(resultSize, axisLabelSize.Height); 5776resultRotatedSize = Math.Max(resultRotatedSize, axisLabelSize.Height); 5779labelNearOffset = (float)Math.Min(labelNearOffset, (fromPosition + toPosition) / 2f - axisLabelSize.Width / 2f); 5780labelFarOffset = (float)Math.Max(labelFarOffset, (fromPosition + toPosition) / 2f + axisLabelSize.Width / 2f); 5785resultSize = Math.Max(resultSize, axisLabelSize.Height); 5786resultRotatedSize = Math.Max(resultRotatedSize, height); 5791labelFarOffset = (float)Math.Max(labelFarOffset, (fromPosition + toPosition) / 2f + width * 1.1f); 5795labelNearOffset = (float)Math.Min(labelNearOffset, (fromPosition + toPosition) / 2f - width * 1.1f); 5804resultSize = Math.Max(resultSize, axisLabelSize.Width); 5805resultRotatedSize = Math.Max(resultRotatedSize, axisLabelSize.Width); 5808labelNearOffset = (float)Math.Min(labelNearOffset, (fromPosition + toPosition) / 2f - axisLabelSize.Height / 2f); 5809labelFarOffset = (float)Math.Max(labelFarOffset, (fromPosition + toPosition) / 2f + axisLabelSize.Height / 2f); 5813resultSize = Math.Max(resultSize, axisLabelSize.Width); 5814resultRotatedSize = Math.Max(resultRotatedSize, width); 5819labelFarOffset = (float)Math.Max(labelFarOffset, (fromPosition + toPosition) / 2f + height * 1.1f); 5823labelNearOffset = (float)Math.Min(labelNearOffset, (fromPosition + toPosition) / 2f - height * 1.1f); 5891groupLabelLevel = Math.Max(groupLabelLevel, label.RowIndex); 5939axisLabelSize.Width = (float)Math.Ceiling(axisLabelSize.Width); 5940axisLabelSize.Height = (float)Math.Ceiling(axisLabelSize.Height); 5952 axisLabelSize.Height = Math.Max(axisLabelSize.Height, imageRelSize.Height); 5970resultSize[groupLevelIndex - 1] = Math.Max(resultSize[groupLevelIndex - 1], axisLabelSize.Height); 5977resultSize[groupLevelIndex - 1] = Math.Max(resultSize[groupLevelIndex - 1], axisLabelSize.Width); 6320if (Math.Abs(GetAxisPosition() - edgePosition) < 0.0015) 6434axisPoints[0].X = (float)Math.Round(axisPoints[0].X, 4); 6435axisPoints[0].Y = (float)Math.Round(axisPoints[0].Y, 4); 6436axisPoints[1].X = (float)Math.Round(axisPoints[1].X, 4); 6437axisPoints[1].Y = (float)Math.Round(axisPoints[1].Y, 4); 6443angle = Math.Atan((axisPoints[1].Y - axisPoints[0].Y) / (axisPoints[1].X - axisPoints[0].X)); 6447angle = Math.Atan((axisPoints[1].X - axisPoints[0].X) / (axisPoints[1].Y - axisPoints[0].Y)); 6451return (angle * 180.0) / Math.PI;
Common\General\AxisLabels.cs (10)
604 labValue = Math.Pow( this.logarithmBase, labValue ); 707 double inter = Math.Log(labelStyle.GetInterval()); 708 double valu = Math.Log(Math.Abs(labValue)); 709 int digits = (int)Math.Abs(inter)+5; 716 if( Math.Abs(inter) < Math.Abs(valu)-5 ) 718 labValue = Math.Round(labValue,digits); 729 labValue = Math.Pow( this.logarithmBase, labValue ); 807maxPointCount = Math.Max(maxPointCount, ser.Points.Count);
Common\General\AxisScale.cs (18)
658 return Math.Pow( this.logarithmBase, GetCrossing() ); 958 axisValue = Math.Log( axisValue, this.logarithmBase ); 1259 min = (double)( ((decimal)Math.Ceiling( min / inter ) - 1m ) * (decimal)inter ); 1274 max = (double)( ((decimal)Math.Floor( max / inter ) + 1m ) * (decimal)inter ); 1326 double tempDiff = diff / Math.Pow( power, step ); 1336 return tempDiff * Math.Pow( power, step ); 1576 return Math.Floor( years / 5 ); 1590 return (int)Math.Round((max - min) / current); 1938 viewMaximum = Math.Pow( this.logarithmBase, viewMaximum ); 1939 viewMinimum = Math.Pow( this.logarithmBase, viewMinimum ); 1971 axisInterval = Math.Round( axisInterval ); 1978 minimum = Math.Floor( minimum ); 2105 crossingValue = Math.Log( crossingValue, this.logarithmBase ); 2108 minimumValue = Math.Log( minimumValue, this.logarithmBase ); 2109 maximumValue = Math.Log( maximumValue, this.logarithmBase ); 2117 axisInterval = Math.Floor( diff ); 2179 axisInterval = Math.Floor( axisInterval / this.interval3DCorrection ); 2217 (double)((Math.Floor(numberOfUnits / axisInterval / margin * 100)+2) * axisInterval * margin / 100),
Common\General\AxisScaleBreaks.cs (7)
682 double minSize = Math.Min(this._minSegmentSize, Math.Floor(100.0 / axisSegments.Count)); 689 axisSegments[index].Size = Math.Round(((int)axisSegments[index].Tag) / (totalPointNumber / 100.0),5); 967numberOfPoints = Math.Max(numberOfPoints, series.Points.Count); 1011 int segmentIndex = (int)Math.Floor((dataPoint.YValues[yValueIndex] - minYValue) / segmentSize); 1032 segmentMaxValue[segmentIndex] = Math.Max(segmentMaxValue[segmentIndex], dataPoint.YValues[yValueIndex]); 1033 segmentMinValue[segmentIndex] = Math.Min(segmentMinValue[segmentIndex], dataPoint.YValues[yValueIndex]);
Common\General\AxisScaleSegments.cs (10)
414 size = Math.Min(size, breakPosition.Height); 418 size = Math.Min(size, breakPosition.Width); 697 breakPosition.Y = (float)Math.Min(from, to); 698 breakPosition.Height = (float)Math.Max(from, to); 702 breakPosition.X = (float)Math.Min(from, to); 703 breakPosition.Width = (float)Math.Max(from, to);; 712 breakPosition.Height = (float)Math.Abs(breakPosition.Y - breakPosition.Height); 718 breakPosition.Width = (float)Math.Abs(breakPosition.X - breakPosition.Width); 987 if( Math.Abs(this[index].ScaleMinimum - axisValue) < Math.Abs(axisValue - this[index - 1].ScaleMaximum))
Common\General\Chart.cs (10)
320image = new Bitmap(Math.Max(1,Width), Math.Max(1,Height)); 345float newResolution = Math.Max(resolution / 2, 96); 346Width = (int)Math.Ceiling(Width * newResolution / resolution); 347Height = (int)Math.Ceiling(Height * newResolution / resolution); 1623Bitmap image = new Bitmap(Math.Max(1,Width), Math.Max(1,Height)); 2178 int areaColumns = (int)Math.Floor(Math.Sqrt(areaNumber)); 2183 int areaRows = (int)Math.Ceiling(((float)areaNumber) / ((float)areaColumns));
Common\General\ChartArea.cs (37)
1540 axesAutoFontSize = Math.Min(axesAutoFontSize, axis.autoLabelFont.Size); 1708if (Math.Abs(offset) > plottingRect.Width * 0.3f) 1715rectLabelSideSpacing.X = (float)Math.Max(offset, rectLabelSideSpacing.X); 1722rectLabelSideSpacing.Width = (float)Math.Max(axis.labelFarOffset - Position.Right, rectLabelSideSpacing.Width); 1726rectLabelSideSpacing.Width = (float)Math.Max(plottingRect.Width * 0.3f, rectLabelSideSpacing.Width); 1736if (Math.Abs(offset) > plottingRect.Height * 0.3f) 1743rectLabelSideSpacing.Y = (float)Math.Max(offset, rectLabelSideSpacing.Y); 1750rectLabelSideSpacing.Height = (float)Math.Max(axis.labelFarOffset - Position.Bottom, rectLabelSideSpacing.Height); 1754rectLabelSideSpacing.Height = (float)Math.Max(plottingRect.Height * 0.3f, rectLabelSideSpacing.Height); 1797 float xTitleSize = (float)Math.Max(this.AxisY.titleSize, this.AxisY2.titleSize); 1803 float yTitleSize = (float)Math.Max(this.AxisX.titleSize, this.AxisX2.titleSize); 1844 (float)Math.Round((plottingRect.X - Position.X) / (Position.Width / 100F), 5), 1845 (float)Math.Round((plottingRect.Y - Position.Y) / (Position.Height / 100F), 5), 1846 (float)Math.Round(plottingRect.Width / (Position.Width / 100F), 5), 1847 (float)Math.Round(plottingRect.Height / (Position.Height / 100F), 5)); 1907 if(Math.Round(labelsPosition, 2) < Math.Round(axis.PlotAreaPosition.Bottom, 2)) 1956 if(Math.Round(labelsPosition, 2) < Math.Round(axis.PlotAreaPosition.Y, 2)) 2603 labelsSizeEstimate = (float)Math.Min(labelsSizeEstimate * 1.1f, plotAreaRectAbs.Width / 5f); 2618 labelsSize = (float)Math.Min(labelsSize, plotAreaRectAbs.Width / 2.5f); 2692 textSize.Width = (float)Math.Ceiling(textSize.Width * 1.1f); 2693 textSize.Height = (float)Math.Ceiling(textSize.Height * 1.1f); 2701 labelsSize = (float)Math.Max( 2710 float width = (float)Math.Cos(textAngle/180F*Math.PI) * textSize.Width; 2711 float height = (float)Math.Sin(textAngle/180F*Math.PI) * textSize.Width; 2712 width = (float)Math.Abs(Math.Ceiling(width)); 2713 height = (float)Math.Abs(Math.Ceiling(height)); 2724 labelsSize = (float)Math.Max( 2726 Math.Max(width, height)); 2751 labelsSize = (float)Math.Max( 2753 Math.Max(width, textSize.Height)); 2944 double scaleRatio = 360.0 / Math.Abs(this.AxisX.Maximum - this.AxisX.Minimum);
Common\General\ChartArea3D.cs (8)
1375 size = Math.Sqrt( 1982 double yMin1 = Math.Min(point1.yPosition, point1.height); 1983 double yMax1 = Math.Max(point1.yPosition, point1.height); 1984 double yMin2 = Math.Min(point2.yPosition, point2.height); 1985 double yMax2 = Math.Max(point2.yPosition, point2.height); 2123 Math.Abs(points[1].X - points[0].X) >= interval.Width) 2128 Math.Abs(points[1].Y - points[0].Y) >= interval.Height) 2133 Math.Abs(points[1].Z - points[0].Z) >= interval.Width)
Common\General\ChartAreaAxes.cs (11)
246axisX.SetInterval = Math.Abs(axisX.maximum - axisX.minimum) / 12.0; 1141 stackMaxBarColumn = Math.Max(stackMaxBarColumn, stackMaxBarColumnForGroup); 1142 stackMinBarColumn = Math.Min(stackMinBarColumn, stackMinBarColumnForGroup); 1143 stackMaxArea = Math.Max(stackMaxArea, stackMaxAreaForGroup); 1144 stackMinArea = Math.Min(stackMinArea, stackMinAreaForGroup); 1148 autoMaximum = Math.Max(stackMaxBarColumn,stackMaxArea); 1149 autoMinimum = Math.Min(stackMinBarColumn,stackMinArea); 1347 axisInterval = Math.Ceiling( axisInterval / axis.interval3DCorrection ); 1800 prevXValue = Math.Log(dataSeries.Points[0].XValue, logarithmicBase); 1811 curentXValue = Math.Log(point.XValue, logarithmicBase); 1837 double interval = Math.Abs( (double)seriesXValues[seriesIndex][ point - 1 ] - (double)seriesXValues[seriesIndex][ point ] );
Common\General\ChartElement.cs (6)
1170 int pointIndex = (int)Math.Ceiling(current - 1); 1322 date = date.AddMonths((int)Math.Floor(interval)); 1323 span = TimeSpan.FromDays(30.0 * ( interval - Math.Floor(interval) )); 1335 date = date.AddYears((int)Math.Floor(interval)); 1336 span = TimeSpan.FromDays(365.0 * ( interval - Math.Floor(interval) )); 1343 result = Math.Abs(result);
Common\General\ChartGraphics.cs (69)
259 (float)Math.Round(firstPoint.X), 260 (float)Math.Round(firstPoint.Y), 261 (float)Math.Round(secondPoint.X), 262 (float)Math.Round(secondPoint.Y) ); 474 angle = (float)(Math.Atan(rectangle.Width / rectangle.Height)* 180 / Math.PI); 478 angle = (float)(180 - Math.Atan(rectangle.Width / rectangle.Height)* 180 / Math.PI); 891this.DrawRectangle(new Pen(markerBorderColor, markerBorderSize), (int)Math.Round(rect.X, 0), (int)Math.Round(rect.Y, 0), (int)Math.Round(rect.Width, 0), (int)Math.Round(rect.Height, 0)); 897float crossLineWidth = (float)Math.Ceiling(markerSize / 4F); 1034float diamondSize = markerSize * (float)Math.Sin(45f / 180f * Math.PI); 2018offsetY = (float)Math.Sin((90 - angle) / 180F * Math.PI) * labelRect.Height / 2F; 2019offsetX = (float)Math.Sin((Math.Abs(angle)) / 180F * Math.PI) * labelRect.Height / 2F; 2073float sizeChange = truncateRect.Width / (float)Math.Cos(Math.Abs(angle) / 180F * Math.PI); 2076sizeChange -= labelRect.Height * (float)Math.Tan(Math.Abs(angle) / 180F * Math.PI); 2084sizeChange -= labelRect.Height * (float)Math.Tan(Math.Abs(angle) / 180F * Math.PI); 2420 absPositionRounded.Width = (int)Math.Round(absPosition.Right) - absPositionRounded.X; 2421 absPositionRounded.Height = (int)Math.Round(absPosition.Bottom) - absPositionRounded.Y; 2559 absPositionRounded.Width = (int)Math.Round(absPosition.Right) - absPositionRounded.X; 2560 absPositionRounded.Height = (int)Math.Round(absPosition.Bottom) - absPositionRounded.Y; 2572 leftLine[2].X = (float)Math.Round((double)center.X - labelSize.Width/2F - 1F); 2579 rightLine[2].X = (float)Math.Round((double)center.X + labelSize.Width/2F - 1F); 2681 return new Size( (int)Math.Ceiling(size.Width), (int)Math.Ceiling(size.Height)); 2697 return new Size( (int)Math.Ceiling(size.Width), (int)Math.Ceiling(size.Height)); 2972 gradientRect.Height = (float)Math.Floor(gradientRect.Height / 3f); 2976 gradientRect.X = gradientRect.Right - (float)Math.Floor(gradientRect.Width / 3f); 2977 gradientRect.Width = (float)Math.Floor(gradientRect.Width / 3f); 3000 gradientRect.Y = gradientRect.Bottom - (float)Math.Floor(gradientRect.Height / 3f); 3001 gradientRect.Height = (float)Math.Floor(gradientRect.Height / 3f); 3005 gradientRect.Width = (float)Math.Floor(gradientRect.Width / 3f); 3547imageRect.Width = Math.Min(fillRect.Width, imageAbsSize.Width); 3548imageRect.Height = Math.Min(fillRect.Height, imageAbsSize.Height); 3595 new Rectangle((int)Math.Round(imageRect.X),(int)Math.Round(imageRect.Y), (int)Math.Round(imageRect.Width), (int)Math.Round(imageRect.Height)), 3788 radius = (float)Math.Max(radius, 2f); 3789 radius = (float)Math.Min(radius, offset.Width/4f); 3790 radius = (float)Math.Min(radius, offset.Height/4f); 3791 radius = (float)Math.Ceiling(radius); 4270 new Rectangle((int)Math.Round(imageRect.X),(int)Math.Round(imageRect.Y), (int)Math.Round(imageRect.Width), (int)Math.Round(imageRect.Height)), 4568 new Rectangle((int)Math.Round(imageRect.X),(int)Math.Round(imageRect.Y), (int)Math.Round(imageRect.Width), (int)Math.Round(imageRect.Height)), 5135 float minSize = (float)Math.Min(position.Width, position.Height); 5192 float minSize = (float)Math.Min(position.Width, position.Height); 5570 float left = (float)Math.Round( (double)rect.Left ); 5571 float right = (float)Math.Round( (double)rect.Right ); 5572 float top = (float)Math.Round( (double)rect.Top ); 5573 float bottom = (float)Math.Round( (double)rect.Bottom );
Common\General\ChartGraphics3D.cs (85)
362 point1.X = Math.Min(point1.X, point2.X); 366 point1.X = Math.Max(point1.X, point2.X); 383 point1.Y = Math.Max(point1.Y, point2.Y); 432if (Math.Abs(points[0].X - points[1].X) > Math.Abs(points[0].Y - points[1].Y)) 1135 angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI); 1140 angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI); 1146 angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI); 1152 angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI); 1158 angle = (float)(Math.Atan( Math.Tan( ( angle ) * Math.PI / 180 ) * correction ) * 180 / Math.PI); 1332 (float)Math.Round(frontLinePoint1.X), 1333 (float)Math.Round(frontLinePoint1.Y), 1334 (float)Math.Round(frontLinePoint2.X), 1335 (float)Math.Round(frontLinePoint2.Y) ); 1811 decimal plotAreaPositionX = Math.Round((decimal)area.PlotAreaPosition.X, decimals); 1812 decimal plotAreaPositionY = Math.Round((decimal)area.PlotAreaPosition.Y, decimals); 1813 decimal plotAreaPositionRight = Math.Round((decimal)area.PlotAreaPosition.Right, decimals); 1814 decimal plotAreaPositionBottom = Math.Round((decimal)area.PlotAreaPosition.Bottom, decimals); 2219 float minX = (float)Math.Min(points3D[0].X, points3D[1].X); 2220 float minY = (float)Math.Min(points3D[0].Y, points3D[1].Y); 2221 float maxX = (float)Math.Max(points3D[0].X, points3D[1].X); 2222 float maxY = (float)Math.Max(points3D[0].Y, points3D[1].Y); 2294 (float)Math.Round(polygonPoints[0].X), 2295 (float)Math.Round(polygonPoints[0].Y), 2296 (float)Math.Round(polygonPoints[1].X), 2297 (float)Math.Round(polygonPoints[1].Y) ); 2305 (float)Math.Round(polygonPoints[0].X), 2306 (float)Math.Round(polygonPoints[0].Y), 2307 (float)Math.Round(polygonPoints[1].X), 2308 (float)Math.Round(polygonPoints[1].Y)); 2329 (float)Math.Round(polygonPoints[3].X), 2330 (float)Math.Round(polygonPoints[3].Y), 2331 (float)Math.Round(polygonPoints[0].X), 2332 (float)Math.Round(polygonPoints[0].Y) ); 2340 (float)Math.Round(polygonPoints[3].X), 2341 (float)Math.Round(polygonPoints[3].Y), 2342 (float)Math.Round(polygonPoints[0].X), 2343 (float)Math.Round(polygonPoints[0].Y)); 2359 (float)Math.Round(polygonPoints[1].X), 2360 (float)Math.Round(polygonPoints[1].Y), 2361 (float)Math.Round(polygonPoints[2].X), 2362 (float)Math.Round(polygonPoints[2].Y) ); 2370 (float)Math.Round(polygonPoints[1].X), 2371 (float)Math.Round(polygonPoints[1].Y), 2372 (float)Math.Round(polygonPoints[2].X), 2373 (float)Math.Round(polygonPoints[2].Y)); 2390 (float)Math.Round(frontLinePoint1.X), 2391 (float)Math.Round(frontLinePoint1.Y), 2392 (float)Math.Round(frontLinePoint2.X), 2393 (float)Math.Round(frontLinePoint2.Y) ); 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); 2500 leftPoint = ChartGraphics.FindPointByIndex(points, Math.Max(firstPoint.index, secondPoint.index) + 1, (multiSeries) ? secondPoint : null, ref pointArrayIndex); 2551 rightPoint = ChartGraphics.FindPointByIndex(points, Math.Max(firstPoint.index, secondPoint.index) + 1, (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); 3249 gradientRect.Height = (float)Math.Floor(gradientRect.Height / 3f); 3253 gradientRect.X = gradientRect.Right - (float)Math.Floor(gradientRect.Width / 3f); 3254 gradientRect.Width = (float)Math.Floor(gradientRect.Width / 3f); 3305 gradientRect.Y = gradientRect.Bottom - (float)Math.Floor(gradientRect.Height / 3f); 3306 gradientRect.Height = (float)Math.Floor(gradientRect.Height / 3f); 3310 gradientRect.Width = (float)Math.Floor(gradientRect.Width / 3f); 4087 cylinderAngle = (float)Math.Atan( 4090 cylinderAngle = (float)Math.Round(cylinderAngle * 180f / (float)Math.PI); 4179 double centralLineAngle = ((cylinderAngle) * Math.PI / 180f); 4193 centralLinePoint.Y = (float)(Math.Tan(centralLineAngle) * centralLinePoint.X); 4194 centralLinePoint.Y += (float)(boundsRectMiddlePoint.Y - Math.Tan(centralLineAngle) * boundsRectMiddlePoint.X); 4199 centralLinePoint.X = (float)(centralLinePoint.Y - (boundsRectMiddlePoint.Y - Math.Tan(centralLineAngle) * boundsRectMiddlePoint.X)); 4200 centralLinePoint.X /= (float)(Math.Tan(centralLineAngle));
Common\General\DataManipulator.cs (11)
605 double fromX = Math.Min(fromXValue, toXValue); 606 double toX = Math.Max(fromXValue, toXValue); 621 toX = Math.Max(toX, ser.Points[ser.Points.Count - 1].XValue); 632 fromX = Math.Min(fromX, ser.Points[0].XValue); 2853 Math.Min(pointTempValues[functionInfo.outputIndex], point.YValues[funcIndex-1]); 2859 Math.Max(pointTempValues[functionInfo.outputIndex], point.YValues[funcIndex-1]); 2903 Math.Max(pointTempValues[functionInfo.outputIndex], point.YValues[funcIndex-1]); 2906 Math.Min(pointTempValues[functionInfo.outputIndex + 1], point.YValues[funcIndex-1]); 2984 Math.Pow(series.Points[secondPassIndex].YValues[funcIndex-1] - average, 2); 2995 Math.Sqrt(pointTempValues[functionInfo.outputIndex]); 3020 numberOfYValues = (int)Math.Max(numberOfYValues, series.YValuesPerPoint);
Common\General\GridTickMarks.cs (14)
408logInterval = Math.Log(1 + this.interval * logStep, Axis.logarithmBase); 501 RectangleF rect = new RectangleF( first.X - 0.5f, first.Y - 0.5f, Math.Abs( second.X - first.X ) + 1, Math.Abs( second.Y - first.Y ) + 1 ); 515 RectangleF rect = new RectangleF( first.X - 0.5f, first.Y - 0.5f, Math.Abs( second.X - first.X ) + 1, Math.Abs( second.Y - first.Y ) + 1 ); 576 return viewMinimum + Math.Floor( ( current - viewMinimum )); 750 RectangleF rect = new RectangleF( first.X - 0.5f, first.Y - 0.5f, Math.Abs( second.X - first.X ) + 1, Math.Abs( second.Y - first.Y ) + 1 ); 1387 double logInterval = Math.Log( 1 + this.interval * logStep, _axis.logarithmBase ); 1450 return viewMinimum + Math.Floor( ( current - viewMinimum )); 1498if (Math.Abs(first.X - second.X) > Math.Abs(first.Y - second.Y)) 1593if (Math.Abs(first.X - second.X) > Math.Abs(first.Y - second.Y))
Common\General\ImageMap.cs (7)
381if ((int)Math.Round(transformedCoord[0]) == (int)Math.Round(transformedCoord[2])) 383transformedCoord[2] = (float)Math.Round(transformedCoord[2]) + 1; 385if ((int)Math.Round(transformedCoord[1]) == (int)Math.Round(transformedCoord[3])) 387transformedCoord[3] = (float)Math.Round(transformedCoord[3]) + 1; 414tagStringBuilder.Append((int)Math.Round(f));
Common\General\Label.cs (14)
271 double fromX = Math.Min(min, max); 272 double toX = Math.Max(min, max); 1746rect.X = (float)Math.Min(fromPosition, toPosition); 1747rect.Width = (float)Math.Max(fromPosition, toPosition) - rect.X; 1759rect.Y = (float)Math.Min(fromPosition, toPosition); 1760rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y; 1837 rectLabels.Width = (float)Math.Max(rectLabels.Width, rectLabels.X - labelsAxis.PlotAreaPosition.X); 1861 rectLabels.Width = (float)Math.Max(rectLabels.Width, labelsAxis.PlotAreaPosition.Right - rectLabels.X); 1883 rectLabels.Height = (float)Math.Max(rectLabels.Height, rectLabels.Y - labelsAxis.PlotAreaPosition.Y); 1907 rectLabels.Height = (float)Math.Max(rectLabels.Height, labelsAxis.PlotAreaPosition.Bottom - rectLabels.Y); 2260rect.X = (float)Math.Min(fromPosition, toPosition); 2261rect.Width = (float)Math.Max(fromPosition, toPosition) - rect.X; 2277rect.Y = (float)Math.Min(fromPosition, toPosition); 2278rect.Height = (float)Math.Max(fromPosition, toPosition) - rect.Y;
Common\General\Legend.cs (34)
453 this._offset.Width = (int)Math.Ceiling(singleWCharacterSize.Width / 2f); 454 this._offset.Height = (int)Math.Ceiling(singleWCharacterSize.Width / 3f); 477 Math.Min(legendPosition.Height, titleSize.Height)); 502 highestHeader.Height = Math.Max(highestHeader.Height, headerSize.Height); 514 Math.Min(legendPosition.Height - this._titlePosition.Height, highestHeader.Height)); 515 this._headerPosition.Height = Math.Max(this._headerPosition.Height, 0); 584 int newFontSize = (int)Math.Round(this.Font.Size - this._autoFitFontSizeAdjustment); 632 Math.Min(this._numberOfLegendItemsToProcess, this._numberOfRowsPerColumn[0]); 639 Math.Min(this._numberOfLegendItemsToProcess, this._itemColumns); 920 this._offset.Width = (int)Math.Ceiling(singleWCharacterSize.Width / 2f); 921 this._offset.Height = (int)Math.Ceiling(singleWCharacterSize.Width / 3f); 952 highestHeader.Height = Math.Max(highestHeader.Height, headerSize.Height); 1005 int newFontSize = (int)Math.Round(this.Font.Size - this._autoFitFontSizeAdjustment); 1027 horizSpaceLeft -= Math.Min(4, horizSpaceLeft); 1028 vertSpaceLeft -= Math.Min(2, vertSpaceLeft); 1035 optimalSize.Width = Math.Max(optimalSize.Width, titleSize.Width); 1332 averageColumnWidth = (int)Math.Round((double)(legendSize.Width - horSpaceLeft) / columnNumber) / 2; 1398 maxColumnHeight = Math.Max(maxColumnHeight, columnHeight); 1680 maxNumberOfColumns = Math.Max(maxNumberOfColumns, rowsPerColumn[columnIndex]); 1796 cellSize.Width = (int)Math.Max(cellSize.Width, legendColumn.MinimumWidth * singleWCharacterSize.Width / 100f); 1800 cellSize.Width = (int)Math.Min(cellSize.Width, legendColumn.MaximumWidth * singleWCharacterSize.Width / 100f); 1813 Math.Max(cellHeights[currentColumn, currentRow], cellSize.Height); 1869 width = Math.Max(width, cellWidth ); 1902 (int)Math.Max(subColumnSizes[currentColumn, currentSubColumn], legendColumn.MinimumWidth * singleWCharacterSize.Width / 100f); 1907 (int)Math.Min(subColumnSizes[currentColumn, currentSubColumn], legendColumn.MaximumWidth * singleWCharacterSize.Width / 100f); 1979 width = Math.Max(width, subColumnSizes[currentColumn, currentSubColumn]); 2019 totalHeight = Math.Max(totalHeight, columnHeight); 2056 this._numberOfCells = Math.Max(this._numberOfCells, legendItem.Cells.Count); 2537 step = (int)Math.Min(step, 10); 2541 this._legendItemsAreaPosition.X + this._legendItemsAreaPosition.Width / 2 - step * (float)Math.Floor(markerCount/2f), 4926 float areaSpacing = Math.Min((chartAreasRectangle.Height/100F) * elementSpacing, (chartAreasRectangle.Width/100F) * elementSpacing); 5028 float areaSpacing = Math.Min((legendPlottingRectangle.Height/100F) * elementSpacing, (legendPlottingRectangle.Width/100F) * elementSpacing); 6214int maxBorderWidth = (int)Math.Round((2 * dpi) / 96); 6228borderWidth <= (int)Math.Round(dpi / 96) )
Common\General\LegendColumns.cs (13)
1500 cellSize.Width = (int)(Math.Abs(this.SeriesSymbolSize.Width) * singleWCharacterSize.Width / 100f); 1501 cellSize.Height = (int)(Math.Abs(this.SeriesSymbolSize.Height) * singleWCharacterSize.Height / 100f); 1518 cellSize.Width = (int)(Math.Abs(this.ImageSize.Width) * singleWCharacterSize.Width / 100f); 1519 cellSize.Height = (int)(Math.Abs(this.ImageSize.Height) * singleWCharacterSize.Height / 100f); 1676 int newFontSize = (int)Math.Round(cellFont.Size - fontSizeReducedBy); 2137 scaleValue = Math.Max(scaleValue, (float)imagePosition.Width / (float)imageCellPosition.Width); 2307scaleValue = Math.Max(scaleValue, (float)imageScale.Width / (float)seriesMarkerPosition.Width); 2339int maxShadowOffset = (int)Math.Round((3 * chartGraph.Graphics.DpiX) / 96); 2340int maxBorderWidth = (int)Math.Round((3 * chartGraph.Graphics.DpiX) / 96); 2344int maxBorderWidthRect = (int)Math.Round((2 * chartGraph.Graphics.DpiX) / 96); 2407 int markerSize = (int)Math.Min(seriesMarkerPosition.Width, seriesMarkerPosition.Height); 2408 markerSize = (int)Math.Min(legendItem.markerSize, (legendItem.style == LegendImageStyle.Line) ? 2f*(markerSize/3f) : markerSize); 2448 scaleValue = Math.Max(scaleValue, (float)imageScale.Width / (float)seriesMarkerPosition.Width);
Common\General\Matrix3D.cs (47)
258 angleX = angleX / 180F * (float)Math.PI; 259 angleY = angleY / 180F * (float)Math.PI; 281 Rotate( Math.PI / 2, RotationAxis.Y ); 286 Rotate( -Math.PI / 2, RotationAxis.Y ); 329 if( point.X - _translateX < 0F && Math.Abs( point.X - _translateX ) > minX ) 330 minX = Math.Abs( point.X - _translateX ); 332 if( point.X - _translateX >=0F && Math.Abs( point.X - _translateX ) > maxX ) 333 maxX = Math.Abs( point.X - _translateX ); 335 if( point.Y - _translateY < 0F && Math.Abs( point.Y - _translateY ) > minY ) 336 minY = Math.Abs( point.Y - _translateY ); 338 if( point.Y - _translateY >=0F && Math.Abs( point.Y - _translateY ) > maxY ) 339 maxY = Math.Abs( point.Y - _translateY ); 357 if( maxXScale < Math.Abs(point.X - _translateX) / width * 2 ) 358 maxXScale = Math.Abs(point.X - _translateX) / width * 2; 361 if( maxYScale < Math.Abs(point.Y - _translateY) / height * 2 ) 362 maxYScale = Math.Abs(point.Y - _translateY) / height * 2; 728 rotationMatrix[1][1] = (float)Math.Cos( angle ); 729 rotationMatrix[1][2] = (float)-Math.Sin( angle ); 730 rotationMatrix[2][1] = (float)Math.Sin( angle ); 731 rotationMatrix[2][2] = (float)Math.Cos( angle ); 736 rotationMatrix[0][0] = (float)Math.Cos( angle ); 737 rotationMatrix[0][2] = (float)Math.Sin( angle ); 738 rotationMatrix[2][0] = (float)-Math.Sin( angle ); 739 rotationMatrix[2][2] = (float)Math.Cos( angle ); 744 rotationMatrix[0][0] = (float)Math.Cos( angle ); 745 rotationMatrix[0][1] = (float)-Math.Sin( angle ); 746 rotationMatrix[1][0] = (float)Math.Sin( angle ); 747 rotationMatrix[1][1] = (float)Math.Cos( angle ); 955 front = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[1])/Math.PI ); 957 back = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[2])/Math.PI ); 969 left = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[3])/Math.PI ); 971 right = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[4])/Math.PI ); 974 top = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[5])/Math.PI ); 976 bottom = ChartGraphics.GetGradientColor( surfaceColor, Color.Black, GetAngle(lightSource,_lightVectors[6])/Math.PI ); 987 front = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[1])/Math.PI ); 989 back = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[2])/Math.PI ); 991 left = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[3])/Math.PI ); 993 right = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[4])/Math.PI ); 995 top = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[5])/Math.PI ); 997 bottom = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[6])/Math.PI ); 1113 if( Math.Abs( angleLeft - angleRight ) < 0.01 ) 1157 color = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[2])/Math.PI ); 1162 color = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,_lightVectors[1])/Math.PI ); 1171 color = GetBrightGradientColor( surfaceColor, GetAngle(lightSource,normalVector)/Math.PI ); 1215 angle = Math.Acos( ( a.X * b.X + a.Y * b.Y + a.Z * b.Z ) / ( Math.Sqrt( a.X * a.X + a.Y * a.Y + a.Z * a.Z ) * Math.Sqrt( b.X * b.X + b.Y * b.Y + b.Z * b.Z ) ) );
Common\General\SmartLabels.cs (2)
809 float minMove = (float)Math.Min(smartLabelStyle.MinMovingDistance, smartLabelStyle.MaxMovingDistance); 810 float maxMove = (float)Math.Max(smartLabelStyle.MinMovingDistance, smartLabelStyle.MaxMovingDistance);
Common\General\StripLine.cs (7)
369 rect.Y = (float)Math.Min(pos1, pos2); 370 rect.Height = (float)Math.Max(pos1, pos2) - rect.Y; 379 rect.X = (float)Math.Min(pos1, pos2); 380 rect.Width = (float)Math.Max(pos1, pos2) - rect.X; 786float angleXAxis = (float)Math.Atan( 789angleXAxis = (float)Math.Round(angleXAxis * 180f / (float)Math.PI);
Common\General\Title.cs (2)
2065 float areaSpacing = Math.Min((chartAreasRectangle.Height/100F) * elementSpacing, (chartAreasRectangle.Width/100F) * elementSpacing); 2198 float areaSpacing = Math.Min((titlePlottingRectangle.Height/100F) * elementSpacing, (titlePlottingRectangle.Width/100F) * elementSpacing);
WinForm\Utilities\Printing.cs (2)
266chartPosition.Width = (int)(chartPosition.Width * Math.Min(chartWidthScale, chartHeightScale)); 267chartPosition.Height = (int)(chartPosition.Height * Math.Min(chartWidthScale, chartHeightScale));
System.Workflow.Activities (46)
Designers\StateDesigner.cs (7)
1426deltaY = Math.Max(deltaY, minimumY - stateDesigner.Location.Y); 1434freeSpaceHeight = Math.Min(freeSpaceHeight, stateDesigner.Location.Y - minimumY); 1457maximumY = Math.Max(maximumY, stateDesigner.Bounds.Bottom); 1504newSize.Width = Math.Max(newSize.Width, bounds.Right); 1505newSize.Height = Math.Max(newSize.Height, bounds.Bottom); 1508newSize.Width = Math.Max(newSize.Width, this.MinimumSize.Width); 1509newSize.Height = Math.Max(newSize.Height, this.MinimumSize.Height);
Designers\StateDesigner.Layouts.cs (21)
451int height = Math.Max(_imageSize.Height, _textSize.Height); 669minimumSize.Width = Math.Max(minimumSize.Width, layoutWidth); 678size.Width = Math.Max(containerSize.Width, minimumSize.Height); 774size.Height = Math.Max(size.Height, layout.Size.Height); 970minimumSize.Height = Math.Max(_textLayout.Size.Height, _imageLayout.Size.Height); 975size.Width = Math.Max(minimumSize.Width, containerSize.Width); 1103minimumSize.Width = Math.Max(minimumSize.Width, RealMinimumSize.Width); 1104minimumSize.Height = Math.Max(minimumSize.Height, RealMinimumSize.Height); 1132int minWidth = Math.Max(_titleBarLayout.MinimumSize.Width, _eventHandlersLayout.MinimumSize.Width); 1136size.Width = Math.Max(minWidth, size.Width); 1137size.Height = Math.Max(minHeight, size.Height); 1159maximumX = Math.Max(maximumX, designer.Size.Width); 1320size.Width = Math.Max(size.Width, minSize.Width); 1321size.Height = Math.Max(size.Height, minSize.Height); 1331size.Width = Math.Max(size.Width, activeDesignerSize.Width + ActiveDesignerPadding * 2); 1332size.Width = Math.Max(size.Width, _titleBarLayout.Size.Width); 1333size.Width = Math.Max(size.Width, _breadCrumbBarLayout.Size.Width); 1341size.Height = Math.Max(size.Height, minHeight); 1347size.Width = Math.Max(size.Width, activeDesigner.Size.Width + ActiveDesignerPadding * 2); 1348size.Width = Math.Max(size.Width, _designerLayout.Size.Width); 1349size.Height = Math.Max(size.Height, activeDesigner.Size.Height + ActiveDesignerPadding * 2 + _designerLayout.Size.Height + ambientTheme.SelectionSize.Height * 2);
Designers\StateMachineDesignerPaint.cs (8)
47return new Size(Convert.ToInt32(Math.Ceiling(textSize.Width)), Convert.ToInt32(Math.Ceiling(textSize.Height))); 123capSize = Math.Min(Math.Min(capSize, maxCapSize.Width), maxCapSize.Height); 150capSize = Math.Min(Math.Min(capSize, maxCapSize.Width), maxCapSize.Height); 270return Math.Abs(p1.Y - p2.Y); 272return Math.Abs(p1.X - p2.X);
Designers\StateMachineWorkflowDesigner.cs (4)
81minimumSize.Width = Math.Max(minimumSize.Width, MinSize.Width); 82minimumSize.Height = Math.Max(minimumSize.Height, MinSize.Height); 85minimumSize.Width = Math.Max(minimumSize.Width, ParentView.ViewPortSize.Width - StateDesigner.Separator.Width * 2); 86minimumSize.Height = Math.Max(minimumSize.Height, ParentView.ViewPortSize.Height - StateDesigner.Separator.Height * 2);
Rules\Design\Dialogs\BasicBrowserDialog.cs (1)
231int newSelectionIndex = Math.Min(selectionIndex, this.rulesListView.Items.Count - 1);
Rules\Design\Dialogs\IntellisenseTextBox.cs (3)
426clientPoint.Y += (int)Math.Ceiling(this.Font.GetHeight()) + 2; 430clientPoint.Y += (int)Math.Ceiling(this.Font.GetHeight()); 499clientPoint.Y += (int)Math.Ceiling(this.Font.GetHeight()) + 2;
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 (296)
AuthoringOM\Design\ActivityDesigner.cs (7)
237value.Width = Math.Max(value.Width, MinimumSize.Width); 238value.Height = Math.Max(value.Height, MinimumSize.Height); 1715requestedLineSize.Width *= Math.Min(Text.Length, ActivityDesigner.MaximumCharsPerLine - 1); 1720this.textSize.Width = Math.Min(this.textSize.Width, actualTextSize.Width); 1721this.textSize.Width = Math.Max(this.textSize.Width, requestedLineSize.Width); 1727textLines = Math.Min(textLines, ActivityDesigner.MaximumTextLines); 1737size.Height = e.AmbientTheme.Margin.Height + Math.Max(e.DesignerTheme.ImageSize.Height, this.textSize.Height) + e.AmbientTheme.Margin.Height;
AuthoringOM\Design\ActivityPreviewDesigner.cs (7)
613containerSize.Width = Math.Max(containerSize.Width, this.previewStrip.Size.Width); 622containerSize.Width = Math.Max(containerSize.Width, this.previewWindow.Size.Width); 631containerSize.Width = Math.Max(containerSize.Width, size.Width); 637containerSize.Width = Math.Max(containerSize.Width, MinimumSize.Width); 638containerSize.Height = Math.Max(containerSize.Height, MinimumSize.Height); 935Size selectionSize = new Size(Math.Max(itemBounds.Width / 6, 1), Math.Max(itemBounds.Height / 6, 1));
AuthoringOM\Design\CommandSet.cs (3)
289int newZoom = (int)(100.0f / this.workflowView.ActiveLayout.Scaling * Math.Min((float)this.workflowView.ViewPortSize.Width / (float)this.workflowView.ActiveLayout.Extent.Width, (float)this.workflowView.ViewPortSize.Height / (float)this.workflowView.ActiveLayout.Extent.Height)); 290this.workflowView.Zoom = Math.Min(Math.Max(newZoom, AmbientTheme.MinZoom), AmbientTheme.MaxZoom);
AuthoringOM\Design\CompositeActivityDesigner.cs (7)
267titleHeight = Math.Max(expandButtonRectangle.Height, textRectangle.Height); 272titleHeight = Math.Max(expandButtonRectangle.Height, imageRectangle.Height); 341requestedLineSize.Width *= Math.Min(Text.Length, CompositeActivityDesigner.MaximumCharsPerLine - 1); 344textSize.Width = Math.Min(maxAvailableWidth, this.actualTextSize.Width); 345textSize.Width = Math.Max(1, Math.Max(textSize.Width, requestedLineSize.Width)); 350textLines = Math.Min(textLines, CompositeActivityDesigner.MaximumTextLines);
AuthoringOM\Design\Connector.cs (42)
189defaultSize = new Size(Math.Max(defaultSize.Width, (int)this.associatedDesigner.DesignerTheme.ForegroundPen.Width * 4), Math.Max(defaultSize.Height, (int)this.associatedDesigner.DesignerTheme.ForegroundPen.Width * 4)); 1128Orientation orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical; 1145Orientation orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical; 1192Orientation orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical; 1197orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical; 1213Orientation orientation = (Math.Abs(slopeOfLine) < 1) ? Orientation.Horizontal : Orientation.Vertical; 1381if (Math.Abs(slope1) == Math.Abs(slope2)) 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); 1826int width = Math.Max(margin.Width / 2, 1), height = Math.Max(margin.Height / 2, 1); 2233Point direction = new Point(Math.Sign(p.X - Z.X), Math.Sign(p.Y - Z.Y)); 2239direction = new Point(Math.Sign(p.X - Z.X), Math.Sign(p.Y - Z.Y)); 2474int steps = Math.Max(Math.Abs(direction.X / margin.Width), Math.Abs(direction.Y / margin.Height)); //one of the values will be null 2475direction.X = Math.Sign(direction.X); 2476direction.Y = Math.Sign(direction.Y); 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)) 2722return Math.Sqrt((double)(p.X - q.X) * (p.X - q.X) + (double)(p.Y - q.Y) * (p.Y - q.Y)); 2983newDistance = Math.Abs(newCover.A.X - escape.X); 2985newDistance = Math.Abs(newCover.A.Y - escape.Y); 2987if (Math.Sign(newDistance) == Math.Sign(originalDistance) && Math.Abs(newDistance) < Math.Abs(originalDistance))
AuthoringOM\Design\DesignerHelpers.cs (30)
79return new Size(Convert.ToInt32(Math.Ceiling(textSize.Width)), Convert.ToInt32(Math.Ceiling(textSize.Height))); 203rectangle.Width = Math.Min(size.Width, destination.Width); 204rectangle.Height = Math.Min(size.Height, destination.Height); 295int alpha = Math.Max(0, Convert.ToInt32(transparency * 255)); 335for (int gridCoOrdX = gridStart.X; gridCoOrdX <= viewableRectangle.Right; gridCoOrdX += Math.Max(ambientTheme.GridSize.Width, 1)) 337for (int gridCoOrdY = gridStart.Y; gridCoOrdY <= viewableRectangle.Bottom; gridCoOrdY += Math.Max(ambientTheme.GridSize.Height, 1)) 465int alphaIncreament = Math.Max((baseAlphaLevel / shadowDepth), 2); 505Rectangle bounds = new Rectangle(0, 0, Convert.ToInt32(Math.Ceiling(boundsF.Width)), Convert.ToInt32(Math.Ceiling(boundsF.Height))); 602capSize = Math.Min(Math.Min(capSize, maxCapSize.Width), maxCapSize.Height); 632capSize = Math.Min(Math.Min(capSize, maxCapSize.Width), maxCapSize.Height); 1034for (int gridCoOrd = gridStart.X; gridCoOrd <= viewableRectangle.Right; gridCoOrd += Math.Max(gridUnit.Width, 1)) 1063for (int gridCoOrd = gridStart.Y; gridCoOrd <= viewableRectangle.Bottom; gridCoOrd += Math.Max(gridUnit.Height, 1)) 1867minDistance = Math.Min(minDistance, distances[i]); 1888leftTop.X = Math.Min(leftTop.X, point.X); 1889leftTop.Y = Math.Min(leftTop.Y, point.Y); 1890rightBottom.X = Math.Max(rightBottom.X, point.X); 1891rightBottom.Y = Math.Max(rightBottom.Y, point.Y); 1930minDistance = Math.Min(minDistance, distances[i]); 1938int area = Math.Abs((((point.Y - line[0].Y) * (line[1].X - line[0].X)) - ((point.X - line[0].X) * (line[1].Y - line[0].Y)))); 1939return Math.Sqrt(Math.Pow(area, 2) / (Math.Pow((line[1].X - line[0].X), 2) + Math.Pow((line[1].Y - line[0].Y), 2))); 1973double d = Math.Sqrt(Math.Pow(point2.X - point1.X, 2) + Math.Pow(point2.Y - point1.Y, 2));
AuthoringOM\Design\DesignerWidgets.cs (49)
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)); 693if (newPosition >= 0 && newPosition <= Math.Max(this.items.Count - visibleItems + 1, 0)) 842visibleItemCount = totalStripSize / Math.Max((this.itemSize.Width + this.margin.Width), 1); 847visibleItemCount = totalStripSize / Math.Max((this.itemSize.Height + this.margin.Height), 1); 850return Math.Max(visibleItemCount, 1); 898newPosition = Math.Max(index - 1, 0); 1265textRectangle.Height = Math.Min(textRectangle.Height, this.maxTextHeight); 1342maxTextSize.Width = Math.Max(Convert.ToInt32(Math.Ceiling(size.Width)), maxTextSize.Width); 1343maxTextSize.Height = Math.Max(Convert.ToInt32(Math.Ceiling(size.Height)), maxTextSize.Height); 1346maxTextSize.Width = Math.Min(maxTextSize.Width, this.maximumTextWidth); 1348this.itemHeight = Math.Max(imageRectangle.Height, maxTextSize.Height + 2) + 3; 1553int minExtra = Math.Max(this.splitter.MinSize, Width - this.tabStrip.MaximumRequiredSize - this.splitter.Width); 1560int minExtra = Math.Max(this.splitter.MinSize, Height - this.tabStrip.MaximumRequiredSize - this.splitter.Height); 1700this.reqTabItemSize = Math.Max(tabSize, TabStrip.MinSize); 1978this.drawItems[i].TextSize = new Size(Convert.ToInt32(Math.Ceiling(sizef.Width)), Convert.ToInt32(Math.Ceiling(sizef.Height))); 2009int itemSizeDecrease = (int)Math.Ceiling(((double)(offset - maxTotalTabItemSize)) / (double)Math.Max(1, this.tabItemList.Count)); 2016itemSizeDecrease += (int)Math.Ceiling(((double)(this.reqTabItemSize - lastItemWidth)) / (double)Math.Max(1, this.tabItemList.Count)); 2167int width = Convert.ToInt32((Math.Ceiling(textSize.Width) / 3)) * 30; 2533int maxItems = Math.Min(this.items.Count - this.scrollMarker, VisibleItemCount) + 1; 2711int selectionSize = Math.Max(Math.Min(itemMargin.Width / 4, itemMargin.Height / 2), 1); 2789if (newMarker >= 0 && newMarker <= Math.Max(this.items.Count - VisibleItemCount + 1, 0)) 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); 3242int maxDescHeight = Math.Max(this.previewModeDescRectangle.Height, this.previewModeButtonRectangle.Height); 3376this.canvasBounds.Size = new Size(Math.Max(this.canvasBounds.Width, designerTheme.PreviewWindowSize.Width), Math.Max(this.canvasBounds.Height, designerTheme.PreviewWindowSize.Height)); 3383this.canvasBounds.Width = Math.Max(this.canvasBounds.Width, minWidth); 3386this.previewDescTextSize = new Size(Convert.ToInt32(Math.Ceiling(stringSize.Width)), Convert.ToInt32(Math.Ceiling(stringSize.Height))); 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); 3395totalSize.Height = Math.Max(this.previewModeButtonRectangle.Size.Height, this.previewDescTextSize.Height); 3461stretchFactor = Math.Max(stretchFactor, ((double)previewedActivityImage.Height) / maxBitmapSize.Height); 3462stretchFactor = Math.Max(stretchFactor, 1.3f); 3464destnRectangle.Width = Convert.ToInt32(Math.Ceiling((float)previewedActivityImage.Width / stretchFactor)); 3465destnRectangle.Height = Convert.ToInt32(Math.Ceiling((float)previewedActivityImage.Height / stretchFactor)); 3565stretchFactor = Math.Min(stretchFactor, ((float)previewSize.Height) / previewDesignerSize.Height);
AuthoringOM\Design\Dialogs\ThemeConfigurationDialog.cs (2)
381this.designerTreeView.ItemHeight = Math.Max(this.designerTreeView.ItemHeight, 18); 1219Zoom = Convert.ToInt32((Math.Min(zoom.X, zoom.Y) * 100));
AuthoringOM\Design\DocumentOutline.cs (1)
71this.treeView.ItemHeight = Math.Max(this.treeView.ItemHeight, 18);
AuthoringOM\Design\FreeFormDesigner.cs (14)
253minimumSize.Width = Math.Max(minimumSize.Width, workflowView.ViewPortSize.Width - 2 * WorkflowRootLayout.Separator.Width); 254minimumSize.Height = Math.Max(minimumSize.Height, workflowView.ViewPortSize.Height - 2 * WorkflowRootLayout.Separator.Height); 262minimumSize.Width = Math.Max(minimumSize.Width, childRectangle.Width); 263minimumSize.Height = Math.Max(minimumSize.Height, childRectangle.Height); 791newLocation.X = Math.Min(newLocation.X, childRectangle.Left); 792newLocation.Y = Math.Min(newLocation.Y, childRectangle.Top); 823size.Width += Math.Max(bounds.Left - childRectangle.Left, 0); 824size.Width += Math.Max(childRectangle.Right - bounds.Right, 0); 825size.Height += Math.Max(bounds.Top - childRectangle.Top, 0); 826size.Height += Math.Max(childRectangle.Bottom - bounds.Bottom, 0); 935bounds.X = Math.Min(minRectangle.Left, e.Bounds.Left); 936bounds.Y = Math.Min(minRectangle.Top, e.Bounds.Top); 937bounds.Width = Math.Max(minRectangle.Right - bounds.Left, e.Bounds.Right - bounds.Left); 938bounds.Height = Math.Max(minRectangle.Bottom - bounds.Top, e.Bounds.Bottom - bounds.Top);
AuthoringOM\Design\MessageFilters\ConnectionManager.cs (2)
125(Math.Abs(this.initialDragPoint.Value.X - logicalPoint.X) > SystemInformation.DragSize.Width || 126Math.Abs(this.initialDragPoint.Value.Y - logicalPoint.Y) > SystemInformation.DragSize.Height))
AuthoringOM\Design\MessageFilters\DragDropManager.cs (3)
117else if (parentView.RootDesigner != null && this.dragStarted && (eventArgs.Button & MouseButtons.Left) > 0 && (Math.Abs(this.dragInitiationPoint.X - logicalPoint.X) > SystemInformation.DragSize.Width || Math.Abs(this.dragInitiationPoint.Y - logicalPoint.Y) > SystemInformation.DragSize.Height)) 678Size draggedImageSize = parentView.LogicalSizeToClient(new Size(imageRectangle.Width + descriptionRectangle.Width, Math.Max(imageRectangle.Height, descriptionRectangle.Height)));
AuthoringOM\Design\MessageFilters\DragSelectionMessageFilter.cs (6)
66(Math.Abs(this.startDrag.X - logicalPoint.X) > (int)(dragMultiply * (float)SystemInformation.DragSize.Width) || Math.Abs(this.startDrag.Y - logicalPoint.Y) > (int)(dragMultiply * (float)SystemInformation.DragSize.Height))) 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\DynamicActionMessageFilter.cs (2)
526this.transparency = Math.Max(DynamicAction.DefaultTransparency, value); 569int buttonCount = Math.Max(1, this.buttons.Count);
AuthoringOM\Design\MessageFilters\ResizingMessageFilter.cs (8)
195if (Math.Floor(DesignerGeometryHelper.DistanceFromPointToLineSegment(point, new Point[] { new Point(designerBounds.Left, designerBounds.Top), new Point(designerBounds.Left, designerBounds.Bottom) })) <= selectionSize.Width + 1) 197if (Math.Floor(DesignerGeometryHelper.DistanceFromPointToLineSegment(point, new Point[] { new Point(designerBounds.Left, designerBounds.Top), new Point(designerBounds.Right, designerBounds.Top) })) <= selectionSize.Height + 1) 199if (Math.Floor(DesignerGeometryHelper.DistanceFromPointToLineSegment(point, new Point[] { new Point(designerBounds.Right, designerBounds.Top), new Point(designerBounds.Right, designerBounds.Bottom) })) <= selectionSize.Width + 1) 201if (Math.Floor(DesignerGeometryHelper.DistanceFromPointToLineSegment(point, new Point[] { new Point(designerBounds.Left, designerBounds.Bottom), new Point(designerBounds.Right, designerBounds.Bottom) })) <= selectionSize.Height + 1) 287x = Math.Max(x, clipBounds.X); 299y = Math.Max(y, clipBounds.Y); 314designerBounds.Width = Math.Max(designerBounds.Width, designerToSize.MinimumSize.Width); 315designerBounds.Height = Math.Max(designerBounds.Height, designerToSize.MinimumSize.Height);
AuthoringOM\Design\MessageFilters\WindowManager.cs (2)
425newZoom = Math.Max(newZoom, AmbientTheme.MinZoom); 426newZoom = Math.Min(newZoom, AmbientTheme.MaxZoom);
AuthoringOM\Design\MessageFilters\ZoomingMessageFilter.cs (3)
171int zoom = (int)(Math.Min((float)parentView.ViewPortSize.Width / (float)dragRectangle.Width, (float)parentView.ViewPortSize.Height / (float)dragRectangle.Height) * 100.0f); 185parentView.Zoom = Math.Min(Math.Max(zoomLevel, AmbientTheme.MinZoom), AmbientTheme.MaxZoom);
AuthoringOM\Design\ParallelActivityDesigner.cs (2)
256containerSize.Height = Math.Max(containerSize.Height, childSize.Height); 268size.Width = Math.Max(size.Width, containerSize.Width);
AuthoringOM\Design\SequentialActivityDesigner.cs (4)
485containerSize.Width = Math.Max(containerSize.Width, childSize.Width); 493containerSize.Width = Math.Max(helpTextRectangle.Width, containerSize.Width); 498containerSize.Width = Math.Max(containerSize.Width, compositeDesignerTheme.Size.Width); 501containerSize.Height = Math.Max(containerSize.Height, compositeDesignerTheme.Size.Height);
AuthoringOM\Design\SequentialWorkflowHeaderFooter.cs (1)
111bounds.Width = Math.Max(imageBounds.Width, textBounds.Width) + 2 * margin.Width;
AuthoringOM\Design\SequentialWorkflowRootDesigner.cs (7)
94minimumSize.Width = Math.Max(minimumSize.Width, SequentialWorkflowRootDesigner.MinSize.Width); 95minimumSize.Height = Math.Max(minimumSize.Width, SequentialWorkflowRootDesigner.MinSize.Height); 98minimumSize.Width = Math.Max(minimumSize.Width, ParentView.ViewPortSize.Width - 2 * WorkflowRootLayout.Separator.Width); 99minimumSize.Height = Math.Max(minimumSize.Height, ParentView.ViewPortSize.Height - 2 * WorkflowRootLayout.Separator.Height); 402headerBarRectangle.Height = Math.Max(2 * WorkflowTheme.CurrentTheme.AmbientTheme.Margin.Height + base.textSize.Height, MinHeaderBarHeight); 433bounds.Height = Math.Max(bounds.Height, rootDesigner.Size.Height - rootDesigner.TitleHeight - rootDesigner.OptimalHeight); 440bounds.Height = Math.Max(minHeight, bounds.Height);
AuthoringOM\Design\StructuredCompositeActivityDesigner.cs (3)
167minimumSize.Width = Math.Max(minimumSize.Width, 160); 168minimumSize.Height = Math.Max(minimumSize.Height, 160); 564containerSize.Width = Math.Max(containerSize.Width, activeDesigner.Size.Width);
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\WorkflowLayouts.cs (32)
88return new Size(Math.Max(totalSize.Width, clientSize.Width), Math.Max(totalSize.Height, clientSize.Height)); 223return new Size(Math.Max(totalSize.Width, clientSize.Width), Math.Max(totalSize.Height, clientSize.Height)); 321totalSize.Width = Math.Max(totalSize.Width, layoutExtent.Width); 322totalSize.Height = Math.Max(totalSize.Height, layoutExtent.Height); 323return new Size(Math.Max(0, (totalSize.Width - layoutExtent.Width) / 2), Math.Max(0, (totalSize.Height - layoutExtent.Height) / 2)); 390alignment.X = Math.Max(alignment.X, selectionSize.Width + selectionSize.Width / 2); 394alignment.Y = Math.Max(alignment.Y, selectionSize.Height + selectionSize.Height / 2); 662bitmapDrawingPoint.X = pageLayoutData.ViewablePageBounds.X + Math.Abs(pageLayoutData.LogicalPageBounds.X - intersectedViewPort.X); 663bitmapDrawingPoint.Y = pageLayoutData.ViewablePageBounds.Y + Math.Abs(pageLayoutData.LogicalPageBounds.Y - intersectedViewPort.Y); 741printableArea.Width = Math.Max(printableArea.Width, 1); 742printableArea.Height = Math.Max(printableArea.Height, 1); 749this.scaling = Math.Min(scaleFactor.X, scaleFactor.Y); 751this.scaling = (float)(Math.Floor((double)this.scaling * 1000.0d) / 1000.0d); 756this.pageSize.Width = Convert.ToInt32(Math.Ceiling(((float)this.pageSize.Width) / this.scaling)); 757this.pageSize.Height = Convert.ToInt32(Math.Ceiling(((float)this.pageSize.Height) / this.scaling)); 766PageSeparator = new Size(Convert.ToInt32(Math.Ceiling(((float)PageSeparator.Width) / this.scaling)), Convert.ToInt32(Math.Ceiling(((float)PageSeparator.Height) / this.scaling))); 782viewablePageSize.Width = Math.Max(viewablePageSize.Width, 1); 783viewablePageSize.Height = Math.Max(viewablePageSize.Height, 1); 789this.rowColumns.Width = Math.Max(1, this.rowColumns.Width); 794this.rowColumns.Height = Math.Max(1, this.rowColumns.Height); 829size.Width = Math.Max(paperSize.Height, 1); 830size.Height = Math.Max(paperSize.Width, 1); 834size.Width = Math.Max(paperSize.Width, 1); 835size.Height = Math.Max(paperSize.Height, 1); 860Margins adjustedMargins = new Margins(Math.Max(margins.Left, hardMargins.Left), 861Math.Max(margins.Right, hardMargins.Right), 862Math.Max(margins.Top, hardMargins.Top), 863Math.Max(margins.Bottom, hardMargins.Bottom));
AuthoringOM\Design\WorkflowPrinting.cs (28)
122Margins margins = new Margins(Math.Max(printPageArg.PageSettings.Margins.Left, hardMargins.Left), 123Math.Max(printPageArg.PageSettings.Margins.Right, hardMargins.Right), 124Math.Max(printPageArg.PageSettings.Margins.Top, hardMargins.Top), 125Math.Max(printPageArg.PageSettings.Margins.Bottom, hardMargins.Bottom)); 154viewPortSize.Width = Convert.ToInt32(Math.Ceiling((float)printableArea.Width / this.scaling)); 155viewPortSize.Height = Convert.ToInt32(Math.Ceiling((float)printableArea.Height / this.scaling)); 158scaledAlignment.X = Convert.ToInt32(Math.Ceiling((float)this.workflowAlignment.X / this.scaling)); 159scaledAlignment.Y = Convert.ToInt32(Math.Ceiling((float)this.workflowAlignment.Y / this.scaling)); 220Point dpi = new Point(Math.Max(NativeMethods.GetDeviceCaps(hDC, NativeMethods.LOGPIXELSX), 1), Math.Max(NativeMethods.GetDeviceCaps(hDC, NativeMethods.LOGPIXELSY), 1)); 256for (int i = 0; i < Math.Min(headerFooterLines.Length, MaxHeaderFooterLines); i++) 266layoutRectangle.Size = new Size(Convert.ToInt32(Math.Ceiling((stringSize.Width))), Convert.ToInt32(Math.Ceiling((stringSize.Height)))); 267layoutRectangle.Width = Math.Min(headerFooterPrintData.PageBoundsWithoutMargin.Width, layoutRectangle.Width); 322Margins margins = new Margins(Math.Max(printPageArg.PageSettings.Margins.Left, hardMargins.Left), 323Math.Max(printPageArg.PageSettings.Margins.Right, hardMargins.Right), 324Math.Max(printPageArg.PageSettings.Margins.Top, hardMargins.Top), 325Math.Max(printPageArg.PageSettings.Margins.Bottom, hardMargins.Bottom)); 327printableArea.Width = Math.Max(printableArea.Width, 1); 328printableArea.Height = Math.Max(printableArea.Height, 1); 340this.scaling = Math.Min(xScaling, YScaling); 342this.scaling = (float)(Math.Floor((double)this.scaling * 1000.0d) / 1000.0d); 346this.totalPrintablePages.X = Convert.ToInt32(Math.Ceiling((this.scaling * (float)rootDesignerSize.Width) / (float)printableArea.Width)); 347this.totalPrintablePages.X = Math.Max(this.totalPrintablePages.X, 1); 348this.totalPrintablePages.Y = Convert.ToInt32(Math.Ceiling((this.scaling * (float)rootDesignerSize.Height) / (float)printableArea.Height)); 349this.totalPrintablePages.Y = Math.Max(this.totalPrintablePages.Y, 1); 360this.workflowAlignment.X = Math.Max(this.workflowAlignment.X, selectionSize.Width + selectionSize.Width / 2); 361this.workflowAlignment.Y = Math.Max(this.workflowAlignment.Y, selectionSize.Height + selectionSize.Height / 2);
AuthoringOM\Design\WorkflowView.cs (17)
447viewPortSize.Height = Math.Max(0, viewPortSize.Height - HScrollBar.Height); 449viewPortSize.Width = Math.Max(0, viewPortSize.Width - VScrollBar.Width); 466value.X = Math.Min(value.X, hScrollBar.Maximum - hScrollBar.LargeChange + 1); 467value.X = Math.Max(value.X, hScrollBar.Minimum); 474value.Y = Math.Min(value.Y, vScrollBar.Maximum - vScrollBar.LargeChange + 1); 475value.Y = Math.Max(value.Y, vScrollBar.Minimum); 945int newZoom = (int)(100.0f / ActiveLayout.Scaling * Math.Min((float)ViewPortSize.Width / (float)ActiveLayout.Extent.Width, (float)ViewPortSize.Height / (float)ActiveLayout.Extent.Height)); 946Zoom = Math.Min(Math.Max(newZoom, AmbientTheme.MinZoom), AmbientTheme.MaxZoom); 1034this.viewPortBitmap = new Bitmap(Math.Max(1, ViewPortSize.Width), Math.Max(1, ViewPortSize.Height), e.Graphics); 1273hScrollBar.Bounds = new Rectangle(0, Math.Max(0, Height - SystemInformation.HorizontalScrollBarHeight), Math.Max(Width - ((vScrollBar.Visible) ? SystemInformation.VerticalScrollBarWidth : 0), 0), SystemInformation.HorizontalScrollBarHeight); 1276vScrollBar.Bounds = new Rectangle(Math.Max(0, Width - SystemInformation.VerticalScrollBarWidth), 0, SystemInformation.VerticalScrollBarWidth, Math.Max(Height - ((hScrollBar.Visible) ? SystemInformation.HorizontalScrollBarHeight : 0), 0)); 1798Size largeChangeSize = new Size(Math.Min(maximumScrollSize.Width, currentSize.Width), Math.Min(maximumScrollSize.Height, currentSize.Height));
AuthoringOM\Serializer\ActivityCodeDomSerializer.cs (1)
55statement.LinePragma = new CodeLinePragma((string)rootActivity.GetValue(ActivityCodeDomSerializer.MarkupFileNameProperty), Math.Max((int)activity.GetValue(ActivityMarkupSerializer.StartLineProperty), 1));
AuthoringOM\Serializer\ActivityTypeCodeDomSerializer.cs (1)
126field.LinePragma = new CodeLinePragma((string)rootActivity.GetValue(ActivityCodeDomSerializer.MarkupFileNameProperty), Math.Max((int)activity.GetValue(ActivityMarkupSerializer.StartLineProperty), 1));
AuthoringOM\Serializer\FormatterServicesNoSerializableCheck.cs (1)
199Type[] tempParentTypes = new Type[Math.Max(parentTypeCount * 2, 12)];
Shared\XomlSerializationHelpers.cs (5)
177codeSegment.LinePragma = new CodeLinePragma(fileName, Math.Max(lineNumber - 1, 1)); 337activityTypeDeclaration.LinePragma = new CodeLinePragma((string)rootActivity.GetValue(ActivityCodeDomSerializer.MarkupFileNameProperty), Math.Max((int)rootActivity.GetValue(ActivityMarkupSerializer.StartLineProperty), 1)); 355constructor.LinePragma = new CodeLinePragma((string)rootActivity.GetValue(ActivityCodeDomSerializer.MarkupFileNameProperty), Math.Max((int)rootActivity.GetValue(ActivityMarkupSerializer.StartLineProperty), 1)); 358method.LinePragma = new CodeLinePragma((string)rootActivity.GetValue(ActivityCodeDomSerializer.MarkupFileNameProperty), Math.Max((int)rootActivity.GetValue(ActivityMarkupSerializer.StartLineProperty), 1)); 373codeNamespaceImport.LinePragma = new CodeLinePragma((string)rootActivity.GetValue(ActivityCodeDomSerializer.MarkupFileNameProperty), Math.Max((int)rootActivity.GetValue(ActivityMarkupSerializer.StartLineProperty), 1));
System.Workflow.Runtime (4)
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));
WorkflowRuntime.cs (1)
64return dictionaryDictionary[Math.Abs(key.GetHashCode() % dictionaryDictionary.Count)];
System.Xml (10)
System\Xml\BinaryXml\SqlUtils.cs (2)
204bNewPrec = (byte)(Math.Min(NUMERIC_MAX_PRECISION, Math.Max(1, lAdjust + m_bPrec)));
System\Xml\Dom\XmlCharacterData.cs (2)
122count = Math.Max ( len - offset, 0); 147count = Math.Max ( len - offset, 0);
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);
System\Xml\XmlConvert.cs (1)
1147double temp = Math.Round(value);
System\Xml\XPath\Internal\NumberFunctions.cs (2)
90return Math.Floor((double) arg.Evaluate(nodeIterator)); 94return Math.Ceiling((double) arg.Evaluate(nodeIterator));
UIAutomationClientsideProviders (27)
MS\Internal\AutomationProxies\WindowsEditBox.cs (4)
404clientLocation.x = Math.Max(clientLocation.x, clientRect.left); 405clientLocation.x = Math.Min(clientLocation.x, clientRect.right); 406clientLocation.y = Math.Max(clientLocation.y, clientRect.top); 407clientLocation.y = Math.Min(clientLocation.y, clientRect.bottom);
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (13)
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); 495Math.Max(0, _provider.LineFromChar(End) - _provider.LinesPerPage() + 1); 680int height = Math.Abs(_provider.GetLogfont().lfHeight);; 707ArrayList rects = new ArrayList(Math.Max(endLine - startLine + 1, 0)); 802return Math.Round((double)(-logfont.lfHeight) * 72 / lpy); 849moved = Math.Min(count, limit - index); 894moved = Math.Min(count, lineMax - line - 1); 962moved = Math.Max(count, -oneBasedIndex); 1007int actualCount = Math.Max(count, -line);
MS\Internal\AutomationProxies\WindowsListView.cs (2)
1058int rowCount = (int) System.Math.Ceiling (((double) itemCount) / columnCount); 1703int future = (int) Math.Round (((si.nMax - deltaPage) - si.nMin) * fScrollPos / 100.0 + si.nMin);
MS\Internal\AutomationProxies\WindowsListViewItem.cs (1)
961clickPoint.x = Math.Min ((itemRectangle.left + 5), (itemRectangle.left + itemRectangle.right) / 2);
MS\Internal\AutomationProxies\WindowsMenu.cs (1)
2336cMoves = Math.Abs (cMoves);
MS\Internal\AutomationProxies\WindowsRichEditRange.cs (4)
89_range.SetRange(Math.Max(charRange.Start, paraRange.Start), Math.Min(charRange.End, paraRange.End)); 184int start = Math.Max(_range.Start, visibleRange.Start); 185int end = Math.Min(_range.End, visibleRange.End);
MS\Internal\AutomationProxies\WindowsScroll.cs (1)
313int newPos = (int) Math.Round (((si.nMax - delta) - si.nMin) * fScrollPos / 100.0 + si.nMin);
MS\Internal\AutomationProxies\WindowsTab.cs (1)
516int newPos = (int) Math.Round ((maxPos - minPos) * horizontalPercent / 100) + minPos;
WindowsBase (86)
Base\MS\Internal\IO\Packaging\CompoundFile\CompoundFileDeflateTransform.cs (2)
229sourceBufferSize = (int)(Math.Min(source.Length, (long)_defaultBlockSize)); 364size = Math.Max(size, buffer.Length + (buffer.Length >> 1)); // fast Length * 1.5
Base\MS\Internal\IO\Packaging\CompoundFile\RightsManagementEncryptedStream.cs (2)
813clearTextBuffer = new byte[Math.Max(0x1000, totalByteCount)]; 890_randomBuffer = new byte[Math.Max(16, count)]; // current block size is 16
Base\MS\Internal\IO\Packaging\CompressStream.cs (2)
640byte[] buf = new byte[Math.Min(0x1000, bytesToSeek)]; 646long n = Math.Min(bytesToSeek, buf.Length);
Base\MS\Internal\IO\Packaging\SparseMemoryStream.cs (4)
204int bytesToRead = (int) Math.Min((long)count, _currentStreamLength - _currentStreamPosition); 292_currentStreamLength = Math.Max(_currentStreamLength, _currentStreamPosition); 783byte[] zeroBytesBuf = new byte[Math.Min(0x80000, toSkip)]; // 512K chunks max 786int bytes = (int)Math.Min(toSkip, zeroBytesBuf.Length);
Base\MS\Internal\IO\Zip\ZipIOBlockManager.cs (2)
365byte[] tempBuffer = new byte [Math.Min(moveBlockSize,0x100000)]; // min(1mb, requested block size) 371int subBlockSize = (int)Math.Min((long)tempBuffer.Length, moveBlockSize - bytesMoved);
Base\MS\Internal\IO\Zip\ZipIOEndOfCentralDirectoryBlock.cs (1)
314long beginPos = Math.Max(0, endPos -_scanBlockSize);
Base\MS\Internal\IO\Zip\ZipIOExtraField.cs (2)
173Debug.Assert(Math.Abs(size) <= 100); 176if (Math.Abs(size) > UInt16.MaxValue)
Base\MS\Internal\IO\Zip\ZipIOFileItemStream.cs (6)
213persistedTailSize = Math.Min(_currentStreamLength, _persistedSize) - newStreamPosition; 217diskBytesToRead = (int)Math.Min((long)count, persistedTailSize); // this is a safe cast as count has int type 298diskBytesToWrite = (int) (Math.Min(count, _persistedSize - newStreamPosition)); // this is a safe cast as count has int type 321_currentStreamLength = Math.Max(_currentStreamLength, _currentStreamPosition); 369Math.Min(_persistedSize, _currentStreamLength), // in case the stream is smaller then our persisted block on 456long moveBlockSize = Math.Min(_persistedSize, _currentStreamLength);
Base\System\Windows\Media\Matrix.cs (12)
181this *= CreateRotationRadians(angle * (Math.PI/180.0)); 191this = CreateRotationRadians(angle * (Math.PI/180.0)) * this; 203this *= CreateRotationRadians(angle * (Math.PI/180.0), centerX, centerY); 215this = CreateRotationRadians(angle * (Math.PI/180.0), centerX, centerY) * this; 271this *= CreateSkewRadians(skewX * (Math.PI/180.0), 272skewY * (Math.PI/180.0)); 284this = CreateSkewRadians(skewX * (Math.PI/180.0), 285skewY * (Math.PI/180.0)) * this; 788double sin = Math.Sin(angle); 789double cos = Math.Cos(angle); 844matrix.SetMatrix(1.0, Math.Tan(skewY), 845Math.Tan(skewX), 1.0,
Base\System\Windows\Point.cs (2)
157return new Size(Math.Abs(point._x), Math.Abs(point._y));
Base\System\Windows\Rect.cs (18)
79_x = Math.Min(point1._x, point2._x); 80_y = Math.Min(point1._y, point2._y); 83_width = Math.Max(Math.Max(point1._x, point2._x) - _x, 0); 84_height = Math.Max(Math.Max(point1._y, point2._y) - _y, 0); 499double left = Math.Max(Left, rect.Left); 500double top = Math.Max(Top, rect.Top); 503_width = Math.Max(Math.Min(Right, rect.Right) - left, 0); 504_height = Math.Max(Math.Min(Bottom, rect.Bottom) - top, 0); 532double left = Math.Min(Left, rect.Left); 533double top = Math.Min(Top, rect.Top); 544double maxRight = Math.Max(Right, rect.Right); 545_width = Math.Max(maxRight - left, 0); 556double maxBottom = Math.Max(Bottom, rect.Bottom); 557_height = Math.Max(maxBottom - top, 0);
Base\System\Windows\Vector.cs (8)
50return Math.Sqrt(_x*_x + _y*_y); 72this /= Math.Max(Math.Abs(_x),Math.Abs(_y)); 102return Math.Atan2(sin, cos) * (180 / Math.PI); 289return new Size(Math.Abs(vector._x), Math.Abs(vector._y));
Shared\MS\Internal\DoubleUtil.cs (4)
63double eps = (Math.Abs(value1) + Math.Abs(value2) + 10.0) * DBL_EPSILON; 163return Math.Abs(value-1.0) < 10.0 * DBL_EPSILON; 176return Math.Abs(value) < 10.0 * DBL_EPSILON;
Shared\MS\Internal\IO\Packaging\PackagingUtilities.cs (3)
313int bytesRead = sourceStream.Read(buffer, 0, (int)Math.Min(bytesLeftToCopy, (long)bufferSize)); 395overlapBlockOffset = Math.Max(block1Offset, block2Offset); 396overlapBlockSize = Math.Min(block1Offset + block1Size, block2Offset + block2Size) - overlapBlockOffset;
Shared\MS\Internal\MatrixUtil.cs (12)
113rect._x = Math.Min(Math.Min(point0.X, point1.X), Math.Min(point2.X, point3.X)); 114rect._y = Math.Min(Math.Min(point0.Y, point1.Y), Math.Min(point2.Y, point3.Y)); 116rect._width = Math.Max(Math.Max(point0.X, point1.X), Math.Max(point2.X, point3.X)) - rect._x; 117rect._height = Math.Max(Math.Max(point0.Y, point1.Y), Math.Max(point2.Y, point3.Y)) - rect._y;
Shared\MS\Utility\FrugalList.cs (1)
1610int newCapacity = Math.Max(newCount + (newCount >> 2), MINSIZE);
Shared\MS\Utility\ItemList.cs (2)
110T[] newList = new T[Math.Max(List.Length * 2, Count + delta)]; 117List = new T[Math.Max(delta, 2)];
Shared\MS\Win32\HandleCollector.cs (1)
178handleCount = Math.Max(0, handleCount);
Shared\MS\Win32\NativeMethodsCLR.cs (2)
6215int count = Math.Min(bytes.Length, buffer.Length - offset); 6277int count = Math.Min(s.Length, buffer.Length - offset);