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
- basevalidator.cs
- IdentitySection.cs
- TextDecorationUnitValidation.cs
- documentsequencetextcontainer.cs
- HtmlControlDesigner.cs
- XamlTypeWithExplicitNamespace.cs
- GeometryConverter.cs
- MimeReflector.cs
- TemplatedMailWebEventProvider.cs
- BrowserCapabilitiesCodeGenerator.cs
- BufferBuilder.cs
- XmlEventCache.cs
- QueryPrefixOp.cs
- ConfigurationStrings.cs
- SqlConnectionStringBuilder.cs
- LiteralTextParser.cs
- PersonalizationProviderHelper.cs
- PropertyRef.cs
- BamlRecordHelper.cs
- BmpBitmapDecoder.cs
- XmlSchemaAll.cs
- TabletDeviceInfo.cs
- AutomationPropertyInfo.cs
- ImageIndexConverter.cs
- URLString.cs
- CheckBoxField.cs
- StickyNoteContentControl.cs
- ShaderEffect.cs
- XmlAttributeProperties.cs
- MimeObjectFactory.cs
- SqlUserDefinedTypeAttribute.cs
- NameObjectCollectionBase.cs
- RootBrowserWindowProxy.cs
- CacheChildrenQuery.cs
- ConstraintCollection.cs
- TheQuery.cs
- SqlAliasesReferenced.cs
- Constants.cs
- PlainXmlSerializer.cs
- NavigationFailedEventArgs.cs
- EntityDataSourceDataSelectionPanel.cs
- DirectoryRedirect.cs
- DataGridViewCellStyle.cs
- Calendar.cs
- LayoutManager.cs
- ValidationHelper.cs
- DllHostInitializer.cs
- XmlObjectSerializerReadContextComplex.cs
- CardSpaceShim.cs
- ObjectStorage.cs
- XPathSingletonIterator.cs
- TableRow.cs
- Object.cs
- DbParameterCollectionHelper.cs
- DbFunctionCommandTree.cs
- FrugalList.cs
- StackBuilderSink.cs
- AssemblyInfo.cs
- ArgumentsParser.cs
- ConfigXmlText.cs
- PenLineCapValidation.cs
- DataRecord.cs
- TabItem.cs
- WithStatement.cs
- GridViewCancelEditEventArgs.cs
- XmlAttributeOverrides.cs
- AdornedElementPlaceholder.cs
- CatalogZoneDesigner.cs
- NameTable.cs
- RawMouseInputReport.cs
- AutoResizedEvent.cs
- FormattedTextSymbols.cs
- SubMenuStyle.cs
- PageAsyncTaskManager.cs
- GroupBox.cs
- ParseElement.cs
- XmlArrayItemAttribute.cs
- BitmapEffectState.cs
- Win32MouseDevice.cs
- FixedElement.cs
- SimpleWebHandlerParser.cs
- ConfigurationSectionGroupCollection.cs
- BufferBuilder.cs
- Stack.cs
- XmlSchemaAppInfo.cs
- DataServiceRequestArgs.cs
- oledbmetadatacolumnnames.cs
- SmiContextFactory.cs
- ResourceDescriptionAttribute.cs
- SudsCommon.cs
- ReadOnlyDictionary.cs
- SEHException.cs
- TargetPerspective.cs
- InvalidCastException.cs
- ProgressBar.cs
- WebWorkflowRole.cs
- PaintEvent.cs
- CompilerLocalReference.cs
- IndexedString.cs
- PrintDialog.cs