Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / textformatting / TextEmbeddedObject.cs / 1305600 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GeometryModel3D.cs
- OutKeywords.cs
- SmtpFailedRecipientsException.cs
- ServiceProviders.cs
- CultureInfo.cs
- RectAnimationBase.cs
- HttpProcessUtility.cs
- TreeNodeConverter.cs
- RelatedView.cs
- DecimalAverageAggregationOperator.cs
- ComplexPropertyEntry.cs
- DataGridViewRowsAddedEventArgs.cs
- WorkflowInstanceTerminatedRecord.cs
- ApplicationException.cs
- WorkflowOwnershipException.cs
- BoundPropertyEntry.cs
- ListViewItemCollectionEditor.cs
- DetailsViewModeEventArgs.cs
- LiteralTextContainerControlBuilder.cs
- WebPartDisplayMode.cs
- BlobPersonalizationState.cs
- KnownTypes.cs
- KeyValueSerializer.cs
- DetailsViewInsertEventArgs.cs
- Grant.cs
- FontStyle.cs
- DataBoundControlAdapter.cs
- BooleanAnimationBase.cs
- RoutedUICommand.cs
- MailBnfHelper.cs
- ContainerActivationHelper.cs
- CacheMemory.cs
- TableLayoutPanel.cs
- DockAndAnchorLayout.cs
- XDRSchema.cs
- DynamicValueConverter.cs
- AttachedPropertyBrowsableAttribute.cs
- WindowsComboBox.cs
- BooleanConverter.cs
- TextServicesDisplayAttribute.cs
- Util.cs
- CurrentTimeZone.cs
- Serializer.cs
- ColumnResizeUndoUnit.cs
- PrintingPermission.cs
- LogReserveAndAppendState.cs
- RtType.cs
- PowerEase.cs
- LoginView.cs
- AdornerLayer.cs
- PointAnimationClockResource.cs
- CodeAccessSecurityEngine.cs
- NgenServicingAttributes.cs
- TemplatedAdorner.cs
- AuthenticationModuleElement.cs
- PriorityQueue.cs
- BlockUIContainer.cs
- Console.cs
- TcpClientChannel.cs
- WmfPlaceableFileHeader.cs
- GeneralTransform3DCollection.cs
- RelationshipEnd.cs
- SqlDataSourceView.cs
- SiteMapNodeItemEventArgs.cs
- CheckedPointers.cs
- TextEditorSpelling.cs
- GridViewColumnHeader.cs
- TypographyProperties.cs
- TextUtf8RawTextWriter.cs
- WriterOutput.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- XamlLoadErrorInfo.cs
- XmlQualifiedName.cs
- ELinqQueryState.cs
- LicenseContext.cs
- NameValueCollection.cs
- HostingEnvironmentException.cs
- DocumentGridPage.cs
- Models.cs
- _NegoState.cs
- XomlCompiler.cs
- FixUpCollection.cs
- RC2CryptoServiceProvider.cs
- XmlNodeChangedEventArgs.cs
- BookmarkCallbackWrapper.cs
- PackWebResponse.cs
- SchemaTableOptionalColumn.cs
- MatchAttribute.cs
- Debugger.cs
- dataprotectionpermissionattribute.cs
- MemberInfoSerializationHolder.cs
- XomlSerializationHelpers.cs
- ForwardPositionQuery.cs
- ViewGenerator.cs
- HtmlInputRadioButton.cs
- ExternalCalls.cs
- PeerEndPoint.cs
- HitTestDrawingContextWalker.cs
- WebHttpBindingCollectionElement.cs
- EntitySet.cs