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
- PermissionSetTriple.cs
- InternalRelationshipCollection.cs
- EmptyQuery.cs
- EmptyQuery.cs
- BindingOperations.cs
- FontWeight.cs
- ColumnResizeAdorner.cs
- SqlDataSourceCommandParser.cs
- Function.cs
- WebConfigurationHost.cs
- SqlTransaction.cs
- EdmToObjectNamespaceMap.cs
- GACIdentityPermission.cs
- RegisterResponseInfo.cs
- WasAdminWrapper.cs
- UrlAuthorizationModule.cs
- FixedStringLookup.cs
- Task.cs
- MethodInfo.cs
- ConfigurationManagerHelper.cs
- RotationValidation.cs
- PersistenceTask.cs
- UnsafeNativeMethodsCLR.cs
- FieldAccessException.cs
- M3DUtil.cs
- RandomNumberGenerator.cs
- XmlSchemaSubstitutionGroup.cs
- XmlTextReaderImplHelpers.cs
- ObjectQueryState.cs
- MulticastNotSupportedException.cs
- EdmItemCollection.cs
- CollectionChangeEventArgs.cs
- ResourceManagerWrapper.cs
- SpinLock.cs
- NamedObject.cs
- XmlDocumentFragment.cs
- ListViewHitTestInfo.cs
- XPathDocumentBuilder.cs
- ListenerChannelContext.cs
- GlyphsSerializer.cs
- ReadOnlyHierarchicalDataSourceView.cs
- ProtocolProfile.cs
- MessageDroppedTraceRecord.cs
- EntityModelBuildProvider.cs
- Binding.cs
- ExitEventArgs.cs
- ObjectQueryProvider.cs
- HierarchicalDataSourceIDConverter.cs
- BooleanAnimationBase.cs
- AddressingVersion.cs
- Lease.cs
- CompilationRelaxations.cs
- Timer.cs
- CorrelationResolver.cs
- XDRSchema.cs
- DebugTracing.cs
- GridViewDeleteEventArgs.cs
- WindowsRebar.cs
- ComAwareEventInfo.cs
- ReachSerializableProperties.cs
- DefaultParameterValueAttribute.cs
- DateTimeFormat.cs
- IsolatedStorageFile.cs
- SeekStoryboard.cs
- Error.cs
- BatchParser.cs
- OutputCacheSettingsSection.cs
- EditorZoneBase.cs
- EntityException.cs
- GraphicsState.cs
- GeometryGroup.cs
- ScrollProviderWrapper.cs
- LoggedException.cs
- LeaseManager.cs
- Privilege.cs
- FixedHyperLink.cs
- DataGridrowEditEndingEventArgs.cs
- TcpHostedTransportConfiguration.cs
- Header.cs
- TraceUtility.cs
- DisplayInformation.cs
- CodeArrayIndexerExpression.cs
- ObjectConverter.cs
- ForeignKeyConstraint.cs
- ItemsPanelTemplate.cs
- SignedInfo.cs
- ToolStripStatusLabel.cs
- XmlValueConverter.cs
- DataGridItemCollection.cs
- GridViewColumnHeader.cs
- ChangeTracker.cs
- WmlCalendarAdapter.cs
- APCustomTypeDescriptor.cs
- StringUtil.cs
- DataMisalignedException.cs
- FacetValues.cs
- XmlQueryStaticData.cs
- DragDrop.cs
- PersonalizationEntry.cs
- ApplicationFileCodeDomTreeGenerator.cs