Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Core / CSharp / System / Windows / MeasureData.cs / 1 / 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
- DateTimeValueSerializer.cs
- FocusManager.cs
- Journal.cs
- ExtensionQuery.cs
- XmlHierarchyData.cs
- SqlCommandBuilder.cs
- Size3DValueSerializer.cs
- ConsoleKeyInfo.cs
- TextTreeTextElementNode.cs
- HtmlHistory.cs
- ErrorStyle.cs
- WebConvert.cs
- GridEntry.cs
- LingerOption.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- Activator.cs
- DateTimeFormat.cs
- FormViewDeleteEventArgs.cs
- Metafile.cs
- _Connection.cs
- InfoCardArgumentException.cs
- PackageRelationshipCollection.cs
- StyleSheetDesigner.cs
- GradientSpreadMethodValidation.cs
- CheckBoxFlatAdapter.cs
- WebDescriptionAttribute.cs
- SuppressIldasmAttribute.cs
- SequenceFullException.cs
- Vector3DCollectionConverter.cs
- PreservationFileWriter.cs
- DeviceSpecificChoiceCollection.cs
- SqlLiftIndependentRowExpressions.cs
- RotateTransform.cs
- ControlCodeDomSerializer.cs
- AuthorizationSection.cs
- MediaContext.cs
- XPathChildIterator.cs
- TextParagraphCache.cs
- TablePattern.cs
- Font.cs
- DataServiceHostFactory.cs
- SerialReceived.cs
- EntityDataSourceConfigureObjectContext.cs
- Transaction.cs
- LicenseContext.cs
- DataServiceKeyAttribute.cs
- SqlDataSource.cs
- StorageMappingFragment.cs
- SiteMapNodeItem.cs
- ResourceSetExpression.cs
- HotCommands.cs
- ValidationError.cs
- CompilerParameters.cs
- ValueType.cs
- SafeNativeMethods.cs
- RemotingSurrogateSelector.cs
- BinaryObjectReader.cs
- DataGridViewUtilities.cs
- XamlToRtfParser.cs
- HttpListenerPrefixCollection.cs
- RowBinding.cs
- ThemeInfoAttribute.cs
- ContainerFilterService.cs
- SqlTopReducer.cs
- ComPlusTypeValidator.cs
- PeerObject.cs
- XmlDataSource.cs
- ResourceReferenceExpressionConverter.cs
- AnnotationMap.cs
- GridEntry.cs
- InputScopeAttribute.cs
- MetadataWorkspace.cs
- SeverityFilter.cs
- WindowAutomationPeer.cs
- ExpressionStringBuilder.cs
- NativeActivityTransactionContext.cs
- SkewTransform.cs
- KeyGesture.cs
- XmlSchemaGroupRef.cs
- WebPartCollection.cs
- StagingAreaInputItem.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- DrawingState.cs
- _OSSOCK.cs
- NavigationWindowAutomationPeer.cs
- ProvidePropertyAttribute.cs
- Exceptions.cs
- CatalogPartCollection.cs
- TextSchema.cs
- Geometry.cs
- QilFunction.cs
- Stylesheet.cs
- XDeferredAxisSource.cs
- QualifierSet.cs
- Pair.cs
- NativeMethods.cs
- ConfigPathUtility.cs
- SqlAliasesReferenced.cs
- UmAlQuraCalendar.cs