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 / 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
- ListDictionaryInternal.cs
- BamlTreeUpdater.cs
- ColumnWidthChangedEvent.cs
- CompletionBookmark.cs
- ConcurrentBag.cs
- EntityDataSourceReferenceGroup.cs
- GridSplitterAutomationPeer.cs
- HandlerBase.cs
- FtpRequestCacheValidator.cs
- GridViewRowCollection.cs
- ValueConversionAttribute.cs
- XmlUrlEditor.cs
- ModuleElement.cs
- CodeComment.cs
- BrushValueSerializer.cs
- BitmapEffectRenderDataResource.cs
- AdapterUtil.cs
- StagingAreaInputItem.cs
- SimpleModelProvider.cs
- SetterBaseCollection.cs
- DataGridViewCellCancelEventArgs.cs
- RelationshipDetailsRow.cs
- SqlHelper.cs
- XmlHierarchicalDataSourceView.cs
- AccessKeyManager.cs
- SAPICategories.cs
- XmlSequenceWriter.cs
- ChooseAction.cs
- ExclusiveCanonicalizationTransform.cs
- securitycriticaldataformultiplegetandset.cs
- NotCondition.cs
- EntityCommandDefinition.cs
- ConnectionsZoneDesigner.cs
- ObjectConverter.cs
- RelationshipDetailsRow.cs
- SafeCancelMibChangeNotify.cs
- DataGridViewTopLeftHeaderCell.cs
- WebSysDefaultValueAttribute.cs
- RegistrySecurity.cs
- HMAC.cs
- MsmqElementBase.cs
- ResourceSet.cs
- Triplet.cs
- VirtualizingPanel.cs
- DictationGrammar.cs
- MappingModelBuildProvider.cs
- StyleXamlTreeBuilder.cs
- PageSettings.cs
- OutputScopeManager.cs
- FamilyMapCollection.cs
- DataServices.cs
- WebPartAuthorizationEventArgs.cs
- Panel.cs
- DbExpressionVisitor.cs
- DataTablePropertyDescriptor.cs
- SoapRpcMethodAttribute.cs
- DWriteFactory.cs
- DSASignatureFormatter.cs
- SamlDelegatingWriter.cs
- VirtualizingPanel.cs
- SafeNativeMethods.cs
- TextReader.cs
- ClipboardProcessor.cs
- RtfControls.cs
- DummyDataSource.cs
- DataServiceQueryException.cs
- ColorConvertedBitmapExtension.cs
- RelationshipSet.cs
- RuntimeCompatibilityAttribute.cs
- _SslStream.cs
- PinnedBufferMemoryStream.cs
- OdbcEnvironment.cs
- IPEndPoint.cs
- AutomationPatternInfo.cs
- PropVariant.cs
- GridSplitterAutomationPeer.cs
- FixedStringLookup.cs
- BaseParser.cs
- DynamicPhysicalDiscoSearcher.cs
- SystemIcons.cs
- CodeSnippetStatement.cs
- safemediahandle.cs
- Profiler.cs
- SweepDirectionValidation.cs
- ProcessingInstructionAction.cs
- Matrix3DConverter.cs
- TextPointerBase.cs
- StdValidatorsAndConverters.cs
- SubMenuStyleCollection.cs
- BaseCodePageEncoding.cs
- WaitHandleCannotBeOpenedException.cs
- TraceRecords.cs
- UserControlParser.cs
- MsmqTransportElement.cs
- MessageBuilder.cs
- SmiRecordBuffer.cs
- ModelItemDictionaryImpl.cs
- EncryptedReference.cs
- DetailsViewUpdateEventArgs.cs
- RectAnimationUsingKeyFrames.cs