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
- RoleGroupCollectionEditor.cs
- BamlRecordHelper.cs
- XmlHierarchyData.cs
- DriveInfo.cs
- NavigationService.cs
- DrawingGroup.cs
- TransformedBitmap.cs
- Light.cs
- AccessViolationException.cs
- TranslateTransform3D.cs
- XmlSchemaAppInfo.cs
- PersonalizationAdministration.cs
- QuadraticBezierSegment.cs
- DocumentReference.cs
- FixUp.cs
- NonSerializedAttribute.cs
- DataPagerFieldCollection.cs
- safex509handles.cs
- WebPartManager.cs
- RouteItem.cs
- PointLight.cs
- SmiEventStream.cs
- EdmToObjectNamespaceMap.cs
- GridViewDesigner.cs
- ImageButton.cs
- HighlightVisual.cs
- DataObject.cs
- PowerModeChangedEventArgs.cs
- MetadataArtifactLoaderCompositeResource.cs
- AddInDeploymentState.cs
- EntityReference.cs
- InkCanvasAutomationPeer.cs
- MetadataHelper.cs
- SecurityRuntime.cs
- NativeMethods.cs
- UnorderedHashRepartitionStream.cs
- HtmlInputSubmit.cs
- SqlCharStream.cs
- XmlDataSourceNodeDescriptor.cs
- XmlNodeChangedEventManager.cs
- TreeViewBindingsEditor.cs
- ReachVisualSerializer.cs
- GraphicsPathIterator.cs
- ControlParameter.cs
- QuadTree.cs
- SessionStateSection.cs
- MessageSecurityException.cs
- Figure.cs
- UnicastIPAddressInformationCollection.cs
- ConstrainedGroup.cs
- XmlSchemaAnyAttribute.cs
- FileDetails.cs
- Directory.cs
- ShapingWorkspace.cs
- Authorization.cs
- ZipFileInfoCollection.cs
- Encoder.cs
- FixedPageStructure.cs
- TokenFactoryCredential.cs
- TreeNodeCollection.cs
- LinearGradientBrush.cs
- SqlProcedureAttribute.cs
- OrthographicCamera.cs
- JapaneseCalendar.cs
- DecoderExceptionFallback.cs
- RowSpanVector.cs
- FixedPageAutomationPeer.cs
- HwndStylusInputProvider.cs
- SpellerError.cs
- loginstatus.cs
- ParallelDesigner.cs
- TextSelectionProcessor.cs
- GenerateHelper.cs
- WaitForChangedResult.cs
- SrgsSubset.cs
- SecurityTokenTypes.cs
- ReliableDuplexSessionChannel.cs
- NativeMethods.cs
- HyperLinkField.cs
- UIAgentMonitor.cs
- MarkupObject.cs
- WebConfigurationManager.cs
- AutomationIdentifierGuids.cs
- TemplateControl.cs
- DbSetClause.cs
- DateTimeConverter2.cs
- RootAction.cs
- XmlSchemaCollection.cs
- SourceElementsCollection.cs
- OdbcFactory.cs
- PartitionResolver.cs
- ZoneIdentityPermission.cs
- DocumentEventArgs.cs
- OneWayElement.cs
- DataServices.cs
- FileRecordSequence.cs
- DataContractSerializerElement.cs
- Int32.cs
- ButtonBase.cs
- WindowsIdentity.cs