Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CachedBitmap.cs
- EventMappingSettings.cs
- MaterialCollection.cs
- SqlProfileProvider.cs
- GPRECT.cs
- UnionExpr.cs
- ScriptReference.cs
- HtmlButton.cs
- TreeNodeEventArgs.cs
- FontNamesConverter.cs
- PtsHost.cs
- Clipboard.cs
- ExtractCollection.cs
- MemoryRecordBuffer.cs
- DataGridTableCollection.cs
- WorkflowCommandExtensionItem.cs
- ListViewHitTestInfo.cs
- OLEDB_Util.cs
- GridItemPatternIdentifiers.cs
- ThousandthOfEmRealDoubles.cs
- XmlParserContext.cs
- StaticContext.cs
- SafeNativeMethods.cs
- EntityConnection.cs
- AssemblyResourceLoader.cs
- IHttpResponseInternal.cs
- Quad.cs
- ZipIOModeEnforcingStream.cs
- XPathDocumentNavigator.cs
- VerticalAlignConverter.cs
- Timer.cs
- TextContainer.cs
- CompilationSection.cs
- ByteStorage.cs
- OutputScopeManager.cs
- SqlTypesSchemaImporter.cs
- CompilerInfo.cs
- DragDrop.cs
- DependencyProperty.cs
- InlineUIContainer.cs
- Utils.cs
- DbConnectionPoolGroup.cs
- HitTestWithPointDrawingContextWalker.cs
- InvokeProviderWrapper.cs
- Operand.cs
- TextTreeInsertUndoUnit.cs
- ClientSettingsSection.cs
- EventLogConfiguration.cs
- Application.cs
- NativeMethods.cs
- Error.cs
- ProfilePropertySettings.cs
- EmissiveMaterial.cs
- TraceSection.cs
- ConfigurationPropertyAttribute.cs
- BitmapEffectDrawing.cs
- CategoryNameCollection.cs
- AdornerLayer.cs
- LogEntrySerializer.cs
- TypeUsage.cs
- SqlDataRecord.cs
- WebPartManager.cs
- MessageDescriptionCollection.cs
- backend.cs
- DbConnectionPoolGroupProviderInfo.cs
- ExpressionPrefixAttribute.cs
- ZipIOExtraFieldElement.cs
- CharKeyFrameCollection.cs
- TableDetailsRow.cs
- WindowsListViewGroupSubsetLink.cs
- UInt64Storage.cs
- PassportAuthentication.cs
- QuaternionAnimationBase.cs
- AppendHelper.cs
- ExtensionFile.cs
- TextElementCollection.cs
- ClrProviderManifest.cs
- ClientSettingsProvider.cs
- DataGridColumnReorderingEventArgs.cs
- Dump.cs
- TextTreeDeleteContentUndoUnit.cs
- RelationshipDetailsRow.cs
- DbConnectionStringCommon.cs
- WindowsAuthenticationModule.cs
- SafeFileMappingHandle.cs
- MimeBasePart.cs
- ImageClickEventArgs.cs
- EventProvider.cs
- Literal.cs
- UnaryExpression.cs
- ConditionCollection.cs
- MetadataPropertyAttribute.cs
- BamlLocalizableResource.cs
- InputEventArgs.cs
- PersonalizationState.cs
- CommunicationObjectManager.cs
- ConsoleCancelEventArgs.cs
- RtfToXamlReader.cs
- AsymmetricKeyExchangeFormatter.cs
- TypeName.cs