Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / 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: http://avalon/text/DesignDocsAndSpecs/Text%20Formatting%20API.doc // // Created: 1-2-2004 Worachai Chaoweeraprasit (wchao) // //----------------------------------------------------------------------- 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. //------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2004 // // File: TextEmbeddedObject.cs // // Contents: Definition of text embedded object // // Spec: http://avalon/text/DesignDocsAndSpecs/Text%20Formatting%20API.doc // // Created: 1-2-2004 Worachai Chaoweeraprasit (wchao) // //----------------------------------------------------------------------- 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
- PropertyIdentifier.cs
- Dispatcher.cs
- CatalogPart.cs
- FirstMatchCodeGroup.cs
- safelinkcollection.cs
- MediaCommands.cs
- UriExt.cs
- HyperLink.cs
- ConfigurationLocation.cs
- XPathDocumentIterator.cs
- LiteralControl.cs
- GridViewDesigner.cs
- IRCollection.cs
- TypeDescriptor.cs
- Config.cs
- AspNetHostingPermission.cs
- Serializer.cs
- SystemFonts.cs
- fixedPageContentExtractor.cs
- ResourceExpressionBuilder.cs
- Shape.cs
- ReceiveParametersContent.cs
- LineSegment.cs
- CreateDataSourceDialog.cs
- ValueTable.cs
- SmiContextFactory.cs
- FormViewActionList.cs
- ProgressBar.cs
- WebPartConnectVerb.cs
- HandlerFactoryCache.cs
- TextOutput.cs
- TransformPattern.cs
- MapPathBasedVirtualPathProvider.cs
- ChannelBinding.cs
- SmiMetaDataProperty.cs
- ReadOnlyObservableCollection.cs
- webeventbuffer.cs
- WebContext.cs
- Internal.cs
- Rect.cs
- CacheDependency.cs
- WindowExtensionMethods.cs
- RevocationPoint.cs
- Privilege.cs
- ReflectionUtil.cs
- InitializerFacet.cs
- ContentTextAutomationPeer.cs
- DBCommandBuilder.cs
- EntityKeyElement.cs
- ObservableCollectionDefaultValueFactory.cs
- PasswordTextNavigator.cs
- Attributes.cs
- EntityConnection.cs
- Panel.cs
- AxImporter.cs
- AsyncParams.cs
- NullableConverter.cs
- SqlTransaction.cs
- ObservableCollection.cs
- TextEffect.cs
- GenerateScriptTypeAttribute.cs
- DiscoveryDocumentReference.cs
- RegexStringValidator.cs
- WebPartAddingEventArgs.cs
- ProgressPage.cs
- OdbcDataReader.cs
- TreeNodeMouseHoverEvent.cs
- AtomMaterializer.cs
- TreeNodeCollection.cs
- StylusButton.cs
- SqlDeflator.cs
- TableRowCollection.cs
- ChangeInterceptorAttribute.cs
- X509PeerCertificateElement.cs
- ActivityValidator.cs
- WebPageTraceListener.cs
- CustomValidator.cs
- Accessors.cs
- ClickablePoint.cs
- PointCollectionConverter.cs
- QilUnary.cs
- SetterBase.cs
- CategoryNameCollection.cs
- TabletCollection.cs
- TraceContextEventArgs.cs
- Ipv6Element.cs
- KernelTypeValidation.cs
- ConstantSlot.cs
- JoinCqlBlock.cs
- CheckoutException.cs
- EdmToObjectNamespaceMap.cs
- DataFormats.cs
- ClassData.cs
- UdpSocketReceiveManager.cs
- ColumnMapTranslator.cs
- Emitter.cs
- Error.cs
- EntityRecordInfo.cs
- ToolStripManager.cs
- LinqDataSourceContextEventArgs.cs