Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / FixedLineResult.cs / 1305600 / FixedLineResult.cs
//---------------------------------------------------------------------------- //// Copyright (C) 2004 by Microsoft Corporation. All rights reserved. // // // Description: // FixedLineResult represents a per-line layout info for a fixe page // // History: // 11/23/2004 - Zhenbin Xu (ZhenbinX) - Created. // //--------------------------------------------------------------------------- namespace System.Windows.Documents { using MS.Internal.Documents; using System; using System.Collections; using System.Diagnostics; using System.Globalization; //===================================================================== ////// FixedLineResult represents a per-line layout info for a fixe page /// internal sealed class FixedLineResult : IComparable { //------------------------------------------------------------------- // // Connstructors // //---------------------------------------------------------------------- #region Constructors internal FixedLineResult(FixedNode[] nodes, Rect layoutBox) { _nodes = nodes; _layoutBox = layoutBox; } #endregion Constructors //------------------------------------------------------------------- // // Public Methods // //---------------------------------------------------------------------- // IComparable Override public int CompareTo(object o) { if (o == null) { throw new ArgumentNullException("o"); } if (o.GetType() != typeof(FixedLineResult)) { throw new ArgumentException(SR.Get(SRID.UnexpectedParameterType, o.GetType(), typeof(FixedLineResult)), "o"); } FixedLineResult lineResult = (FixedLineResult)o; return this.BaseLine.CompareTo(lineResult.BaseLine); } #if DEBUG ////// Create a string representation of this object /// ///string - A string representation of this object public override string ToString() { return String.Format(CultureInfo.InvariantCulture, "FLR[{0}:{1}][{2}][{3}]", Start.ToString(), End.ToString(), BaseLine, _layoutBox); } #endif //-------------------------------------------------------------------- // // Public Properties // //--------------------------------------------------------------------- //-------------------------------------------------------------------- // // Public Events // //--------------------------------------------------------------------- //------------------------------------------------------------------- // // Internal Methods // //--------------------------------------------------------------------- //-------------------------------------------------------------------- // // Internal Properties // //--------------------------------------------------------------------- #region Internal Properties // internal FixedNode Start { get { return _nodes[0]; } } internal FixedNode End { get { return _nodes[_nodes.Length - 1]; } } internal FixedNode[] Nodes { get { return _nodes; } } internal double BaseLine { get { return _layoutBox.Bottom; } } internal Rect LayoutBox { get { return _layoutBox; } } #endregion Internal Properties //-------------------------------------------------------------------- // // Private Methods // //---------------------------------------------------------------------- #region Private Properties #endregion Private Properties //------------------------------------------------------------------- // // Private Fields // //---------------------------------------------------------------------- #region Private Fields private readonly FixedNode[] _nodes; private readonly Rect _layoutBox; // relative to page #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- //// Copyright (C) 2004 by Microsoft Corporation. All rights reserved. // // // Description: // FixedLineResult represents a per-line layout info for a fixe page // // History: // 11/23/2004 - Zhenbin Xu (ZhenbinX) - Created. // //--------------------------------------------------------------------------- namespace System.Windows.Documents { using MS.Internal.Documents; using System; using System.Collections; using System.Diagnostics; using System.Globalization; //===================================================================== ////// FixedLineResult represents a per-line layout info for a fixe page /// internal sealed class FixedLineResult : IComparable { //------------------------------------------------------------------- // // Connstructors // //---------------------------------------------------------------------- #region Constructors internal FixedLineResult(FixedNode[] nodes, Rect layoutBox) { _nodes = nodes; _layoutBox = layoutBox; } #endregion Constructors //------------------------------------------------------------------- // // Public Methods // //---------------------------------------------------------------------- // IComparable Override public int CompareTo(object o) { if (o == null) { throw new ArgumentNullException("o"); } if (o.GetType() != typeof(FixedLineResult)) { throw new ArgumentException(SR.Get(SRID.UnexpectedParameterType, o.GetType(), typeof(FixedLineResult)), "o"); } FixedLineResult lineResult = (FixedLineResult)o; return this.BaseLine.CompareTo(lineResult.BaseLine); } #if DEBUG ////// Create a string representation of this object /// ///string - A string representation of this object public override string ToString() { return String.Format(CultureInfo.InvariantCulture, "FLR[{0}:{1}][{2}][{3}]", Start.ToString(), End.ToString(), BaseLine, _layoutBox); } #endif //-------------------------------------------------------------------- // // Public Properties // //--------------------------------------------------------------------- //-------------------------------------------------------------------- // // Public Events // //--------------------------------------------------------------------- //------------------------------------------------------------------- // // Internal Methods // //--------------------------------------------------------------------- //-------------------------------------------------------------------- // // Internal Properties // //--------------------------------------------------------------------- #region Internal Properties // internal FixedNode Start { get { return _nodes[0]; } } internal FixedNode End { get { return _nodes[_nodes.Length - 1]; } } internal FixedNode[] Nodes { get { return _nodes; } } internal double BaseLine { get { return _layoutBox.Bottom; } } internal Rect LayoutBox { get { return _layoutBox; } } #endregion Internal Properties //-------------------------------------------------------------------- // // Private Methods // //---------------------------------------------------------------------- #region Private Properties #endregion Private Properties //------------------------------------------------------------------- // // Private Fields // //---------------------------------------------------------------------- #region Private Fields private readonly FixedNode[] _nodes; private readonly Rect _layoutBox; // relative to page #endregion Private Fields } } // 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
- EdmError.cs
- HttpResponseHeader.cs
- XamlToRtfParser.cs
- FormatConvertedBitmap.cs
- DefaultBinder.cs
- ControlPropertyNameConverter.cs
- OleStrCAMarshaler.cs
- ShapeTypeface.cs
- UnknownWrapper.cs
- ToolboxComponentsCreatingEventArgs.cs
- SqlVersion.cs
- DataGridViewCellConverter.cs
- TreeNodeStyleCollection.cs
- EncodingFallbackAwareXmlTextWriter.cs
- TcpSocketManager.cs
- ActivityXamlServices.cs
- ErrorProvider.cs
- Point3DCollection.cs
- XmlLoader.cs
- DocumentationServerProtocol.cs
- DragEventArgs.cs
- GuidelineSet.cs
- SelectorItemAutomationPeer.cs
- ComplexLine.cs
- SqlClientWrapperSmiStreamChars.cs
- KeyValuePairs.cs
- LoginView.cs
- RtfToXamlLexer.cs
- StringOutput.cs
- GPPOINT.cs
- PriorityBindingExpression.cs
- TransformerInfoCollection.cs
- ManipulationInertiaStartingEventArgs.cs
- ActivityDesignerLayoutSerializers.cs
- NativeWindow.cs
- PassportAuthenticationModule.cs
- CodeCatchClauseCollection.cs
- RuleConditionDialog.cs
- BindingCompleteEventArgs.cs
- DropDownButton.cs
- TraceListeners.cs
- WindowsNonControl.cs
- ChannelManager.cs
- PeerService.cs
- Tile.cs
- InstanceValue.cs
- TemplateInstanceAttribute.cs
- SimpleTypeResolver.cs
- WebPartConnectionsConnectVerb.cs
- NamedPermissionSet.cs
- Rules.cs
- PartialCachingAttribute.cs
- DataTrigger.cs
- BlurBitmapEffect.cs
- PartManifestEntry.cs
- Control.cs
- Speller.cs
- UIAgentAsyncParams.cs
- RightNameExpirationInfoPair.cs
- AuthorizationRule.cs
- AudioFileOut.cs
- SerializationSectionGroup.cs
- ControlBuilder.cs
- ADMembershipUser.cs
- PreloadedPackages.cs
- BindingCollection.cs
- SmiEventSink.cs
- ToolStripDesignerUtils.cs
- ListBoxAutomationPeer.cs
- TypeUsageBuilder.cs
- precedingquery.cs
- ScrollViewerAutomationPeer.cs
- ImageInfo.cs
- XmlDataSource.cs
- OpenTypeCommon.cs
- COM2ICategorizePropertiesHandler.cs
- SearchForVirtualItemEventArgs.cs
- StringAnimationUsingKeyFrames.cs
- UniqueConstraint.cs
- MediaElement.cs
- ZoneMembershipCondition.cs
- TemplateKey.cs
- cache.cs
- Misc.cs
- UnmanagedMemoryStream.cs
- ByteArrayHelperWithString.cs
- CursorEditor.cs
- OutputCacheSection.cs
- ImmutableObjectAttribute.cs
- TypeLibConverter.cs
- SocketCache.cs
- DispatchChannelSink.cs
- RowUpdatedEventArgs.cs
- CategoryNameCollection.cs
- KernelTypeValidation.cs
- ConstrainedDataObject.cs
- ClockGroup.cs
- TreeWalker.cs
- PerformanceCounterCategory.cs
- LinqDataSourceDeleteEventArgs.cs