Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / System / Windows / Media / textformatting / TextEmbeddedObject.cs / 1 / TextEmbeddedObject.cs
//------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2004 // // File: TextEmbeddedObject.cs // // Contents: Definition of text embedded object // // Spec: [....]/text/DesignDocsAndSpecs/Text%20Formatting%20API.doc // // Created: 1-2-2004 [....] ([....]) // //----------------------------------------------------------------------- using System; using System.Collections; using System.Windows; using System.Windows.Media; using MS.Internal.TextFormatting; namespace System.Windows.Media.TextFormatting { ////// Provide definition for a kind of text content in which measuring, hittesting /// and drawing of the entire content is done in whole. Example of that kind of /// content is a button in the middle of the line. /// public abstract class TextEmbeddedObject : TextRun { ////// Line break condition before text object /// public abstract LineBreakCondition BreakBefore { get; } ////// Line break condition after text object /// public abstract LineBreakCondition BreakAfter { get; } ////// Flag indicates whether text object has fixed size regardless of where /// it is placed within a line /// public abstract bool HasFixedSize { get; } ////// Get text object measurement metrics that will fit within the specified /// remaining width of the paragraph /// /// remaining paragraph width ///text object metrics public abstract TextEmbeddedObjectMetrics Format( double remainingParagraphWidth ); ////// Get computed bounding box of text object /// /// run is drawn from right to left /// run is drawn with its side parallel to baseline ///computed bounding box size of text object public abstract Rect ComputeBoundingBox( bool rightToLeft, bool sideways ); ////// Draw text object /// /// drawing context /// origin where the object is drawn /// run is drawn from right to left /// run is drawn with its side parallel to baseline public abstract void Draw( DrawingContext drawingContext, Point origin, bool rightToLeft, bool sideways ); } ////// Text object properties /// public class TextEmbeddedObjectMetrics { private double _width; private double _height; private double _baseline; ////// Construct a text object size /// /// object width /// object height /// object baseline in ratio relative to run height public TextEmbeddedObjectMetrics( double width, double height, double baseline ) { _width = width; _height = height; _baseline = baseline; } ////// Object width /// public double Width { get { return _width; } } ////// Object height /// ///public double Height { get { return _height; } } /// /// Object baseline in ratio relative to run height /// public double Baseline { get { return _baseline; } } } } // 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
- GridViewAutomationPeer.cs
- CompensatableTransactionScopeActivity.cs
- NetworkAddressChange.cs
- VisualTreeHelper.cs
- ParameterCollectionEditor.cs
- DataColumn.cs
- RSAPKCS1KeyExchangeFormatter.cs
- EntityWrapper.cs
- DataContractJsonSerializer.cs
- PlaceHolder.cs
- webeventbuffer.cs
- DataGridViewRowConverter.cs
- OdbcConnectionStringbuilder.cs
- controlskin.cs
- DateTimeOffsetStorage.cs
- PartialList.cs
- nulltextcontainer.cs
- LocatorManager.cs
- ContentHostHelper.cs
- XsltLoader.cs
- Merger.cs
- RelatedPropertyManager.cs
- DependencyPropertyKind.cs
- SR.cs
- ClientRuntimeConfig.cs
- FileDialog_Vista.cs
- NullReferenceException.cs
- DataShape.cs
- DiscardableAttribute.cs
- PolicyAssertionCollection.cs
- PersonalizableTypeEntry.cs
- DependencyObject.cs
- HttpInputStream.cs
- BamlWriter.cs
- FormViewPagerRow.cs
- DATA_BLOB.cs
- XmlEncodedRawTextWriter.cs
- DbConnectionPoolOptions.cs
- ToolStripDropDownClosingEventArgs.cs
- ToolboxDataAttribute.cs
- ConnectionPoint.cs
- ParameterModifier.cs
- ClientUrlResolverWrapper.cs
- MsmqTransportBindingElement.cs
- ExpressionBuilderContext.cs
- KnownTypesHelper.cs
- PageEventArgs.cs
- ApplicationProxyInternal.cs
- Viewport3DAutomationPeer.cs
- CodeConditionStatement.cs
- Drawing.cs
- COSERVERINFO.cs
- XmlStreamNodeWriter.cs
- DataGridViewToolTip.cs
- BuiltInPermissionSets.cs
- SqlProvider.cs
- ServiceObjectContainer.cs
- ResourceSetExpression.cs
- RoutingExtension.cs
- AsymmetricSignatureDeformatter.cs
- InvalidAsynchronousStateException.cs
- EntityTypeEmitter.cs
- XmlAnyAttributeAttribute.cs
- XmlSchemaSubstitutionGroup.cs
- XmlQueryRuntime.cs
- DataGridSortCommandEventArgs.cs
- SQLRoleProvider.cs
- DesignTimeSiteMapProvider.cs
- DescendantOverDescendantQuery.cs
- StoreConnection.cs
- XamlSerializationHelper.cs
- HtmlLiteralTextAdapter.cs
- TextTrailingCharacterEllipsis.cs
- ProfileManager.cs
- BidPrivateBase.cs
- PreloadHost.cs
- DbConnectionPoolIdentity.cs
- FragmentQueryProcessor.cs
- EventLogEntry.cs
- Process.cs
- Pen.cs
- WsrmTraceRecord.cs
- DataGridViewBand.cs
- AttachedAnnotation.cs
- X509ChainPolicy.cs
- BufferedConnection.cs
- BlockingCollection.cs
- SuppressMergeCheckAttribute.cs
- ProfileManager.cs
- InheritablePropertyChangeInfo.cs
- XmlElementList.cs
- EqualityArray.cs
- ApplicationId.cs
- Reference.cs
- XpsFilter.cs
- TextReader.cs
- HashRepartitionStream.cs
- PackUriHelper.cs
- NamedPipeActivation.cs
- WebPartDescriptionCollection.cs