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
- dbdatarecord.cs
- XPathBuilder.cs
- RtType.cs
- HijriCalendar.cs
- ObjectSet.cs
- _NTAuthentication.cs
- DeviceOverridableAttribute.cs
- TypeDescriptionProviderAttribute.cs
- Exception.cs
- ByeOperation11AsyncResult.cs
- GotoExpression.cs
- SafeTimerHandle.cs
- HTMLTagNameToTypeMapper.cs
- XmlSchemaDocumentation.cs
- IncomingWebRequestContext.cs
- PointLightBase.cs
- EventWaitHandleSecurity.cs
- Metafile.cs
- Propagator.ExtentPlaceholderCreator.cs
- SimpleMailWebEventProvider.cs
- RuleRef.cs
- KeyGestureConverter.cs
- updateconfighost.cs
- WorkflowInstanceRecord.cs
- String.cs
- FormatPage.cs
- FixedTextSelectionProcessor.cs
- EncoderBestFitFallback.cs
- StringStorage.cs
- FormatControl.cs
- CompressionTransform.cs
- TabControlEvent.cs
- KeyGestureConverter.cs
- pingexception.cs
- StructuralCache.cs
- ApplicationFileParser.cs
- LockedBorderGlyph.cs
- LinkLabel.cs
- HostingEnvironmentSection.cs
- WindowsButton.cs
- SecurityState.cs
- Tuple.cs
- EventLogPermissionEntry.cs
- ValidationError.cs
- DeferredElementTreeState.cs
- Floater.cs
- SystemEvents.cs
- MediaTimeline.cs
- CursorConverter.cs
- TypeUnloadedException.cs
- WebPartMinimizeVerb.cs
- HttpBrowserCapabilitiesWrapper.cs
- XmlValidatingReader.cs
- TableLayoutSettingsTypeConverter.cs
- RegisteredExpandoAttribute.cs
- CodeIdentifiers.cs
- NavigationPropertyAccessor.cs
- ProgressPage.cs
- Part.cs
- ZoneLinkButton.cs
- SafePEFileHandle.cs
- NameService.cs
- FloaterBaseParagraph.cs
- DBBindings.cs
- ResourceLoader.cs
- ScriptingJsonSerializationSection.cs
- AdRotator.cs
- DoubleAnimationBase.cs
- LongPath.cs
- IApplicationTrustManager.cs
- CodeMemberField.cs
- Rule.cs
- SQLBytesStorage.cs
- OdbcParameter.cs
- DataGridCaption.cs
- _PooledStream.cs
- AsmxEndpointPickerExtension.cs
- ServiceModelInstallComponent.cs
- HtmlTableRowCollection.cs
- XmlDataSourceNodeDescriptor.cs
- WrappedOptions.cs
- SerializationStore.cs
- ServiceRouteHandler.cs
- OleDbParameter.cs
- CodeMethodReturnStatement.cs
- QilParameter.cs
- PropertyInformationCollection.cs
- TypefaceMetricsCache.cs
- Action.cs
- ObjectCloneHelper.cs
- BasicExpressionVisitor.cs
- Compilation.cs
- CredentialManagerDialog.cs
- TransactionProtocolConverter.cs
- PartialCachingAttribute.cs
- Parser.cs
- X509ScopedServiceCertificateElement.cs
- PaperSource.cs
- BindingExpressionBase.cs
- RegularExpressionValidator.cs