Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- ConversionContext.cs
- RayMeshGeometry3DHitTestResult.cs
- SecurityState.cs
- DataGridViewCellStyleBuilderDialog.cs
- GPRECT.cs
- RSACryptoServiceProvider.cs
- ValueProviderWrapper.cs
- MaskDescriptor.cs
- SqlDataRecord.cs
- Converter.cs
- GridView.cs
- LinearGradientBrush.cs
- XmlNode.cs
- ProtectedUri.cs
- DetailsViewUpdateEventArgs.cs
- ImageMetadata.cs
- RSAPKCS1KeyExchangeFormatter.cs
- MatrixUtil.cs
- DrawingServices.cs
- OutputCacheProviderCollection.cs
- LineServicesRun.cs
- TextRangeProviderWrapper.cs
- ScalarConstant.cs
- GeometryValueSerializer.cs
- VirtualStackFrame.cs
- CornerRadius.cs
- TreeNodeStyleCollection.cs
- Menu.cs
- ProjectionNode.cs
- Help.cs
- FontInfo.cs
- MaskedTextBox.cs
- ObjectTag.cs
- FragmentQueryProcessor.cs
- OleDbCommandBuilder.cs
- InkCanvasAutomationPeer.cs
- WebPartCloseVerb.cs
- RoleGroup.cs
- XmlWrappingWriter.cs
- ChangeNode.cs
- MembershipPasswordException.cs
- SetStoryboardSpeedRatio.cs
- ApplicationSettingsBase.cs
- FixedPageProcessor.cs
- LassoSelectionBehavior.cs
- WebBrowserContainer.cs
- SectionInformation.cs
- CodeTypeReferenceCollection.cs
- ConfigurationValue.cs
- TypeDescriptionProvider.cs
- ExtendedPropertyCollection.cs
- EntityContainer.cs
- BehaviorEditorPart.cs
- UpdateCommandGenerator.cs
- MemoryPressure.cs
- HtmlTableCell.cs
- sqlcontext.cs
- MeshGeometry3D.cs
- DiscoveryEndpoint.cs
- EntitySetRetriever.cs
- LinqDataSourceInsertEventArgs.cs
- ModifierKeysValueSerializer.cs
- QilVisitor.cs
- MetadataCache.cs
- TypeSystem.cs
- AuthorizationRuleCollection.cs
- ResourceReferenceExpressionConverter.cs
- XmlEntity.cs
- ImportDesigner.xaml.cs
- InertiaTranslationBehavior.cs
- MatrixUtil.cs
- XmlEncodedRawTextWriter.cs
- DateTimeAutomationPeer.cs
- QueueProcessor.cs
- Mutex.cs
- EmptyEnumerable.cs
- ValidationHelpers.cs
- CompilationLock.cs
- CultureNotFoundException.cs
- MinMaxParagraphWidth.cs
- CompilationUtil.cs
- StylusButtonEventArgs.cs
- ImageSource.cs
- HttpCookieCollection.cs
- SqlProfileProvider.cs
- DataGridViewButtonCell.cs
- XmlNullResolver.cs
- DesignerView.Commands.cs
- ControlAdapter.cs
- ServiceProviders.cs
- NullableDecimalAverageAggregationOperator.cs
- ThicknessAnimationUsingKeyFrames.cs
- GroupLabel.cs
- TabPage.cs
- ClientSideProviderDescription.cs
- UseAttributeSetsAction.cs
- DelegateSerializationHolder.cs
- ErrorTableItemStyle.cs
- ToolStripPanelCell.cs
- AutomationIdentifierGuids.cs