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 / TextBreakpoint.cs / 1 / TextBreakpoint.cs
//------------------------------------------------------------------------
//
// Microsoft Windows Client Platform
// Copyright (C) Microsoft Corporation
//
// File: TextBreakpoint.cs
//
// Contents: A specialized text line representing state of line up to the
// point where line break may occur
//
// Spec: http://team/sites/Avalon/Specs/Text%20Formatting%20API.doc
//
// Created: 1-1-2005 Worachai Chaoweeraprasit (wchao)
//
//-----------------------------------------------------------------------
using System;
using System.Security;
using MS.Internal;
using MS.Internal.PresentationCore;
using MS.Internal.TextFormatting;
namespace System.Windows.Media.TextFormatting
{
///
/// A specialized text line representing state of line up to the point
/// where line break may occur. Unlike the normal text line, breakpoint
/// could not draw or performs hit-testing operation. It could only reflect
/// formatting result back to the client.
///
#if OPTIMALBREAK_API
public abstract class TextBreakpoint : ITextMetrics, IDisposable
#else
[FriendAccessAllowed] // used by Framework
internal abstract class TextBreakpoint : ITextMetrics, IDisposable
#endif
{
///
/// Clean up text breakpoint internal resource
///
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
///
/// Actual clean up code to be overridden by subclasses, by default it does nothing.
///
/// flag indicates whether the clean up is thru disposal
protected virtual void Dispose(bool disposing)
{}
///
/// Client to acquire a state at the point where breakpoint is determined by line breaking process;
/// can be null when the line ends by the ending of the paragraph. Client may pass this
/// value back to TextFormatter as an input argument to TextFormatter.FormatParagraphBreakpoints when
/// formatting the next set of breakpoints within the same paragraph.
///
public abstract TextLineBreak GetTextLineBreak();
///
/// Client to get the handle of the internal factors that are used to determine penalty of this breakpoint.
///
///
/// Calling this method means that the client will now manage the lifetime of this unmanaged resource themselves using unsafe penalty handler.
/// We would make a correspondent call to notify our unmanaged wrapper to release them from duty of managing this
/// resource.
///
///
/// Critical - as this method returns unmanaged resource to the client.
///
[SecurityCritical]
internal abstract SecurityCriticalDataForSet GetTextPenaltyResource();
///
/// Client to get a Boolean flag indicating whether the line is truncated in the
/// middle of a word. This flag is set only when TextParagraphProperties.TextWrapping
/// is set to TextWrapping.Wrap and a single word is longer than the formatting
/// paragraph width. In such situation, TextFormatter truncates the line in the middle
/// of the word to honor the desired behavior specified by TextWrapping.Wrap setting.
///
public abstract bool IsTruncated
{ get; }
#region ITextMetrics
///
/// Client to get the number of text source positions of this line
///
public abstract int Length
{ get; }
///
/// Client to get the number of characters following the last character
/// of the line that may trigger reformatting of the current line.
///
public abstract int DependentLength
{ get; }
///
/// Client to get the number of newline characters at line end
///
public abstract int NewlineLength
{ get; }
///
/// Client to get distance from paragraph start to line start
///
public abstract double Start
{ get; }
///
/// Client to get the total width of this line
///
public abstract double Width
{ get; }
///
/// Client to get the total width of this line including width of whitespace characters at the end of the line.
///
public abstract double WidthIncludingTrailingWhitespace
{ get; }
///
/// Client to get the height of the line
///
public abstract double Height
{ get; }
///
/// Client to get the height of the text (or other content) in the line; this property may differ from the Height
/// property if the client specified the line height
///
public abstract double TextHeight
{ get; }
///
/// Client to get the distance from top to baseline of this text line
///
public abstract double Baseline
{ get; }
///
/// Client to get the distance from the top of the text (or other content) to the baseline of this text line;
/// this property may differ from the Baseline property if the client specified the line height
///
public abstract double TextBaseline
{ get; }
///
/// Client to get the distance from the before edge of line height
/// to the baseline of marker of the line if any.
///
public abstract double MarkerBaseline
{ get; }
///
/// Client to get the overall height of the list items marker of the line if any.
///
public abstract double MarkerHeight
{ get; }
#endregion
}
}
// 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: TextBreakpoint.cs
//
// Contents: A specialized text line representing state of line up to the
// point where line break may occur
//
// Spec: http://team/sites/Avalon/Specs/Text%20Formatting%20API.doc
//
// Created: 1-1-2005 Worachai Chaoweeraprasit (wchao)
//
//-----------------------------------------------------------------------
using System;
using System.Security;
using MS.Internal;
using MS.Internal.PresentationCore;
using MS.Internal.TextFormatting;
namespace System.Windows.Media.TextFormatting
{
///
/// A specialized text line representing state of line up to the point
/// where line break may occur. Unlike the normal text line, breakpoint
/// could not draw or performs hit-testing operation. It could only reflect
/// formatting result back to the client.
///
#if OPTIMALBREAK_API
public abstract class TextBreakpoint : ITextMetrics, IDisposable
#else
[FriendAccessAllowed] // used by Framework
internal abstract class TextBreakpoint : ITextMetrics, IDisposable
#endif
{
///
/// Clean up text breakpoint internal resource
///
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
///
/// Actual clean up code to be overridden by subclasses, by default it does nothing.
///
/// flag indicates whether the clean up is thru disposal
protected virtual void Dispose(bool disposing)
{}
///
/// Client to acquire a state at the point where breakpoint is determined by line breaking process;
/// can be null when the line ends by the ending of the paragraph. Client may pass this
/// value back to TextFormatter as an input argument to TextFormatter.FormatParagraphBreakpoints when
/// formatting the next set of breakpoints within the same paragraph.
///
public abstract TextLineBreak GetTextLineBreak();
///
/// Client to get the handle of the internal factors that are used to determine penalty of this breakpoint.
///
///
/// Calling this method means that the client will now manage the lifetime of this unmanaged resource themselves using unsafe penalty handler.
/// We would make a correspondent call to notify our unmanaged wrapper to release them from duty of managing this
/// resource.
///
///
/// Critical - as this method returns unmanaged resource to the client.
///
[SecurityCritical]
internal abstract SecurityCriticalDataForSet GetTextPenaltyResource();
///
/// Client to get a Boolean flag indicating whether the line is truncated in the
/// middle of a word. This flag is set only when TextParagraphProperties.TextWrapping
/// is set to TextWrapping.Wrap and a single word is longer than the formatting
/// paragraph width. In such situation, TextFormatter truncates the line in the middle
/// of the word to honor the desired behavior specified by TextWrapping.Wrap setting.
///
public abstract bool IsTruncated
{ get; }
#region ITextMetrics
///
/// Client to get the number of text source positions of this line
///
public abstract int Length
{ get; }
///
/// Client to get the number of characters following the last character
/// of the line that may trigger reformatting of the current line.
///
public abstract int DependentLength
{ get; }
///
/// Client to get the number of newline characters at line end
///
public abstract int NewlineLength
{ get; }
///
/// Client to get distance from paragraph start to line start
///
public abstract double Start
{ get; }
///
/// Client to get the total width of this line
///
public abstract double Width
{ get; }
///
/// Client to get the total width of this line including width of whitespace characters at the end of the line.
///
public abstract double WidthIncludingTrailingWhitespace
{ get; }
///
/// Client to get the height of the line
///
public abstract double Height
{ get; }
///
/// Client to get the height of the text (or other content) in the line; this property may differ from the Height
/// property if the client specified the line height
///
public abstract double TextHeight
{ get; }
///
/// Client to get the distance from top to baseline of this text line
///
public abstract double Baseline
{ get; }
///
/// Client to get the distance from the top of the text (or other content) to the baseline of this text line;
/// this property may differ from the Baseline property if the client specified the line height
///
public abstract double TextBaseline
{ get; }
///
/// Client to get the distance from the before edge of line height
/// to the baseline of marker of the line if any.
///
public abstract double MarkerBaseline
{ get; }
///
/// Client to get the overall height of the list items marker of the line if any.
///
public abstract double MarkerHeight
{ get; }
#endregion
}
}
// 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
- OuterGlowBitmapEffect.cs
- ActionFrame.cs
- GenericTypeParameterBuilder.cs
- FontWeight.cs
- GridEntry.cs
- State.cs
- XsdBuildProvider.cs
- ThrowHelper.cs
- SpAudioStreamWrapper.cs
- TcpAppDomainProtocolHandler.cs
- MethodCallConverter.cs
- BaseCollection.cs
- CommandExpr.cs
- CharAnimationBase.cs
- ListBase.cs
- Decorator.cs
- GridViewDeleteEventArgs.cs
- XpsFixedDocumentReaderWriter.cs
- Vector3DIndependentAnimationStorage.cs
- MethodBuilder.cs
- BitmapImage.cs
- StringDictionaryEditor.cs
- TreeBuilderBamlTranslator.cs
- xmlfixedPageInfo.cs
- PeerNearMe.cs
- DesignerTransactionCloseEvent.cs
- Tool.cs
- X509Certificate.cs
- DiagnosticSection.cs
- UIElementIsland.cs
- PassportIdentity.cs
- SystemDropShadowChrome.cs
- InvalidOleVariantTypeException.cs
- input.cs
- LinqDataSourceEditData.cs
- CombinedGeometry.cs
- ReferencedAssembly.cs
- FloaterParagraph.cs
- TreeViewEvent.cs
- Rule.cs
- ConfigXmlComment.cs
- Point.cs
- CatalogPartCollection.cs
- OrderedDictionaryStateHelper.cs
- TemplateBamlTreeBuilder.cs
- TimeoutStream.cs
- InputReport.cs
- SecurityDescriptor.cs
- KeysConverter.cs
- DocumentViewer.cs
- SqlResolver.cs
- Decoder.cs
- MonikerHelper.cs
- IResourceProvider.cs
- XmlAttributeCollection.cs
- DeclarativeExpressionConditionDeclaration.cs
- SynchronizedDispatch.cs
- StringInfo.cs
- DataRecordInternal.cs
- WorkerProcess.cs
- TemplateBindingExpression.cs
- StrokeDescriptor.cs
- ArrayList.cs
- ServiceInfo.cs
- EncodingFallbackAwareXmlTextWriter.cs
- FtpRequestCacheValidator.cs
- OracleInternalConnection.cs
- SqlDataSourceCustomCommandPanel.cs
- FormatSettings.cs
- KeySpline.cs
- GlyphTypeface.cs
- ProtectedConfigurationSection.cs
- ButtonBaseAutomationPeer.cs
- ToolStripItemCollection.cs
- BackgroundWorker.cs
- XmlResolver.cs
- ToolStripDropDownClosedEventArgs.cs
- XmlHierarchicalDataSourceView.cs
- BrushConverter.cs
- SapiInterop.cs
- WorkflowRuntimeService.cs
- CompilerWrapper.cs
- PrincipalPermission.cs
- MarkupExtensionReturnTypeAttribute.cs
- Journal.cs
- BasicBrowserDialog.designer.cs
- UIElement3D.cs
- DefaultTextStoreTextComposition.cs
- X509PeerCertificateElement.cs
- MatrixIndependentAnimationStorage.cs
- HttpListenerException.cs
- HyperLinkColumn.cs
- TerminateWorkflow.cs
- ColumnMapTranslator.cs
- PenLineJoinValidation.cs
- NumberSubstitution.cs
- CodeDomLocalizationProvider.cs
- DescendantQuery.cs
- CodeEventReferenceExpression.cs
- OrderedDictionary.cs