Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- EditingCoordinator.cs
- XmlBaseWriter.cs
- CompositeDesignerAccessibleObject.cs
- ErrorFormatterPage.cs
- MouseGestureConverter.cs
- UrlMapping.cs
- State.cs
- XmlStrings.cs
- SatelliteContractVersionAttribute.cs
- MtomMessageEncodingBindingElement.cs
- ReadOnlyCollection.cs
- ListViewSelectEventArgs.cs
- RuntimeComponentFilter.cs
- BezierSegment.cs
- MailMessageEventArgs.cs
- RijndaelManagedTransform.cs
- LayoutManager.cs
- XmlSchemaChoice.cs
- RayHitTestParameters.cs
- EventLog.cs
- SHA512.cs
- WindowsListViewScroll.cs
- ObservableDictionary.cs
- Int64Storage.cs
- InkCanvasAutomationPeer.cs
- RewritingValidator.cs
- HitTestResult.cs
- DataGridTextBoxColumn.cs
- UInt64.cs
- RecordManager.cs
- PersistChildrenAttribute.cs
- DotNetATv1WindowsLogEntrySerializer.cs
- Pkcs7Recipient.cs
- RemotingConfiguration.cs
- AdornerHitTestResult.cs
- ColorKeyFrameCollection.cs
- CompoundFileDeflateTransform.cs
- RequestQueryParser.cs
- DataSysAttribute.cs
- WindowsComboBox.cs
- AnimationTimeline.cs
- DbConnectionOptions.cs
- ReadContentAsBinaryHelper.cs
- SecurityTokenProviderContainer.cs
- XmlSchemaSimpleContentRestriction.cs
- TypeGeneratedEventArgs.cs
- GrammarBuilderBase.cs
- DocumentPageHost.cs
- DockPattern.cs
- oledbmetadatacolumnnames.cs
- SessionIDManager.cs
- _ConnectionGroup.cs
- EntityDataSourceContainerNameItem.cs
- AutomationElementIdentifiers.cs
- WrappedIUnknown.cs
- OperationFormatter.cs
- WinEventTracker.cs
- XmlWrappingReader.cs
- DesignerAttribute.cs
- ToolStripItem.cs
- XmlWrappingReader.cs
- DateTimeParse.cs
- TranslateTransform3D.cs
- BaseAsyncResult.cs
- ModuleBuilderData.cs
- WindowsListViewSubItem.cs
- RecognizerInfo.cs
- WebPartVerbsEventArgs.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- PageCatalogPart.cs
- CombinedGeometry.cs
- SqlCommandBuilder.cs
- GradientBrush.cs
- ComponentDispatcherThread.cs
- DiagnosticsConfiguration.cs
- HitTestDrawingContextWalker.cs
- MouseButtonEventArgs.cs
- DataRowExtensions.cs
- XmlUnspecifiedAttribute.cs
- LogEntryUtils.cs
- HandlerBase.cs
- OrderedHashRepartitionStream.cs
- DesignerEventService.cs
- Matrix.cs
- EditorBrowsableAttribute.cs
- precedingsibling.cs
- ValuePattern.cs
- EntityTemplateUserControl.cs
- KeyTime.cs
- Renderer.cs
- HtmlWindow.cs
- TypeGeneratedEventArgs.cs
- ExpressionBuilderCollection.cs
- RowToParametersTransformer.cs
- SiteMembershipCondition.cs
- SafeNativeMethods.cs
- XmlObjectSerializer.cs
- CompilerLocalReference.cs
- GridItemProviderWrapper.cs
- ComponentSerializationService.cs