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
- XmlMembersMapping.cs
- ExceptionUtil.cs
- RSACryptoServiceProvider.cs
- MDIWindowDialog.cs
- BooleanProjectedSlot.cs
- InputReferenceExpression.cs
- CheckoutException.cs
- XmlSerializerAssemblyAttribute.cs
- UnconditionalPolicy.cs
- HtmlContainerControl.cs
- arabicshape.cs
- HebrewCalendar.cs
- GridViewColumn.cs
- HtmlWindow.cs
- SqlError.cs
- Calendar.cs
- ChangeNode.cs
- ellipse.cs
- ToolStripItemBehavior.cs
- DataRowCollection.cs
- ModelTreeEnumerator.cs
- Command.cs
- ConnectionPointCookie.cs
- RootBrowserWindow.cs
- XmlLanguage.cs
- SparseMemoryStream.cs
- DefaultSection.cs
- IndexedGlyphRun.cs
- FileClassifier.cs
- SessionStateContainer.cs
- TdsValueSetter.cs
- Point3DCollection.cs
- SqlNotificationEventArgs.cs
- PageAsyncTask.cs
- ContainerFilterService.cs
- BaseCodeDomTreeGenerator.cs
- ToolbarAUtomationPeer.cs
- QuestionEventArgs.cs
- XmlSchemaAttributeGroupRef.cs
- HtmlForm.cs
- RuntimeWrappedException.cs
- ValidateNames.cs
- AcceleratedTokenProvider.cs
- NopReturnReader.cs
- DataGridCellInfo.cs
- ModelPropertyCollectionImpl.cs
- Verify.cs
- ScriptModule.cs
- BasicViewGenerator.cs
- TreeNodeStyle.cs
- CopyCodeAction.cs
- DecoderReplacementFallback.cs
- SimpleModelProvider.cs
- RemotingAttributes.cs
- DesignTable.cs
- FontSource.cs
- ConnectionManagementElementCollection.cs
- RelationshipDetailsRow.cs
- OnOperation.cs
- SimpleWorkerRequest.cs
- BadImageFormatException.cs
- RegexWorker.cs
- CodeAccessSecurityEngine.cs
- CreateSequenceResponse.cs
- IdentityReference.cs
- DataGridColumnCollectionEditor.cs
- SnapshotChangeTrackingStrategy.cs
- DataServiceBuildProvider.cs
- WorkflowQueue.cs
- SerialPort.cs
- DynamicValidatorEventArgs.cs
- SourceElementsCollection.cs
- LeaseManager.cs
- TriggerCollection.cs
- ApplicationActivator.cs
- HttpSessionStateWrapper.cs
- printdlgexmarshaler.cs
- CollectionViewGroup.cs
- DataGridCommandEventArgs.cs
- NumberFunctions.cs
- AlphaSortedEnumConverter.cs
- ProcessStartInfo.cs
- TcpActivation.cs
- OdbcReferenceCollection.cs
- SafeSystemMetrics.cs
- CodeAttributeArgumentCollection.cs
- WebDisplayNameAttribute.cs
- mongolianshape.cs
- ByteStorage.cs
- PointCollectionConverter.cs
- Itemizer.cs
- ResourcePool.cs
- LinearKeyFrames.cs
- SkinBuilder.cs
- QueryTreeBuilder.cs
- CalendarDataBindingHandler.cs
- UpdateManifestForBrowserApplication.cs
- OneWayChannelFactory.cs
- Contracts.cs
- CodeParameterDeclarationExpression.cs