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
- FontFamily.cs
- AuthenticationService.cs
- CompletionCallbackWrapper.cs
- ExclusiveCanonicalizationTransform.cs
- MultiSelectRootGridEntry.cs
- AutomationPatternInfo.cs
- KeyTime.cs
- DateTimePicker.cs
- util.cs
- DesigntimeLicenseContextSerializer.cs
- TraceSwitch.cs
- ProxyWebPartConnectionCollection.cs
- EntityContainerEmitter.cs
- CopyEncoder.cs
- HtmlInputReset.cs
- ConnectionsZoneAutoFormat.cs
- AspProxy.cs
- MatrixTransform.cs
- BlobPersonalizationState.cs
- ApplicationInterop.cs
- SerializationSectionGroup.cs
- TraceHandlerErrorFormatter.cs
- CustomTypeDescriptor.cs
- XPathParser.cs
- ElementFactory.cs
- ProcessHostMapPath.cs
- DnsPermission.cs
- DataGridViewButtonColumn.cs
- RowVisual.cs
- DecimalStorage.cs
- MailWriter.cs
- FormViewInsertedEventArgs.cs
- CodeStatementCollection.cs
- XsltCompileContext.cs
- StrongNameKeyPair.cs
- AuthorizationSection.cs
- StorageMappingFragment.cs
- DropShadowBitmapEffect.cs
- ActivityInterfaces.cs
- BitConverter.cs
- RecognizerBase.cs
- StaticExtensionConverter.cs
- SubqueryRules.cs
- SiteMapDataSourceView.cs
- ReaderOutput.cs
- BasicHttpSecurityMode.cs
- AttributeEmitter.cs
- bidPrivateBase.cs
- DmlSqlGenerator.cs
- ToolStripDropTargetManager.cs
- RuleSetBrowserDialog.cs
- ProvidePropertyAttribute.cs
- ModuleElement.cs
- EntityStoreSchemaFilterEntry.cs
- RuntimeHelpers.cs
- GridViewColumnHeaderAutomationPeer.cs
- WindowAutomationPeer.cs
- CollectionChangeEventArgs.cs
- DataPagerCommandEventArgs.cs
- DecoderBestFitFallback.cs
- RadioButtonFlatAdapter.cs
- VariableQuery.cs
- CategoryValueConverter.cs
- _OverlappedAsyncResult.cs
- Model3DGroup.cs
- MenuAutomationPeer.cs
- HeaderCollection.cs
- DataObjectPastingEventArgs.cs
- AsymmetricKeyExchangeFormatter.cs
- TabPage.cs
- EmissiveMaterial.cs
- WebPartTransformerCollection.cs
- XamlParser.cs
- RotateTransform.cs
- Misc.cs
- SchemaElementDecl.cs
- TableProviderWrapper.cs
- ColorEditor.cs
- AuthStoreRoleProvider.cs
- BasicExpandProvider.cs
- BatchServiceHost.cs
- ObjectSpanRewriter.cs
- DynamicQueryableWrapper.cs
- Tracking.cs
- ArgumentDesigner.xaml.cs
- TypographyProperties.cs
- ValidationRuleCollection.cs
- HitTestFilterBehavior.cs
- DropDownHolder.cs
- CatalogPartChrome.cs
- ToolboxBitmapAttribute.cs
- XmlSchemaAny.cs
- SiteMapNodeCollection.cs
- Int32CollectionConverter.cs
- FieldNameLookup.cs
- XmlDictionaryReaderQuotasElement.cs
- EncryptedKey.cs
- EditingScope.cs
- OLEDB_Enum.cs
- CallbackValidator.cs