Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / Media / textformatting / MinMaxParagraphWidth.cs / 1 / MinMaxParagraphWidth.cs
//------------------------------------------------------------------------
//
// Microsoft Windows Client Platform
// Copyright (C) Microsoft Corporation, 2004
//
// File: MinMaxParagraphWidth.cs
//
// Contents: MinMaxParagraphWidth represents two values - the smallest and largest possible
// paragraph width that can fully contain specified text content.
//
// Spec: http://team/sites/Avalon/Specs/Text%20Formatting%20API.doc
//
// Created: 1-2-2004 Worachai Chaoweeraprasit (wchao)
//
//-----------------------------------------------------------------------
using System;
using System.Collections;
using System.Windows;
namespace System.Windows.Media.TextFormatting
{
///
/// MinMaxParagraphWidth represents two values - the smallest and largest possible
/// paragraph width that can fully contain specified text content
///
public struct MinMaxParagraphWidth : IEquatable
{
internal MinMaxParagraphWidth(
double minWidth,
double maxWidth
)
{
_minWidth = minWidth;
_maxWidth = maxWidth;
}
///
/// smallest paragraph width possible
///
public double MinWidth
{
get { return _minWidth; }
}
///
/// largest paragraph width possible
///
public double MaxWidth
{
get { return _maxWidth; }
}
///
/// Compute hash code
///
public override int GetHashCode()
{
return _minWidth.GetHashCode() ^ _maxWidth.GetHashCode();
}
///
/// Test equality with the input MinMaxParagraphWidth value
///
/// The MinMaxParagraphWidth value to test
public bool Equals(MinMaxParagraphWidth value)
{
return this == value;
}
///
/// Test equality with the input MinMaxParagraphWidth value
///
/// the object to test
public override bool Equals(object obj)
{
if (!(obj is MinMaxParagraphWidth))
return false;
return this == (MinMaxParagraphWidth)obj;
}
///
/// Compare two MinMaxParagraphWidth for equality
///
/// left operand
/// right operand
/// whether or not two operands are equal
public static bool operator ==(
MinMaxParagraphWidth left,
MinMaxParagraphWidth right
)
{
return left._minWidth == right._minWidth
&& left._maxWidth == right._maxWidth;
}
///
/// Compare two MinMaxParagraphWidth for inequality
///
/// left operand
/// right operand
/// whether or not two operands are equal
public static bool operator !=(
MinMaxParagraphWidth left,
MinMaxParagraphWidth right
)
{
return !(left == right);
}
private double _minWidth;
private double _maxWidth;
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------
//
// Microsoft Windows Client Platform
// Copyright (C) Microsoft Corporation, 2004
//
// File: MinMaxParagraphWidth.cs
//
// Contents: MinMaxParagraphWidth represents two values - the smallest and largest possible
// paragraph width that can fully contain specified text content.
//
// Spec: http://team/sites/Avalon/Specs/Text%20Formatting%20API.doc
//
// Created: 1-2-2004 Worachai Chaoweeraprasit (wchao)
//
//-----------------------------------------------------------------------
using System;
using System.Collections;
using System.Windows;
namespace System.Windows.Media.TextFormatting
{
///
/// MinMaxParagraphWidth represents two values - the smallest and largest possible
/// paragraph width that can fully contain specified text content
///
public struct MinMaxParagraphWidth : IEquatable
{
internal MinMaxParagraphWidth(
double minWidth,
double maxWidth
)
{
_minWidth = minWidth;
_maxWidth = maxWidth;
}
///
/// smallest paragraph width possible
///
public double MinWidth
{
get { return _minWidth; }
}
///
/// largest paragraph width possible
///
public double MaxWidth
{
get { return _maxWidth; }
}
///
/// Compute hash code
///
public override int GetHashCode()
{
return _minWidth.GetHashCode() ^ _maxWidth.GetHashCode();
}
///
/// Test equality with the input MinMaxParagraphWidth value
///
/// The MinMaxParagraphWidth value to test
public bool Equals(MinMaxParagraphWidth value)
{
return this == value;
}
///
/// Test equality with the input MinMaxParagraphWidth value
///
/// the object to test
public override bool Equals(object obj)
{
if (!(obj is MinMaxParagraphWidth))
return false;
return this == (MinMaxParagraphWidth)obj;
}
///
/// Compare two MinMaxParagraphWidth for equality
///
/// left operand
/// right operand
/// whether or not two operands are equal
public static bool operator ==(
MinMaxParagraphWidth left,
MinMaxParagraphWidth right
)
{
return left._minWidth == right._minWidth
&& left._maxWidth == right._maxWidth;
}
///
/// Compare two MinMaxParagraphWidth for inequality
///
/// left operand
/// right operand
/// whether or not two operands are equal
public static bool operator !=(
MinMaxParagraphWidth left,
MinMaxParagraphWidth right
)
{
return !(left == right);
}
private double _minWidth;
private double _maxWidth;
}
}
// 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
- WeakEventTable.cs
- Slider.cs
- CreateUserErrorEventArgs.cs
- InputScopeConverter.cs
- Util.cs
- Html32TextWriter.cs
- RulePatternOps.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- SqlException.cs
- BorderGapMaskConverter.cs
- BaseValidator.cs
- MailSettingsSection.cs
- StringUtil.cs
- DelimitedListTraceListener.cs
- Encoder.cs
- FlatButtonAppearance.cs
- XmlCharCheckingReader.cs
- datacache.cs
- UpDownBase.cs
- InputScopeAttribute.cs
- EncoderBestFitFallback.cs
- Context.cs
- CreateRefExpr.cs
- RadioButtonStandardAdapter.cs
- FormClosedEvent.cs
- AuthenticationManager.cs
- ReadOnlyHierarchicalDataSource.cs
- ControlPaint.cs
- ToolBar.cs
- Int32RectValueSerializer.cs
- TranslateTransform3D.cs
- DataGridTable.cs
- HandlerFactoryWrapper.cs
- XmlNode.cs
- ListBoxAutomationPeer.cs
- ControlParameter.cs
- Point3D.cs
- TextHidden.cs
- LinkDescriptor.cs
- CodeBinaryOperatorExpression.cs
- IndexerNameAttribute.cs
- EventsTab.cs
- NativeMethods.cs
- TypeBuilderInstantiation.cs
- externdll.cs
- ToolboxItemLoader.cs
- FileIOPermission.cs
- EndpointFilterProvider.cs
- EntityKeyElement.cs
- SEHException.cs
- TaskFileService.cs
- ProgressBarAutomationPeer.cs
- CollectionBuilder.cs
- FactoryMaker.cs
- EntityContainerEmitter.cs
- CollectionContainer.cs
- Condition.cs
- ConnectionProviderAttribute.cs
- PageContentCollection.cs
- WindowInteropHelper.cs
- DataRelationPropertyDescriptor.cs
- _NegotiateClient.cs
- ProtectedProviderSettings.cs
- ManagementObjectSearcher.cs
- GeneratedCodeAttribute.cs
- IProvider.cs
- XPathAncestorQuery.cs
- ParseElementCollection.cs
- SliderAutomationPeer.cs
- XamlSerializationHelper.cs
- SoapBinding.cs
- TypeContext.cs
- DataGridViewCellStateChangedEventArgs.cs
- UpdateTranslator.cs
- ToolZone.cs
- MissingSatelliteAssemblyException.cs
- FontStretches.cs
- Menu.cs
- Math.cs
- DataTableReader.cs
- Package.cs
- DocComment.cs
- RoutingTable.cs
- ProcessThreadCollection.cs
- UrlMappingsModule.cs
- TrackingExtract.cs
- KeyFrames.cs
- XmlDocument.cs
- RegistryHandle.cs
- TableStyle.cs
- InheritanceAttribute.cs
- XmlILModule.cs
- DocumentOrderQuery.cs
- PointCollection.cs
- LineServices.cs
- ItemCheckedEvent.cs
- GridProviderWrapper.cs
- OdbcException.cs
- ConnectionStringsExpressionBuilder.cs
- XmlBinaryReader.cs