Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- DiscoveryDocument.cs
- XmlDataCollection.cs
- PersonalizationStateInfoCollection.cs
- SqlDependencyListener.cs
- AssemblyAttributes.cs
- GeneralTransformCollection.cs
- ClientSponsor.cs
- WindowsScroll.cs
- RelationshipType.cs
- HandleCollector.cs
- StylusPointPropertyInfoDefaults.cs
- BrowserDefinitionCollection.cs
- StringUtil.cs
- _AuthenticationState.cs
- XmlBaseReader.cs
- ByteRangeDownloader.cs
- GiveFeedbackEvent.cs
- VectorValueSerializer.cs
- ReflectionTypeLoadException.cs
- KoreanLunisolarCalendar.cs
- OdbcConnectionOpen.cs
- ReverseInheritProperty.cs
- XmlSchemaAppInfo.cs
- XNameTypeConverter.cs
- NetworkInterface.cs
- ContentPosition.cs
- ToolStripCollectionEditor.cs
- NavigationHelper.cs
- LinqDataView.cs
- AssociationSet.cs
- InputBinding.cs
- SmtpFailedRecipientException.cs
- SqlInfoMessageEvent.cs
- COM2TypeInfoProcessor.cs
- CodeAttributeArgumentCollection.cs
- ControlPersister.cs
- BrowserCapabilitiesCompiler.cs
- Shared.cs
- Single.cs
- MultilineStringConverter.cs
- LineServices.cs
- ServiceHttpModule.cs
- Point.cs
- PropertyContainer.cs
- TypeUtil.cs
- NonDualMessageSecurityOverHttp.cs
- XmlSerializerSection.cs
- CompilationLock.cs
- Exception.cs
- FileDataSourceCache.cs
- PropertyConverter.cs
- thaishape.cs
- OpenTypeLayout.cs
- PopupEventArgs.cs
- UncommonField.cs
- XXXOnTypeBuilderInstantiation.cs
- TrackBar.cs
- ConfigXmlElement.cs
- ToolStripDesignerAvailabilityAttribute.cs
- CodeRegionDirective.cs
- PropertyConverter.cs
- WorkflowApplicationAbortedException.cs
- Parallel.cs
- MaxValueConverter.cs
- ParameterModifier.cs
- AsymmetricKeyExchangeFormatter.cs
- ProfileSettings.cs
- TextEditorCharacters.cs
- BaseAddressPrefixFilterElementCollection.cs
- HashJoinQueryOperatorEnumerator.cs
- EditBehavior.cs
- SchemaTableOptionalColumn.cs
- AdapterDictionary.cs
- ActiveXContainer.cs
- SiteMapDataSource.cs
- SaveFileDialog.cs
- WindowInteropHelper.cs
- SerializableAttribute.cs
- NextPreviousPagerField.cs
- DecoratedNameAttribute.cs
- ManagementObjectCollection.cs
- CacheRequest.cs
- MessageBox.cs
- PasswordPropertyTextAttribute.cs
- AsynchronousChannel.cs
- PlanCompilerUtil.cs
- WebBrowserBase.cs
- BitStack.cs
- XPathBinder.cs
- CalendarKeyboardHelper.cs
- MatrixAnimationBase.cs
- SpellerError.cs
- XsltCompileContext.cs
- DataComponentMethodGenerator.cs
- ConstructorNeedsTagAttribute.cs
- AQNBuilder.cs
- ProviderConnectionPoint.cs
- CompilerParameters.cs
- Rule.cs
- Nodes.cs