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
- Rotation3D.cs
- ObjectSet.cs
- CapabilitiesState.cs
- DataListItem.cs
- PathData.cs
- ExtendedProtectionPolicyElement.cs
- WpfKnownType.cs
- CSharpCodeProvider.cs
- ModulesEntry.cs
- IndexerNameAttribute.cs
- EventPropertyMap.cs
- ISCIIEncoding.cs
- ImageAutomationPeer.cs
- RequestCachingSection.cs
- SystemKeyConverter.cs
- AutoResizedEvent.cs
- ServiceProviders.cs
- QfeChecker.cs
- EncoderBestFitFallback.cs
- ObjectItemNoOpAssemblyLoader.cs
- PropertyRecord.cs
- UserControlBuildProvider.cs
- PrivilegedConfigurationManager.cs
- HtmlForm.cs
- TrackingDataItemValue.cs
- XmlnsCache.cs
- SoapHeaders.cs
- OutOfMemoryException.cs
- ComponentConverter.cs
- XsltContext.cs
- HtmlElementErrorEventArgs.cs
- DbMetaDataCollectionNames.cs
- XmlReader.cs
- IISMapPath.cs
- UnsafeNativeMethods.cs
- HttpGetClientProtocol.cs
- Domain.cs
- MessageHeaderDescription.cs
- DuplexChannel.cs
- BasicKeyConstraint.cs
- RequestValidator.cs
- CheckoutException.cs
- EntitySetBaseCollection.cs
- DbProviderManifest.cs
- EntityDescriptor.cs
- ProviderMetadataCachedInformation.cs
- Button.cs
- CodeAttachEventStatement.cs
- EntityContainerEntitySet.cs
- PackageProperties.cs
- BindingWorker.cs
- UniqueSet.cs
- ConfigurationManagerInternalFactory.cs
- ConnectionManagementSection.cs
- NetworkStream.cs
- login.cs
- RepeatButton.cs
- ThousandthOfEmRealPoints.cs
- RIPEMD160Managed.cs
- CodeFieldReferenceExpression.cs
- RepeaterCommandEventArgs.cs
- QueryOutputWriter.cs
- EditorPartChrome.cs
- FontWeight.cs
- VirtualPath.cs
- WebPartDescriptionCollection.cs
- RegexFCD.cs
- NumericExpr.cs
- ClientUrlResolverWrapper.cs
- FileSystemInfo.cs
- CodeVariableDeclarationStatement.cs
- LinqToSqlWrapper.cs
- ResolveMatchesCD1.cs
- TextContainerHelper.cs
- MemberAccessException.cs
- PeerApplication.cs
- BooleanExpr.cs
- HighContrastHelper.cs
- NativeMethods.cs
- NumericUpDownAccelerationCollection.cs
- SecurityResources.cs
- DocumentPageViewAutomationPeer.cs
- TraceUtility.cs
- MonthCalendar.cs
- AddInSegmentDirectoryNotFoundException.cs
- TerminateSequenceResponse.cs
- Events.cs
- Matrix3D.cs
- AsymmetricSignatureDeformatter.cs
- Walker.cs
- Solver.cs
- ImageButton.cs
- ObjectDataSourceEventArgs.cs
- ChameleonKey.cs
- ProviderIncompatibleException.cs
- CapacityStreamGeometryContext.cs
- BaseConfigurationRecord.cs
- DataBoundControlAdapter.cs
- CursorConverter.cs
- ActivityDesignerResources.cs