Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- ProfilePropertySettingsCollection.cs
- TextRangeBase.cs
- ToolStripGrip.cs
- HtmlDocument.cs
- CriticalHandle.cs
- StandardMenuStripVerb.cs
- NetDataContractSerializer.cs
- EntityDataSourceStatementEditor.cs
- TypeDependencyAttribute.cs
- baseaxisquery.cs
- CollectionViewGroup.cs
- dbdatarecord.cs
- DesignerActionUIStateChangeEventArgs.cs
- MsmqIntegrationMessagePool.cs
- assemblycache.cs
- DataContractAttribute.cs
- HttpPostedFile.cs
- XmlUnspecifiedAttribute.cs
- StandardCommands.cs
- TypeBrowserDialog.cs
- LateBoundBitmapDecoder.cs
- CollectionsUtil.cs
- Speller.cs
- UInt64Storage.cs
- ModelPerspective.cs
- TreeNodeStyleCollection.cs
- DesignTimeParseData.cs
- Parameter.cs
- _ListenerResponseStream.cs
- BamlVersionHeader.cs
- TakeQueryOptionExpression.cs
- ReversePositionQuery.cs
- AddressHeaderCollectionElement.cs
- ExpressionTable.cs
- AssemblyNameProxy.cs
- ImageField.cs
- EntityDataSourceEntitySetNameItem.cs
- LinqDataSourceHelper.cs
- PriorityQueue.cs
- NotifyCollectionChangedEventArgs.cs
- RootContext.cs
- DataSourceControlBuilder.cs
- MsmqTransportBindingElement.cs
- Matrix3DStack.cs
- BamlBinaryReader.cs
- COM2FontConverter.cs
- UnsafeNativeMethods.cs
- SHA1Managed.cs
- ZipIOExtraField.cs
- DataGridItemEventArgs.cs
- DataList.cs
- FileResponseElement.cs
- PhysicalFontFamily.cs
- ZipIOExtraFieldElement.cs
- RtfToXamlLexer.cs
- WindowsListViewGroupHelper.cs
- InternalEnumValidator.cs
- processwaithandle.cs
- ConfigXmlComment.cs
- SafeSecurityHandles.cs
- TdsParserSafeHandles.cs
- XmlSchemaValidationException.cs
- RegexCharClass.cs
- FocusChangedEventArgs.cs
- ByteAnimationBase.cs
- WorkflowMarkupSerializerMapping.cs
- EastAsianLunisolarCalendar.cs
- SimpleRecyclingCache.cs
- FontNamesConverter.cs
- Visual3DCollection.cs
- COM2ComponentEditor.cs
- PackageRelationshipSelector.cs
- XhtmlTextWriter.cs
- NetworkInformationException.cs
- UniqueConstraint.cs
- FacetEnabledSchemaElement.cs
- CmsUtils.cs
- Cursors.cs
- SQLBinaryStorage.cs
- GridEntryCollection.cs
- Comparer.cs
- EncoderBestFitFallback.cs
- Simplifier.cs
- MultipleViewPatternIdentifiers.cs
- ResourcesGenerator.cs
- XmlLinkedNode.cs
- Base64Encoder.cs
- XmlSchemaCollection.cs
- WorkflowViewElement.cs
- RuleSetCollection.cs
- FontInfo.cs
- DataObjectPastingEventArgs.cs
- WebPartsPersonalizationAuthorization.cs
- basevalidator.cs
- RubberbandSelector.cs
- CompoundFileIOPermission.cs
- ValueHandle.cs
- Stream.cs
- FrameworkContentElementAutomationPeer.cs
- OutputCacheProviderCollection.cs