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
- ObjectTag.cs
- PeerNameRecord.cs
- DataGridState.cs
- NetPeerTcpBinding.cs
- QuotedPrintableStream.cs
- TdsParser.cs
- DispatcherObject.cs
- ForceCopyBuildProvider.cs
- WorkflowStateRollbackService.cs
- SignedXmlDebugLog.cs
- UIAgentMonitor.cs
- UpdateDelegates.Generated.cs
- LinkConverter.cs
- WebPartConnectVerb.cs
- DataStreamFromComStream.cs
- CSharpCodeProvider.cs
- AuthenticationService.cs
- ReachVisualSerializer.cs
- SmiMetaData.cs
- DataRowCollection.cs
- ClockController.cs
- Vector3DAnimationBase.cs
- PageVisual.cs
- BamlTreeUpdater.cs
- SiteMapProvider.cs
- StoreItemCollection.Loader.cs
- ThreadSafeList.cs
- DriveInfo.cs
- SortFieldComparer.cs
- Soap12ProtocolReflector.cs
- FormViewDesigner.cs
- SmiRecordBuffer.cs
- TextRunTypographyProperties.cs
- CurrentChangedEventManager.cs
- OleDbDataAdapter.cs
- HeaderUtility.cs
- Operand.cs
- NameValueSectionHandler.cs
- DeferredElementTreeState.cs
- ResourceReferenceKeyNotFoundException.cs
- contentDescriptor.cs
- TreeNodeEventArgs.cs
- KeyPullup.cs
- BaseDataBoundControl.cs
- RunClient.cs
- HtmlValidatorAdapter.cs
- EncryptionUtility.cs
- EncoderExceptionFallback.cs
- HtmlInputReset.cs
- TabControlEvent.cs
- ImmutableObjectAttribute.cs
- MaterialCollection.cs
- UpdatePanelControlTrigger.cs
- ConfigurationSectionCollection.cs
- CounterSampleCalculator.cs
- NavigationProgressEventArgs.cs
- AppearanceEditorPart.cs
- Enlistment.cs
- ExpandCollapseIsCheckedConverter.cs
- IgnoreDeviceFilterElementCollection.cs
- SafeNativeMethods.cs
- OutputScope.cs
- UnitySerializationHolder.cs
- TextWriter.cs
- Dispatcher.cs
- DiagnosticsConfigurationHandler.cs
- DataGridViewCellEventArgs.cs
- DataFieldConverter.cs
- CompilerError.cs
- DiscreteKeyFrames.cs
- ViewManager.cs
- DataGridViewAccessibleObject.cs
- EventSinkHelperWriter.cs
- TextBreakpoint.cs
- SqlParameterCollection.cs
- XmlSchemaAttributeGroup.cs
- MessagePropertyDescriptionCollection.cs
- RouteCollection.cs
- RequestQueryProcessor.cs
- TypedTableBase.cs
- KnowledgeBase.cs
- HostingEnvironment.cs
- XmlSchemaSubstitutionGroup.cs
- Point4DConverter.cs
- AutomationPeer.cs
- WebPartPersonalization.cs
- DefaultMemberAttribute.cs
- SQLBytesStorage.cs
- MarkerProperties.cs
- DbModificationCommandTree.cs
- BuildProviderCollection.cs
- NonBatchDirectoryCompiler.cs
- WindowsComboBox.cs
- coordinatorfactory.cs
- BufferedReadStream.cs
- SafeIUnknown.cs
- ContactManager.cs
- CodeTypeDelegate.cs
- AssemblyBuilder.cs
- AsymmetricKeyExchangeDeformatter.cs