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
- CmsInterop.cs
- ClientSideProviderDescription.cs
- RubberbandSelector.cs
- MsmqAppDomainProtocolHandler.cs
- ZipIOFileItemStream.cs
- WorkflowRuntimeBehavior.cs
- AdvancedBindingEditor.cs
- ListView.cs
- MetadataSource.cs
- SqlDataSourceView.cs
- ConnectionsZone.cs
- ChannelSinkStacks.cs
- UnknownBitmapEncoder.cs
- MarkupExtensionParser.cs
- DetailsViewRowCollection.cs
- EmbeddedObject.cs
- LocalIdKeyIdentifierClause.cs
- GridViewEditEventArgs.cs
- ConnectionManagementSection.cs
- ConnectionPointConverter.cs
- ChildTable.cs
- MinMaxParagraphWidth.cs
- ResourceSet.cs
- QilGenerator.cs
- TextLineResult.cs
- ToolTip.cs
- RevocationPoint.cs
- UnaryNode.cs
- HttpWebRequestElement.cs
- DataRecordObjectView.cs
- CodeSubDirectory.cs
- DockPattern.cs
- Mutex.cs
- TreeView.cs
- Msec.cs
- TraceUtility.cs
- PageScaling.cs
- ElementHostAutomationPeer.cs
- SrgsNameValueTag.cs
- CustomValidator.cs
- TextControl.cs
- BaseAppDomainProtocolHandler.cs
- ChineseLunisolarCalendar.cs
- ListView.cs
- Size3DValueSerializer.cs
- ContainerControl.cs
- PasswordRecoveryAutoFormat.cs
- BufferModeSettings.cs
- AuthorizationContext.cs
- WebConfigManager.cs
- AnimatedTypeHelpers.cs
- AnimationClockResource.cs
- ServiceActivationException.cs
- QueryOpeningEnumerator.cs
- DeferredReference.cs
- SmiGettersStream.cs
- XmlReturnReader.cs
- GlobalizationAssembly.cs
- Soap12ProtocolReflector.cs
- QilIterator.cs
- wmiprovider.cs
- StyleTypedPropertyAttribute.cs
- WinCategoryAttribute.cs
- Utils.cs
- GACMembershipCondition.cs
- ProfileInfo.cs
- StylusCaptureWithinProperty.cs
- CommonRemoteMemoryBlock.cs
- NamespaceListProperty.cs
- AuthenticateEventArgs.cs
- JapaneseCalendar.cs
- LabelDesigner.cs
- CDSsyncETWBCLProvider.cs
- UserPreferenceChangedEventArgs.cs
- TextServicesPropertyRanges.cs
- SettingsProviderCollection.cs
- LineBreakRecord.cs
- RuntimeCompatibilityAttribute.cs
- SqlConnectionString.cs
- RegexWorker.cs
- WindowsFormsSectionHandler.cs
- XPathChildIterator.cs
- GroupItemAutomationPeer.cs
- SyndicationFeedFormatter.cs
- EventMappingSettingsCollection.cs
- PerfCounters.cs
- CubicEase.cs
- SystemIPInterfaceProperties.cs
- RelationshipFixer.cs
- SectionRecord.cs
- Transform3DGroup.cs
- GroupQuery.cs
- HttpHeaderCollection.cs
- ToolboxItemCollection.cs
- NewArrayExpression.cs
- PointLightBase.cs
- HtmlElementErrorEventArgs.cs
- CheckBoxBaseAdapter.cs
- CapacityStreamGeometryContext.cs
- SkinBuilder.cs