Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- FieldNameLookup.cs
- _FtpControlStream.cs
- Activity.cs
- WindowShowOrOpenTracker.cs
- LinqToSqlWrapper.cs
- SqlStream.cs
- PersistenceTypeAttribute.cs
- QueryHandler.cs
- SQLBinaryStorage.cs
- GenerateScriptTypeAttribute.cs
- AgileSafeNativeMemoryHandle.cs
- GridViewRowEventArgs.cs
- OdbcEnvironmentHandle.cs
- TextEditor.cs
- GeometryGroup.cs
- SByte.cs
- SqlLiftWhereClauses.cs
- HitTestDrawingContextWalker.cs
- XmlCustomFormatter.cs
- FixedPosition.cs
- DataConnectionHelper.cs
- SymLanguageVendor.cs
- StringResourceManager.cs
- Math.cs
- Trace.cs
- ItemList.cs
- PageHandlerFactory.cs
- CodeObject.cs
- MediaTimeline.cs
- MarshalByValueComponent.cs
- BlobPersonalizationState.cs
- Control.cs
- smtppermission.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- AdornerLayer.cs
- MobilePage.cs
- RichTextBoxConstants.cs
- SecurityTokenException.cs
- EqualityComparer.cs
- WebBrowserSiteBase.cs
- SimpleWorkerRequest.cs
- AssemblyAttributes.cs
- DataGridTablesFactory.cs
- SQLInt32Storage.cs
- Command.cs
- TemplateBuilder.cs
- CallbackException.cs
- DataGridColumnCollection.cs
- InputReferenceExpression.cs
- SchemaTableOptionalColumn.cs
- DiagnosticsConfigurationHandler.cs
- ExtensibleClassFactory.cs
- SystemException.cs
- StrokeNodeEnumerator.cs
- Condition.cs
- QueryCursorEventArgs.cs
- GridLength.cs
- BitmapEffectDrawingContent.cs
- Vector3dCollection.cs
- DrawingGroup.cs
- ViewKeyConstraint.cs
- ScrollEventArgs.cs
- ToolZone.cs
- DocumentViewerBase.cs
- MexBindingBindingCollectionElement.cs
- ViewEventArgs.cs
- ResourcePool.cs
- TrustSection.cs
- Renderer.cs
- C14NUtil.cs
- ContextMenuStrip.cs
- ToolStripItemRenderEventArgs.cs
- IndexingContentUnit.cs
- ReachObjectContext.cs
- TextShapeableCharacters.cs
- MemoryStream.cs
- WindowsToolbarItemAsMenuItem.cs
- parserscommon.cs
- StorageMappingFragment.cs
- FlowDocumentView.cs
- Input.cs
- CreateUserErrorEventArgs.cs
- WindowsListViewSubItem.cs
- ScriptMethodAttribute.cs
- WmlCalendarAdapter.cs
- FormsAuthenticationUser.cs
- RecordManager.cs
- Mutex.cs
- DataComponentMethodGenerator.cs
- WebPartMovingEventArgs.cs
- CustomErrorsSection.cs
- CommandBindingCollection.cs
- AuthorizationSection.cs
- MouseActionValueSerializer.cs
- PropertyChange.cs
- ToolStripSeparator.cs
- BinarySerializer.cs
- UrlPath.cs
- __Filters.cs
- EntityViewGenerationConstants.cs