Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / textformatting / MinMaxParagraphWidth.cs / 1305600 / 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
- ITreeGenerator.cs
- Triplet.cs
- TreeViewAutomationPeer.cs
- CaseInsensitiveOrdinalStringComparer.cs
- Pair.cs
- EventWaitHandle.cs
- Label.cs
- XmlFormatExtensionPointAttribute.cs
- HtmlInputCheckBox.cs
- SystemGatewayIPAddressInformation.cs
- XamlSerializerUtil.cs
- WebUtil.cs
- MaskedTextProvider.cs
- KeyTimeConverter.cs
- ListenerElementsCollection.cs
- InternalUserCancelledException.cs
- FrameworkPropertyMetadata.cs
- RectangleGeometry.cs
- Duration.cs
- WindowsBrush.cs
- ImageClickEventArgs.cs
- SessionEndingEventArgs.cs
- RewritingPass.cs
- XmlAttributeCollection.cs
- UpdateException.cs
- ReferentialConstraintRoleElement.cs
- HtmlGenericControl.cs
- ZoneButton.cs
- DbProviderFactory.cs
- AppDomainCompilerProxy.cs
- LookupBindingPropertiesAttribute.cs
- NameValueFileSectionHandler.cs
- ConnectionManagementElementCollection.cs
- SoapObjectReader.cs
- WindowsRichEditRange.cs
- IntegrationExceptionEventArgs.cs
- LayoutEngine.cs
- Registry.cs
- HandleExceptionArgs.cs
- SafeNativeMethodsOther.cs
- CodeTypeConstructor.cs
- SystemFonts.cs
- PasswordRecovery.cs
- HttpProfileBase.cs
- DecimalConverter.cs
- CFStream.cs
- DynamicDataResources.Designer.cs
- InvalidProgramException.cs
- NGCSerializationManagerAsync.cs
- SQLResource.cs
- ADMembershipProvider.cs
- TimeStampChecker.cs
- PropertyItemInternal.cs
- DrawingAttributeSerializer.cs
- FillErrorEventArgs.cs
- DataBinding.cs
- ScrollBarRenderer.cs
- Encoding.cs
- DataContract.cs
- DesignRelationCollection.cs
- ErrorLog.cs
- MDIClient.cs
- SqlBuffer.cs
- ProviderBase.cs
- DrawingVisual.cs
- MatrixConverter.cs
- FrameworkElementFactoryMarkupObject.cs
- StaticResourceExtension.cs
- NetSectionGroup.cs
- Int64Converter.cs
- QilReference.cs
- MonthChangedEventArgs.cs
- WebExceptionStatus.cs
- Point4D.cs
- SqlCharStream.cs
- WindowManager.cs
- FrameworkContentElement.cs
- ThreadPool.cs
- TableAdapterManagerGenerator.cs
- DiagnosticsElement.cs
- DateTimeConverter.cs
- RSAProtectedConfigurationProvider.cs
- EditingMode.cs
- TextFragmentEngine.cs
- XslException.cs
- CompiledScopeCriteria.cs
- ToolStripRendererSwitcher.cs
- DesignTimeVisibleAttribute.cs
- PipelineModuleStepContainer.cs
- StartFileNameEditor.cs
- LoadWorkflowCommand.cs
- AsymmetricAlgorithm.cs
- PrintDialog.cs
- OperationResponse.cs
- HierarchicalDataTemplate.cs
- SecureStringHasher.cs
- __ConsoleStream.cs
- FactoryGenerator.cs
- ImmComposition.cs
- FormatConvertedBitmap.cs