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
- LinearGradientBrush.cs
- MatrixAnimationBase.cs
- SocketElement.cs
- Merger.cs
- Array.cs
- DescendantBaseQuery.cs
- ToolboxComponentsCreatedEventArgs.cs
- UnsafeMethods.cs
- SecurityToken.cs
- EdmComplexTypeAttribute.cs
- DataRelation.cs
- QueryStringParameter.cs
- EnlistmentTraceIdentifier.cs
- EditorOptionAttribute.cs
- RawStylusSystemGestureInputReport.cs
- Helpers.cs
- ConfigurationPermission.cs
- ZipIOExtraField.cs
- ZipIOExtraField.cs
- RemotingServices.cs
- DataGridRowClipboardEventArgs.cs
- CachingHintValidation.cs
- MenuStrip.cs
- TextServicesManager.cs
- SoapIgnoreAttribute.cs
- XmlMembersMapping.cs
- EncoderParameter.cs
- Configuration.cs
- TdsRecordBufferSetter.cs
- AsyncPostBackTrigger.cs
- StrokeNodeOperations2.cs
- CopyCodeAction.cs
- _IPv4Address.cs
- SharedUtils.cs
- UiaCoreProviderApi.cs
- ArrayWithOffset.cs
- FunctionQuery.cs
- EmptyEnumerable.cs
- TableAutomationPeer.cs
- HMACSHA384.cs
- WebServiceReceive.cs
- CodeCatchClause.cs
- ContentPosition.cs
- CodeLinePragma.cs
- OutOfMemoryException.cs
- JumpItem.cs
- WbemException.cs
- RelationshipDetailsRow.cs
- ExpressionSelection.cs
- ZipQueryOperator.cs
- DataGridViewColumn.cs
- DynamicMethod.cs
- WinInet.cs
- isolationinterop.cs
- SqlClientWrapperSmiStream.cs
- LinqDataSourceContextEventArgs.cs
- WebPartHeaderCloseVerb.cs
- VolatileEnlistmentState.cs
- GifBitmapDecoder.cs
- XmlAttributeProperties.cs
- TemplateBuilder.cs
- DataGridLinkButton.cs
- DisableDpiAwarenessAttribute.cs
- SwitchAttribute.cs
- MULTI_QI.cs
- PersonalizationStateQuery.cs
- IgnoreSection.cs
- DBConcurrencyException.cs
- Renderer.cs
- CodeTypeMember.cs
- IdentityNotMappedException.cs
- ScaleTransform3D.cs
- WindowsAuthenticationEventArgs.cs
- ByteConverter.cs
- SafeRightsManagementQueryHandle.cs
- ParameterToken.cs
- CursorInteropHelper.cs
- hebrewshape.cs
- cache.cs
- ServiceParser.cs
- DynamicILGenerator.cs
- WindowsFormsEditorServiceHelper.cs
- DtrList.cs
- PeerName.cs
- ContainerUtilities.cs
- HttpListener.cs
- DataBoundControl.cs
- PerformanceCounterNameAttribute.cs
- EraserBehavior.cs
- UnitControl.cs
- RTLAwareMessageBox.cs
- PathTooLongException.cs
- DeleteStoreRequest.cs
- EventPrivateKey.cs
- DbDataRecord.cs
- SqlCommandBuilder.cs
- Base64Decoder.cs
- AsmxEndpointPickerExtension.cs
- ReflectEventDescriptor.cs
- __ConsoleStream.cs