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
- SemaphoreFullException.cs
- UshortList2.cs
- BindingManagerDataErrorEventArgs.cs
- TextBox.cs
- SQLInt32.cs
- ErrorHandler.cs
- TextDecorationCollection.cs
- ContentElementAutomationPeer.cs
- SystemIPInterfaceStatistics.cs
- ScheduleChanges.cs
- ParameterModifier.cs
- ScrollProperties.cs
- EventProviderClassic.cs
- HyperlinkAutomationPeer.cs
- PropertyConverter.cs
- ProxyAttribute.cs
- TrackingDataItem.cs
- AssemblySettingAttributes.cs
- SqlDataSourceCache.cs
- SettingsProviderCollection.cs
- TypeLibConverter.cs
- Flowchart.cs
- WebPartVerb.cs
- XmlRootAttribute.cs
- SqlSelectClauseBuilder.cs
- ItemMap.cs
- PtsCache.cs
- URLAttribute.cs
- BitmapEffectInput.cs
- DropSource.cs
- Types.cs
- CmsInterop.cs
- CollectionView.cs
- ColumnMapCopier.cs
- ScriptControlDescriptor.cs
- LambdaExpression.cs
- InputProviderSite.cs
- XPathNodeIterator.cs
- ActiveDocumentEvent.cs
- DecimalConstantAttribute.cs
- XmlObjectSerializer.cs
- TemplateManager.cs
- ResXResourceWriter.cs
- WorkflowInstanceProvider.cs
- XmlAttributeCollection.cs
- EncoderReplacementFallback.cs
- KnownIds.cs
- SessionState.cs
- Vector3DCollectionValueSerializer.cs
- SendMailErrorEventArgs.cs
- DesignerGenericWebPart.cs
- DBBindings.cs
- FocusManager.cs
- TextBox.cs
- WinInet.cs
- MethodBuilderInstantiation.cs
- LicenseException.cs
- ModelUIElement3D.cs
- Select.cs
- PointLight.cs
- DateRangeEvent.cs
- EmptyControlCollection.cs
- LayoutTable.cs
- TrustLevel.cs
- SplashScreenNativeMethods.cs
- StrongNameKeyPair.cs
- DesignerLoader.cs
- DbConnectionClosed.cs
- WebPageTraceListener.cs
- Assert.cs
- X509SecurityToken.cs
- CodeTypeDelegate.cs
- TextEditorParagraphs.cs
- RuntimeWrappedException.cs
- ConnectionStringsSection.cs
- OleDbErrorCollection.cs
- RepeatButton.cs
- Image.cs
- SQLMembershipProvider.cs
- LinkButton.cs
- SystemInfo.cs
- SkinBuilder.cs
- GridViewRowPresenterBase.cs
- TreeNodeCollection.cs
- SqlProvider.cs
- DataGridViewCellStyleConverter.cs
- CustomCredentialPolicy.cs
- VariantWrapper.cs
- MetricEntry.cs
- ETagAttribute.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- AutomationEvent.cs
- OracleLob.cs
- XmlStringTable.cs
- OracleConnection.cs
- ServiceHttpHandlerFactory.cs
- ApplicationProxyInternal.cs
- CompiledXpathExpr.cs
- CustomWebEventKey.cs
- ToolboxControl.cs