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
- MemberCollection.cs
- MimeMultiPart.cs
- GeometryModel3D.cs
- SlipBehavior.cs
- DbBuffer.cs
- PopupEventArgs.cs
- DateTime.cs
- ObjectDisposedException.cs
- ElementFactory.cs
- _CommandStream.cs
- OwnerDrawPropertyBag.cs
- ContainerUtilities.cs
- LinearQuaternionKeyFrame.cs
- RequestCachePolicy.cs
- DataGridPagerStyle.cs
- TextControlDesigner.cs
- DataServiceHost.cs
- MergeEnumerator.cs
- BinaryMessageEncodingBindingElement.cs
- EdmPropertyAttribute.cs
- HttpApplicationFactory.cs
- AtomServiceDocumentSerializer.cs
- TraceContext.cs
- HttpDictionary.cs
- WebHeaderCollection.cs
- PipelineModuleStepContainer.cs
- TreeViewDesigner.cs
- SystemIPv4InterfaceProperties.cs
- ModifierKeysConverter.cs
- WebServiceReceiveDesigner.cs
- ToolboxControl.cs
- RuntimeResourceSet.cs
- ISAPIWorkerRequest.cs
- DynamicDocumentPaginator.cs
- OleDbPermission.cs
- BitmapMetadataBlob.cs
- WindowsClaimSet.cs
- OrderingExpression.cs
- SiteMapNodeCollection.cs
- DrawingState.cs
- ScrollChrome.cs
- SynchronizingStream.cs
- RemoveStoryboard.cs
- TableLayoutRowStyleCollection.cs
- TableFieldsEditor.cs
- CreateUserWizardStep.cs
- PolyQuadraticBezierSegment.cs
- EntityParameterCollection.cs
- QueryReaderSettings.cs
- ADMembershipProvider.cs
- PaginationProgressEventArgs.cs
- DialogDivider.cs
- WebHostScriptMappingsInstallComponent.cs
- HelloOperationCD1AsyncResult.cs
- TextParagraphView.cs
- SmiRecordBuffer.cs
- CultureInfoConverter.cs
- ScopelessEnumAttribute.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- ColumnWidthChangedEvent.cs
- BamlStream.cs
- DataGridViewTextBoxCell.cs
- X509ThumbprintKeyIdentifierClause.cs
- FileIOPermission.cs
- GrammarBuilderRuleRef.cs
- FolderBrowserDialogDesigner.cs
- XmlElement.cs
- TableCell.cs
- CompareInfo.cs
- StorageEntityContainerMapping.cs
- MemoryStream.cs
- AspCompat.cs
- RectangleHotSpot.cs
- TextLineResult.cs
- SpecularMaterial.cs
- TargetFrameworkAttribute.cs
- ServiceElement.cs
- LinqExpressionNormalizer.cs
- BufferAllocator.cs
- BaseTemplateCodeDomTreeGenerator.cs
- BooleanFacetDescriptionElement.cs
- ActiveXSite.cs
- XPathSelectionIterator.cs
- UrlPropertyAttribute.cs
- GPRECT.cs
- BufferBuilder.cs
- TimeIntervalCollection.cs
- MessageFormatterConverter.cs
- PreviewControlDesigner.cs
- Baml2006Reader.cs
- CompatibleIComparer.cs
- XamlSerializerUtil.cs
- SQLInt32Storage.cs
- VersionValidator.cs
- SqlServer2KCompatibilityAnnotation.cs
- SQLInt32.cs
- XmlSiteMapProvider.cs
- RoleServiceManager.cs
- NodeFunctions.cs
- SynthesizerStateChangedEventArgs.cs