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
- TypeUnloadedException.cs
- ScriptControl.cs
- ObjectNavigationPropertyMapping.cs
- StrictModeSecurityHeaderElementInferenceEngine.cs
- ASCIIEncoding.cs
- DesignerActionPropertyItem.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- InfoCardClaimCollection.cs
- SystemIPInterfaceProperties.cs
- Tag.cs
- StateRuntime.cs
- ValidationErrorEventArgs.cs
- ClientTarget.cs
- FrameworkElementFactory.cs
- MergablePropertyAttribute.cs
- ListViewCancelEventArgs.cs
- NodeLabelEditEvent.cs
- WebPartConnectionsDisconnectVerb.cs
- HandlerWithFactory.cs
- NumberFunctions.cs
- ImplicitInputBrush.cs
- InitializerFacet.cs
- ActionItem.cs
- Timeline.cs
- FormViewCommandEventArgs.cs
- MarginCollapsingState.cs
- UpdateRecord.cs
- SqlConnection.cs
- WaitForChangedResult.cs
- GridItemPatternIdentifiers.cs
- DataControlFieldHeaderCell.cs
- TableLayoutPanelCodeDomSerializer.cs
- DesignObjectWrapper.cs
- CompiledQuery.cs
- UnmanagedMarshal.cs
- peersecuritysettings.cs
- FixedSchema.cs
- X509SecurityTokenProvider.cs
- CodeArrayCreateExpression.cs
- AppSettingsSection.cs
- GuidelineSet.cs
- KeyBinding.cs
- InstanceDataCollectionCollection.cs
- DataGridTablesFactory.cs
- Msec.cs
- EmulateRecognizeCompletedEventArgs.cs
- _Win32.cs
- SkinBuilder.cs
- DataGridRow.cs
- RetrieveVirtualItemEventArgs.cs
- BuildProvidersCompiler.cs
- MenuCommand.cs
- DetailsViewRowCollection.cs
- OptimizedTemplateContentHelper.cs
- PlatformCulture.cs
- TraceListener.cs
- TextAutomationPeer.cs
- BatchServiceHost.cs
- BindingList.cs
- SerTrace.cs
- XamlVector3DCollectionSerializer.cs
- BamlResourceSerializer.cs
- WorkflowIdleBehavior.cs
- RemoteWebConfigurationHostServer.cs
- CellTreeNode.cs
- ConfigXmlElement.cs
- TabControlCancelEvent.cs
- TextAutomationPeer.cs
- StatusBarDrawItemEvent.cs
- RuleSetReference.cs
- ErrorCodes.cs
- DataGridViewCellMouseEventArgs.cs
- SqlBulkCopyColumnMapping.cs
- Gdiplus.cs
- Converter.cs
- TableLayoutSettingsTypeConverter.cs
- ConnectionManagementElementCollection.cs
- PreviousTrackingServiceAttribute.cs
- FormattedText.cs
- AppSettingsSection.cs
- dataSvcMapFileLoader.cs
- MatrixAnimationUsingKeyFrames.cs
- ServerType.cs
- EmissiveMaterial.cs
- ContainerSelectorBehavior.cs
- EventLogEntryCollection.cs
- LayoutTable.cs
- RequestCacheValidator.cs
- SqlClientPermission.cs
- NavigateEvent.cs
- SpecularMaterial.cs
- InProcStateClientManager.cs
- Stopwatch.cs
- PropertyEmitterBase.cs
- AsymmetricAlgorithm.cs
- IndexedString.cs
- WriterOutput.cs
- XmlDownloadManager.cs
- StrokeNodeOperations2.cs
- FixedSOMPage.cs