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
- StandardCommands.cs
- WebControlAdapter.cs
- MobileListItem.cs
- InputReferenceExpression.cs
- SQLUtility.cs
- XsdDateTime.cs
- DbProviderSpecificTypePropertyAttribute.cs
- UnsettableComboBox.cs
- Int16Animation.cs
- Viewport3DVisual.cs
- RawAppCommandInputReport.cs
- GlobalAllocSafeHandle.cs
- PhysicalOps.cs
- TraceAsyncResult.cs
- OSFeature.cs
- MenuItemBinding.cs
- ToolStripItemImageRenderEventArgs.cs
- GPRECT.cs
- SortQueryOperator.cs
- SchemaCollectionPreprocessor.cs
- SiteMapDataSource.cs
- SectionVisual.cs
- InheritanceUI.cs
- CalendarAutoFormat.cs
- InvokePattern.cs
- ExeConfigurationFileMap.cs
- StylusPointPropertyId.cs
- TaskScheduler.cs
- _RequestLifetimeSetter.cs
- BaseComponentEditor.cs
- Vector3DKeyFrameCollection.cs
- TextBoxBase.cs
- EndOfStreamException.cs
- UnicodeEncoding.cs
- TextTrailingCharacterEllipsis.cs
- Visual3D.cs
- DefinitionProperties.cs
- XmlCDATASection.cs
- DataSourceSelectArguments.cs
- NavigatingCancelEventArgs.cs
- MsmqTransportElement.cs
- CanonicalFormWriter.cs
- XmlAggregates.cs
- SocketStream.cs
- ThrowHelper.cs
- EnglishPluralizationService.cs
- DataGridColumnCollection.cs
- ByteFacetDescriptionElement.cs
- SrgsSemanticInterpretationTag.cs
- Pkcs7Recipient.cs
- DataSvcMapFile.cs
- LongPath.cs
- AlignmentXValidation.cs
- GuidelineSet.cs
- HuffmanTree.cs
- ExtensionWindowResizeGrip.cs
- HttpResponse.cs
- NegatedCellConstant.cs
- RestrictedTransactionalPackage.cs
- XslTransform.cs
- StringUtil.cs
- Literal.cs
- MarginCollapsingState.cs
- SortedDictionary.cs
- Compiler.cs
- GeneralTransform3DTo2DTo3D.cs
- UpWmlMobileTextWriter.cs
- FocusWithinProperty.cs
- CalendarTable.cs
- ExecutionEngineException.cs
- DesignerAttribute.cs
- RowToParametersTransformer.cs
- SymbolMethod.cs
- FontNamesConverter.cs
- _FtpControlStream.cs
- DataGridViewImageColumn.cs
- MulticastDelegate.cs
- securitymgrsite.cs
- Column.cs
- HttpProcessUtility.cs
- CopyCodeAction.cs
- ColumnHeaderConverter.cs
- UrlPropertyAttribute.cs
- StylusButtonEventArgs.cs
- NegationPusher.cs
- ArrayTypeMismatchException.cs
- ArrayList.cs
- SpecialNameAttribute.cs
- datacache.cs
- ScriptResourceDefinition.cs
- OrderedDictionaryStateHelper.cs
- HttpConfigurationSystem.cs
- GeneralTransform.cs
- ResumeStoryboard.cs
- ConfigurationStrings.cs
- TextViewSelectionProcessor.cs
- DataGridRowDetailsEventArgs.cs
- LambdaSerializationException.cs
- XmlSchemaSubstitutionGroup.cs
- NativeMethods.cs