Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------------------------- // //// 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
- AccessorTable.cs
- MessageQueueInstaller.cs
- XMLSchema.cs
- DataBindEngine.cs
- ToolBarButtonClickEvent.cs
- ListDataHelper.cs
- Base64Decoder.cs
- GridViewAutomationPeer.cs
- Partitioner.cs
- WindowsRichEditRange.cs
- CompilerParameters.cs
- TransactionScopeDesigner.cs
- SQLBoolean.cs
- RelationshipEndMember.cs
- OpenFileDialog.cs
- CompositeScriptReference.cs
- IisTraceListener.cs
- ArgumentException.cs
- BrowserDefinition.cs
- CollectionViewGroup.cs
- TargetParameterCountException.cs
- MimeParameter.cs
- BitmapEffectGroup.cs
- NativeWindow.cs
- VsPropertyGrid.cs
- GraphicsState.cs
- RecognizerStateChangedEventArgs.cs
- BoolExpressionVisitors.cs
- DesignerCommandAdapter.cs
- ClientScriptManagerWrapper.cs
- ObjectTypeMapping.cs
- _ConnectionGroup.cs
- FunctionMappingTranslator.cs
- FrugalMap.cs
- SortDescription.cs
- CodeArrayIndexerExpression.cs
- ResourceAssociationSetEnd.cs
- RoleGroup.cs
- ClientTargetSection.cs
- Configuration.cs
- CqlLexer.cs
- Schema.cs
- SurrogateDataContract.cs
- StandardOleMarshalObject.cs
- RtfToXamlLexer.cs
- EUCJPEncoding.cs
- MenuBindingsEditorForm.cs
- ElementHostAutomationPeer.cs
- FormsIdentity.cs
- MediaSystem.cs
- IPEndPoint.cs
- SignedXmlDebugLog.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- ExpandSegment.cs
- MsmqAppDomainProtocolHandler.cs
- ThreadLocal.cs
- TargetException.cs
- Geometry3D.cs
- DataStreamFromComStream.cs
- ContextProperty.cs
- StreamAsIStream.cs
- ParallelTimeline.cs
- HashHelpers.cs
- _ConnectionGroup.cs
- Trace.cs
- WindowsButton.cs
- Animatable.cs
- Attachment.cs
- mediaeventshelper.cs
- ActiveXSite.cs
- Matrix3DValueSerializer.cs
- SQLInt64Storage.cs
- XmlAttributeAttribute.cs
- RadioButtonList.cs
- InvalidOperationException.cs
- TrustLevelCollection.cs
- DependencyPropertyKind.cs
- HttpResponseHeader.cs
- DataMemberConverter.cs
- DiscardableAttribute.cs
- ResourceAssociationTypeEnd.cs
- XmlDomTextWriter.cs
- WrappedOptions.cs
- RemoteWebConfigurationHost.cs
- KnownIds.cs
- XmlElementAttribute.cs
- SyndicationDeserializer.cs
- NameNode.cs
- IncrementalCompileAnalyzer.cs
- WebPartDeleteVerb.cs
- XamlPoint3DCollectionSerializer.cs
- EntityDataSourceState.cs
- ReachPrintTicketSerializer.cs
- PrtTicket_Base.cs
- SecurityTokenContainer.cs
- UnauthorizedWebPart.cs
- SecurityPermission.cs
- AssociationEndMember.cs
- QueryMath.cs
- SchemaElementDecl.cs