Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / Media / textformatting / TextBounds.cs / 1 / TextBounds.cs
//------------------------------------------------------------------------
//
// Microsoft Windows Client Platform
// Copyright (C) Microsoft Corporation
//
// File: TextBounds.cs
//
// Contents: Bounding rectangle of text range and text run
//
// Spec: http://team/sites/Avalon/Specs/Text%20Formatting%20API.doc
//
// Created: 1-7-2005 Worachai Chaoweeraprasit (wchao)
//
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Windows;
namespace System.Windows.Media.TextFormatting
{
///
/// The bounding rectangle of a range of characters
///
public sealed class TextBounds
{
///
/// Constructing TextBounds object
///
internal TextBounds(
Rect bounds,
FlowDirection flowDirection,
IList runBounds
)
{
_bounds = bounds;
_flowDirection = flowDirection;
_runBounds = runBounds;
}
///
/// Bounds rectangle
///
public Rect Rectangle
{
get { return _bounds; }
}
///
/// Get a list of run bounding rectangles
///
/// Array of text run bounds
public IList TextRunBounds
{
get { return _runBounds; }
}
///
/// Text flow direction inside the boundary rectangle
///
public FlowDirection FlowDirection
{
get { return _flowDirection; }
}
private FlowDirection _flowDirection;
private Rect _bounds;
private IList _runBounds;
}
///
/// The bounding rectangle of text run
///
public sealed class TextRunBounds
{
///
/// Constructing TextRunBounds
///
internal TextRunBounds(
Rect bounds,
int cpFirst,
int cpEnd,
TextRun textRun
)
{
_cpFirst = cpFirst;
_cch = cpEnd - cpFirst;
_bounds = bounds;
_textRun = textRun;
}
///
/// First text source character index of text run
///
public int TextSourceCharacterIndex
{
get { return _cpFirst; }
}
///
/// character length of bounded text run
///
public int Length
{
get { return _cch; }
}
///
/// Text run bounding rectangle
///
public Rect Rectangle
{
get { return _bounds; }
}
///
/// text run
///
public TextRun TextRun
{
get { return _textRun; }
}
private int _cpFirst;
private int _cch;
private Rect _bounds;
private TextRun _textRun;
}
}
// 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
//
// File: TextBounds.cs
//
// Contents: Bounding rectangle of text range and text run
//
// Spec: http://team/sites/Avalon/Specs/Text%20Formatting%20API.doc
//
// Created: 1-7-2005 Worachai Chaoweeraprasit (wchao)
//
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Windows;
namespace System.Windows.Media.TextFormatting
{
///
/// The bounding rectangle of a range of characters
///
public sealed class TextBounds
{
///
/// Constructing TextBounds object
///
internal TextBounds(
Rect bounds,
FlowDirection flowDirection,
IList runBounds
)
{
_bounds = bounds;
_flowDirection = flowDirection;
_runBounds = runBounds;
}
///
/// Bounds rectangle
///
public Rect Rectangle
{
get { return _bounds; }
}
///
/// Get a list of run bounding rectangles
///
/// Array of text run bounds
public IList TextRunBounds
{
get { return _runBounds; }
}
///
/// Text flow direction inside the boundary rectangle
///
public FlowDirection FlowDirection
{
get { return _flowDirection; }
}
private FlowDirection _flowDirection;
private Rect _bounds;
private IList _runBounds;
}
///
/// The bounding rectangle of text run
///
public sealed class TextRunBounds
{
///
/// Constructing TextRunBounds
///
internal TextRunBounds(
Rect bounds,
int cpFirst,
int cpEnd,
TextRun textRun
)
{
_cpFirst = cpFirst;
_cch = cpEnd - cpFirst;
_bounds = bounds;
_textRun = textRun;
}
///
/// First text source character index of text run
///
public int TextSourceCharacterIndex
{
get { return _cpFirst; }
}
///
/// character length of bounded text run
///
public int Length
{
get { return _cch; }
}
///
/// Text run bounding rectangle
///
public Rect Rectangle
{
get { return _bounds; }
}
///
/// text run
///
public TextRun TextRun
{
get { return _textRun; }
}
private int _cpFirst;
private int _cch;
private Rect _bounds;
private TextRun _textRun;
}
}
// 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
- ClosableStream.cs
- RectAnimationUsingKeyFrames.cs
- ManipulationPivot.cs
- StatusBar.cs
- DecoderNLS.cs
- SecurityContextSecurityTokenParameters.cs
- HandlerBase.cs
- Journaling.cs
- XmlDataCollection.cs
- SpellerStatusTable.cs
- RequestCacheEntry.cs
- ItemAutomationPeer.cs
- ListViewPagedDataSource.cs
- PersonalizationProvider.cs
- ErrorFormatterPage.cs
- TargetException.cs
- RoleService.cs
- DataGridLinkButton.cs
- EncodingStreamWrapper.cs
- CounterCreationDataCollection.cs
- BooleanStorage.cs
- XmlNullResolver.cs
- TextParagraphView.cs
- SqlDependencyListener.cs
- NotifyIcon.cs
- NativeMethods.cs
- VariantWrapper.cs
- MILUtilities.cs
- ScriptReference.cs
- FixedDSBuilder.cs
- PeekCompletedEventArgs.cs
- ReferenceConverter.cs
- TextBoxBase.cs
- TemplateBamlTreeBuilder.cs
- EarlyBoundInfo.cs
- SafeNativeMethods.cs
- HtmlForm.cs
- KeyProperty.cs
- assemblycache.cs
- FunctionNode.cs
- XmlHierarchicalDataSourceView.cs
- TempFiles.cs
- Separator.cs
- LogicalExpr.cs
- CursorConverter.cs
- AttributeTable.cs
- UpdateTracker.cs
- ZoneButton.cs
- Vertex.cs
- X509WindowsSecurityToken.cs
- MailWriter.cs
- MailAddressCollection.cs
- AvTrace.cs
- RepeatButton.cs
- DynamicMetaObjectBinder.cs
- EmbossBitmapEffect.cs
- BuilderPropertyEntry.cs
- FixedMaxHeap.cs
- AtomPub10CategoriesDocumentFormatter.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- DataGrid.cs
- IteratorFilter.cs
- ReadOnlyState.cs
- CssTextWriter.cs
- StatusBarPanelClickEvent.cs
- InternalConfigEventArgs.cs
- FilterEventArgs.cs
- Matrix.cs
- TcpConnectionPool.cs
- SafeRightsManagementPubHandle.cs
- PropertyEmitterBase.cs
- SubclassTypeValidator.cs
- ProfessionalColors.cs
- SqlFunctionAttribute.cs
- ComponentResourceManager.cs
- InfoCardMetadataExchangeClient.cs
- AssociationProvider.cs
- PresentationAppDomainManager.cs
- PropertyOverridesTypeEditor.cs
- UnknownWrapper.cs
- DocumentOrderQuery.cs
- ArrayElementGridEntry.cs
- DispatchWrapper.cs
- FixUp.cs
- CodeCommentStatement.cs
- ValueTypeFixupInfo.cs
- Avt.cs
- PlatformNotSupportedException.cs
- CharEnumerator.cs
- MachineKeyConverter.cs
- HTTPNotFoundHandler.cs
- UserPreferenceChangedEventArgs.cs
- coordinatorscratchpad.cs
- HtmlProps.cs
- CompiledIdentityConstraint.cs
- WorkflowOperationBehavior.cs
- XmlSchemaInfo.cs
- ReachPageContentCollectionSerializerAsync.cs
- HttpPostProtocolImporter.cs
- UpdateExpressionVisitor.cs