Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / MeasureData.cs / 1305600 / MeasureData.cs
//---------------------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // This file defines a class intended to be passed as a parameter to Measure. It contains // available size and viewport information. // //------------------------------------------------------------------------------------- using MS.Internal; using System; using System.Windows.Media; namespace System.Windows { ////// Provides all the data we need during the Measure pass (most notably viewport information). Because of backwards /// compat we can't pass it in as a parameter to Measure so it's set as a property on UIElement directly before the call /// instead. /// internal class MeasureData { public MeasureData(Size availableSize, Rect viewport) { _availableSize = availableSize; _viewport = viewport; } public MeasureData(MeasureData data) : this (data.AvailableSize, data.Viewport) { } public bool HasViewport { get { return Viewport != Rect.Empty; } } public bool IsCloseTo(MeasureData other) { if (other == null) { return false; } bool isClose = DoubleUtil.AreClose(AvailableSize, other.AvailableSize); isClose &= DoubleUtil.AreClose(Viewport, other.Viewport); return isClose; } public Size AvailableSize { get { return _availableSize; } set { _availableSize = value; } } public Rect Viewport { get { return _viewport; } set { _viewport = value; } } private Size _availableSize; private Rect _viewport; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // This file defines a class intended to be passed as a parameter to Measure. It contains // available size and viewport information. // //------------------------------------------------------------------------------------- using MS.Internal; using System; using System.Windows.Media; namespace System.Windows { ////// Provides all the data we need during the Measure pass (most notably viewport information). Because of backwards /// compat we can't pass it in as a parameter to Measure so it's set as a property on UIElement directly before the call /// instead. /// internal class MeasureData { public MeasureData(Size availableSize, Rect viewport) { _availableSize = availableSize; _viewport = viewport; } public MeasureData(MeasureData data) : this (data.AvailableSize, data.Viewport) { } public bool HasViewport { get { return Viewport != Rect.Empty; } } public bool IsCloseTo(MeasureData other) { if (other == null) { return false; } bool isClose = DoubleUtil.AreClose(AvailableSize, other.AvailableSize); isClose &= DoubleUtil.AreClose(Viewport, other.Viewport); return isClose; } public Size AvailableSize { get { return _availableSize; } set { _availableSize = value; } } public Rect Viewport { get { return _viewport; } set { _viewport = value; } } private Size _availableSize; private Rect _viewport; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NullReferenceException.cs
- ToolStripButton.cs
- BrowserInteropHelper.cs
- TraceLevelHelper.cs
- WmlPageAdapter.cs
- XmlIlGenerator.cs
- NavigatorOutput.cs
- HtmlTitle.cs
- CacheAxisQuery.cs
- PartialCachingControl.cs
- ScrollPatternIdentifiers.cs
- DataListItemCollection.cs
- RoutedEvent.cs
- SchemaNamespaceManager.cs
- TemplateNameScope.cs
- NotCondition.cs
- DeviceContext2.cs
- DeflateStream.cs
- CodeSnippetTypeMember.cs
- TypeUtil.cs
- OwnerDrawPropertyBag.cs
- FactoryRecord.cs
- DataControlReferenceCollection.cs
- StringExpressionSet.cs
- EntityProviderFactory.cs
- SoapProtocolReflector.cs
- XamlStream.cs
- ListViewTableCell.cs
- EndPoint.cs
- ClientEventManager.cs
- Util.cs
- BehaviorEditorPart.cs
- FileLoadException.cs
- BaseCodePageEncoding.cs
- PrintControllerWithStatusDialog.cs
- CompilationUtil.cs
- FontInfo.cs
- TextServicesDisplayAttribute.cs
- ArgIterator.cs
- BookmarkResumptionRecord.cs
- EntityViewContainer.cs
- HandoffBehavior.cs
- TransformerInfoCollection.cs
- GridLength.cs
- IOException.cs
- PropertyNames.cs
- WebExceptionStatus.cs
- ZipQueryOperator.cs
- CompensableActivity.cs
- UIElement3D.cs
- SamlAttribute.cs
- Interfaces.cs
- UnsafeNetInfoNativeMethods.cs
- ReservationNotFoundException.cs
- CFStream.cs
- SafeRightsManagementQueryHandle.cs
- ZipIOCentralDirectoryFileHeader.cs
- CallTemplateAction.cs
- DataSpaceManager.cs
- XsdDuration.cs
- FlagsAttribute.cs
- ElapsedEventArgs.cs
- BlobPersonalizationState.cs
- MethodBody.cs
- Msec.cs
- AncillaryOps.cs
- FieldAccessException.cs
- GridItem.cs
- EdmMember.cs
- StreamWriter.cs
- GuidTagList.cs
- AffineTransform3D.cs
- LookupNode.cs
- unsafeIndexingFilterStream.cs
- Compiler.cs
- CalendarDay.cs
- safesecurityhelperavalon.cs
- CompoundFileStorageReference.cs
- QueryInterceptorAttribute.cs
- HitTestResult.cs
- TextProperties.cs
- IriParsingElement.cs
- IdnMapping.cs
- VoiceObjectToken.cs
- CompositeDataBoundControl.cs
- StackOverflowException.cs
- Point.cs
- GradientStopCollection.cs
- Site.cs
- EntityClientCacheEntry.cs
- XPathAxisIterator.cs
- TextBoxAutoCompleteSourceConverter.cs
- HtmlTableCell.cs
- SimpleBitVector32.cs
- CreateUserErrorEventArgs.cs
- FrugalList.cs
- Types.cs
- FieldAccessException.cs
- xamlnodes.cs
- StandardCommandToolStripMenuItem.cs