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
- BooleanConverter.cs
- XmlTypeMapping.cs
- XmlSignatureProperties.cs
- Glyph.cs
- UnsafeNativeMethods.cs
- DaylightTime.cs
- ValidationEventArgs.cs
- _BaseOverlappedAsyncResult.cs
- GCHandleCookieTable.cs
- Deserializer.cs
- TextControl.cs
- LineInfo.cs
- FormatterServicesNoSerializableCheck.cs
- sapiproxy.cs
- StreamSecurityUpgradeAcceptorBase.cs
- TextPointer.cs
- PseudoWebRequest.cs
- ServicePerformanceCounters.cs
- DBSqlParserColumn.cs
- ObjectToIdCache.cs
- InfoCardSymmetricCrypto.cs
- CompositeScriptReferenceEventArgs.cs
- Calendar.cs
- AccessDataSource.cs
- OdbcTransaction.cs
- QilChoice.cs
- ChannelDispatcherCollection.cs
- BitStack.cs
- WindowsTooltip.cs
- UnsafeNativeMethods.cs
- xmlglyphRunInfo.cs
- SafeReversePInvokeHandle.cs
- ClientTargetSection.cs
- Expression.DebuggerProxy.cs
- TemplateControlBuildProvider.cs
- PropertyMapper.cs
- MetafileHeader.cs
- ProbeDuplexAsyncResult.cs
- KeyEventArgs.cs
- ListDictionary.cs
- HttpHandler.cs
- SubstitutionResponseElement.cs
- StorageEntityContainerMapping.cs
- WebPartConnectionsConfigureVerb.cs
- RuleRefElement.cs
- DataGridViewCellParsingEventArgs.cs
- FilterQuery.cs
- UInt32Converter.cs
- SafeMemoryMappedViewHandle.cs
- InvalidEnumArgumentException.cs
- Journaling.cs
- DataColumnPropertyDescriptor.cs
- EntryWrittenEventArgs.cs
- RuntimeConfig.cs
- DropShadowEffect.cs
- DataGridViewCellValidatingEventArgs.cs
- DataBoundLiteralControl.cs
- FontWeight.cs
- WebControlsSection.cs
- XmlSchemaElement.cs
- Material.cs
- SrgsRulesCollection.cs
- Propagator.cs
- NumericUpDownAccelerationCollection.cs
- SparseMemoryStream.cs
- WindowsListView.cs
- EncodedStreamFactory.cs
- ProgressBar.cs
- DES.cs
- httpapplicationstate.cs
- MailAddressCollection.cs
- XmlNodeChangedEventArgs.cs
- ParserContext.cs
- ScrollContentPresenter.cs
- WebPartMenu.cs
- TypefaceCollection.cs
- FrameworkTextComposition.cs
- ExceptionCollection.cs
- BamlWriter.cs
- AppDomainUnloadedException.cs
- MouseCaptureWithinProperty.cs
- SimpleWebHandlerParser.cs
- TableProviderWrapper.cs
- CodeDefaultValueExpression.cs
- EdmConstants.cs
- SqlNotificationEventArgs.cs
- RNGCryptoServiceProvider.cs
- WebPartConnectionCollection.cs
- TableLayoutPanel.cs
- LinkArea.cs
- DataGridViewCellValidatingEventArgs.cs
- AdRotatorDesigner.cs
- ClientRolePrincipal.cs
- ImpersonateTokenRef.cs
- DesignerView.cs
- TraceUtils.cs
- CreationContext.cs
- SessionEndingCancelEventArgs.cs
- MethodAccessException.cs
- FileDialogPermission.cs