Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RuntimeEnvironment.cs
- PathGeometry.cs
- QueryCursorEventArgs.cs
- DocobjHost.cs
- EventLogPermissionEntryCollection.cs
- AuthenticationModuleElementCollection.cs
- EventProxy.cs
- LinqMaximalSubtreeNominator.cs
- WebUtil.cs
- ProjectionCamera.cs
- ResXResourceReader.cs
- AttributeCollection.cs
- HwndSubclass.cs
- Bitmap.cs
- CodeVariableDeclarationStatement.cs
- TextTreeUndo.cs
- SystemResourceHost.cs
- ManagementOperationWatcher.cs
- SoapCommonClasses.cs
- FirstMatchCodeGroup.cs
- RadioButtonBaseAdapter.cs
- _RequestCacheProtocol.cs
- WindowsProgressbar.cs
- FlowDocumentFormatter.cs
- UniqueCodeIdentifierScope.cs
- FixedSOMSemanticBox.cs
- RbTree.cs
- DataList.cs
- ResourceDescriptionAttribute.cs
- XmlAnyElementAttributes.cs
- PropagatorResult.cs
- UniqueIdentifierService.cs
- SystemShuttingDownException.cs
- DataGrid.cs
- StandardBindingElementCollection.cs
- AssemblyCache.cs
- GPRECTF.cs
- DbConnectionPoolGroupProviderInfo.cs
- TaskHelper.cs
- Vector3DIndependentAnimationStorage.cs
- MemberListBinding.cs
- UrlPropertyAttribute.cs
- ResolveInfo.cs
- MultipartContentParser.cs
- ErrorBehavior.cs
- Header.cs
- CodePrimitiveExpression.cs
- StylusCaptureWithinProperty.cs
- DictionaryItemsCollection.cs
- InternalConfigHost.cs
- ClaimSet.cs
- LowerCaseStringConverter.cs
- DataBindingExpressionBuilder.cs
- StrongNameKeyPair.cs
- DataKeyArray.cs
- XmlAutoDetectWriter.cs
- XmlSchemaInferenceException.cs
- DocumentStream.cs
- ResolvedKeyFrameEntry.cs
- WebPartDescription.cs
- ConditionalAttribute.cs
- returneventsaver.cs
- SelectedDatesCollection.cs
- TextElementEditingBehaviorAttribute.cs
- XmlSchemaSimpleTypeUnion.cs
- HttpCacheParams.cs
- GACIdentityPermission.cs
- Currency.cs
- StartUpEventArgs.cs
- WindowsFormsLinkLabel.cs
- CryptoStream.cs
- RegexRunner.cs
- FormViewActionList.cs
- Bitmap.cs
- SessionState.cs
- SelectionPatternIdentifiers.cs
- NameValuePair.cs
- ToolStripTextBox.cs
- LinqDataSourceStatusEventArgs.cs
- SemanticResolver.cs
- BindUriHelper.cs
- SvcFileManager.cs
- Int16Converter.cs
- ArrangedElementCollection.cs
- XmlEntityReference.cs
- DataPagerFieldCommandEventArgs.cs
- XPathDescendantIterator.cs
- AuthorizationSection.cs
- WebCategoryAttribute.cs
- XNodeValidator.cs
- DataIdProcessor.cs
- LinkButton.cs
- ObjectSelectorEditor.cs
- TimelineClockCollection.cs
- ObjectDesignerDataSourceView.cs
- CustomCredentialPolicy.cs
- StyleCollection.cs
- EventRoute.cs
- TreeNode.cs
- WebSysDisplayNameAttribute.cs