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
- UpDownBase.cs
- ClientData.cs
- Triangle.cs
- ManipulationCompletedEventArgs.cs
- WorkflowServiceOperationListItem.cs
- TextElement.cs
- HwndKeyboardInputProvider.cs
- Bidi.cs
- ColumnHeaderConverter.cs
- X509ChainPolicy.cs
- ResumeStoryboard.cs
- AttributeQuery.cs
- DocumentPageTextView.cs
- ClientCultureInfo.cs
- TargetConverter.cs
- XhtmlBasicPhoneCallAdapter.cs
- ByteRangeDownloader.cs
- NamedPipeAppDomainProtocolHandler.cs
- IntegerCollectionEditor.cs
- BaseInfoTable.cs
- TickBar.cs
- DateTimeUtil.cs
- OutKeywords.cs
- CriticalFinalizerObject.cs
- AvtEvent.cs
- X509InitiatorCertificateServiceElement.cs
- RIPEMD160.cs
- HMAC.cs
- EncryptedKeyIdentifierClause.cs
- MessagePropertyDescriptionCollection.cs
- AppSettingsReader.cs
- ContentType.cs
- DataListItem.cs
- Imaging.cs
- OracleFactory.cs
- EntityCodeGenerator.cs
- SimpleType.cs
- SafeFileHandle.cs
- CategoryGridEntry.cs
- TextUtf8RawTextWriter.cs
- PerformanceCounterLib.cs
- RenderData.cs
- DataGridViewCellEventArgs.cs
- State.cs
- SchemaImporterExtensionsSection.cs
- SqlCacheDependency.cs
- VectorAnimationBase.cs
- FormsAuthenticationUserCollection.cs
- ComponentDispatcher.cs
- AppearanceEditorPart.cs
- WebPartMenuStyle.cs
- TypeDescriptionProvider.cs
- DecoderNLS.cs
- JulianCalendar.cs
- HandoffBehavior.cs
- TypeDescriptionProviderAttribute.cs
- BlurEffect.cs
- WinHttpWebProxyFinder.cs
- safex509handles.cs
- BindStream.cs
- SizeF.cs
- LoadItemsEventArgs.cs
- EventMappingSettingsCollection.cs
- WebUtil.cs
- DataGridViewLinkColumn.cs
- ResourceContainer.cs
- Vector3dCollection.cs
- PageMediaType.cs
- SetStoryboardSpeedRatio.cs
- Win32Exception.cs
- ImageCodecInfo.cs
- DataSourceXmlSubItemAttribute.cs
- PrivilegeNotHeldException.cs
- LinkDesigner.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- LayeredChannelFactory.cs
- FilteredAttributeCollection.cs
- DesignerSerializationVisibilityAttribute.cs
- OciHandle.cs
- UInt32Storage.cs
- EventLogTraceListener.cs
- controlskin.cs
- _OverlappedAsyncResult.cs
- SqlDataSourceParameterParser.cs
- TagPrefixCollection.cs
- recordstatefactory.cs
- GorillaCodec.cs
- XmlSchemaComplexContent.cs
- RectangleF.cs
- BackStopAuthenticationModule.cs
- IChannel.cs
- RegexCapture.cs
- BulletedListEventArgs.cs
- SplitterPanelDesigner.cs
- XmlSerializerVersionAttribute.cs
- XmlSerializer.cs
- _OSSOCK.cs
- login.cs
- MgmtResManager.cs
- ImageAttributes.cs