Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / FixedSOMFixedBlock.cs / 1305600 / FixedSOMFixedBlock.cs
/*++ File: FixedSOMFixedBlock.cs Copyright (C) 2005 Microsoft Corporation. All rights reserved. Description: This class reprsents a table row on the page. It would contain several table cells History: 05/17/2005: eleese - Created --*/ namespace System.Windows.Documents { using System.Collections; using System.Collections.Generic; using System.Windows.Media; using System.Globalization; using System.Diagnostics; using System.Text; internal sealed class FixedSOMFixedBlock : FixedSOMPageElement { //-------------------------------------------------------------------- // // Constructors // //--------------------------------------------------------------------- #region Constructors public FixedSOMFixedBlock(FixedSOMPage page) : base(page) { } #endregion Constructors #region Public Properties public double LineHeight { get { FixedSOMTextRun lastRun = this.LastTextRun; if (lastRun != null) { //Need to check for edge case - subscript or superscript at the end of a line if (this.SemanticBoxes.Count > 1) { FixedSOMTextRun run = this.SemanticBoxes[this.SemanticBoxes.Count - 2] as FixedSOMTextRun; if (run != null && lastRun.BoundingRect.Height / run.BoundingRect.Height < 0.75 && run.BoundingRect.Left != lastRun.BoundingRect.Left && run.BoundingRect.Right != lastRun.BoundingRect.Right && run.BoundingRect.Top != lastRun.BoundingRect.Top && run.BoundingRect.Bottom != lastRun.BoundingRect.Bottom) { return run.BoundingRect.Height; } } return lastRun.BoundingRect.Height; } else { return 0; } } } //return true if this FixedBlock is a wrapper around a floating image public bool IsFloatingImage { get { return (_semanticBoxes.Count == 1 && (_semanticBoxes[0] is FixedSOMImage)); } } internal override FixedElement.ElementType[] ElementTypes { get { return new FixedElement.ElementType[1] { FixedElement.ElementType.Paragraph }; } } public bool IsWhiteSpace { get { if (_semanticBoxes.Count == 0) { return false; } foreach (FixedSOMSemanticBox box in _semanticBoxes) { FixedSOMTextRun run = box as FixedSOMTextRun; if (run == null || !run.IsWhiteSpace) { return false; } } return true; } } public override bool IsRTL { get { return _RTLCount > _LTRCount; } } public Matrix Matrix { get { return _matrix; } } #endregion Public Properties #region Private Properties private FixedSOMTextRun LastTextRun { get { FixedSOMTextRun run = null; for (int i=_semanticBoxes.Count - 1; i>=0 && run==null; i--) { run = _semanticBoxes[i] as FixedSOMTextRun; } return run; } } #endregion Private Properties //------------------------------------------------------------------- // // Public Methods // //--------------------------------------------------------------------- #region Public Methods #if DEBUG public override void Render(DrawingContext dc, string label, DrawDebugVisual debugVisual) { Pen pen = new Pen(Brushes.Blue, 2); Rect rect = _boundingRect; rect.Inflate(3,3); dc.DrawRectangle(null, pen , rect); if (debugVisual == DrawDebugVisual.Paragraphs && label != null) { base.RenderLabel(dc, label); } for (int i=0; i1) { FixedSOMTextRun run = this.SemanticBoxes[this.SemanticBoxes.Count - 2] as FixedSOMTextRun; if (run != null && lastRun.BoundingRect.Height / run.BoundingRect.Height < 0.75 && run.BoundingRect.Left != lastRun.BoundingRect.Left && run.BoundingRect.Right != lastRun.BoundingRect.Right && run.BoundingRect.Top != lastRun.BoundingRect.Top && run.BoundingRect.Bottom != lastRun.BoundingRect.Bottom) { return run.BoundingRect.Height; } } return lastRun.BoundingRect.Height; } else { return 0; } } } //return true if this FixedBlock is a wrapper around a floating image public bool IsFloatingImage { get { return (_semanticBoxes.Count == 1 && (_semanticBoxes[0] is FixedSOMImage)); } } internal override FixedElement.ElementType[] ElementTypes { get { return new FixedElement.ElementType[1] { FixedElement.ElementType.Paragraph }; } } public bool IsWhiteSpace { get { if (_semanticBoxes.Count == 0) { return false; } foreach (FixedSOMSemanticBox box in _semanticBoxes) { FixedSOMTextRun run = box as FixedSOMTextRun; if (run == null || !run.IsWhiteSpace) { return false; } } return true; } } public override bool IsRTL { get { return _RTLCount > _LTRCount; } } public Matrix Matrix { get { return _matrix; } } #endregion Public Properties #region Private Properties private FixedSOMTextRun LastTextRun { get { FixedSOMTextRun run = null; for (int i=_semanticBoxes.Count - 1; i>=0 && run==null; i--) { run = _semanticBoxes[i] as FixedSOMTextRun; } return run; } } #endregion Private Properties //------------------------------------------------------------------- // // Public Methods // //--------------------------------------------------------------------- #region Public Methods #if DEBUG public override void Render(DrawingContext dc, string label, DrawDebugVisual debugVisual) { Pen pen = new Pen(Brushes.Blue, 2); Rect rect = _boundingRect; rect.Inflate(3,3); dc.DrawRectangle(null, pen , rect); if (debugVisual == DrawDebugVisual.Paragraphs && label != null) { base.RenderLabel(dc, label); } for (int i=0; i
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- _DomainName.cs
- ZipFileInfo.cs
- TextEditorParagraphs.cs
- ReflectionTypeLoadException.cs
- ListControlConvertEventArgs.cs
- RepeatInfo.cs
- PropertyEmitter.cs
- SqlPersistenceProviderFactory.cs
- DataMemberAttribute.cs
- XmlDomTextWriter.cs
- ProcessThreadCollection.cs
- SrgsRuleRef.cs
- PartitionedStream.cs
- fixedPageContentExtractor.cs
- WebPartHelpVerb.cs
- CharStorage.cs
- TemplateColumn.cs
- SqlRowUpdatedEvent.cs
- AssemblyHash.cs
- SafeViewOfFileHandle.cs
- UiaCoreTypesApi.cs
- ISO2022Encoding.cs
- XmlMembersMapping.cs
- TemplateKey.cs
- precedingquery.cs
- SafeNativeMethods.cs
- SymbolTable.cs
- AuthenticationModuleElementCollection.cs
- RuntimeEnvironment.cs
- DataGridHeaderBorder.cs
- HttpRawResponse.cs
- EdmSchemaError.cs
- QilReference.cs
- EntitySqlQueryBuilder.cs
- Convert.cs
- RectAnimation.cs
- GatewayIPAddressInformationCollection.cs
- BitmapData.cs
- ScrollViewerAutomationPeer.cs
- TypeCacheManager.cs
- ContainerTracking.cs
- XmlDeclaration.cs
- DesignerUtils.cs
- HwndSourceParameters.cs
- UpDownEvent.cs
- IxmlLineInfo.cs
- RecordManager.cs
- QilTypeChecker.cs
- MenuItemStyleCollection.cs
- NonVisualControlAttribute.cs
- PenThreadWorker.cs
- MenuAdapter.cs
- WindowsTreeView.cs
- SqlNotificationRequest.cs
- RoutedEvent.cs
- ThreadPool.cs
- CultureInfoConverter.cs
- Matrix.cs
- NoneExcludedImageIndexConverter.cs
- LessThan.cs
- SimpleLine.cs
- DataColumnMappingCollection.cs
- CodeSubDirectory.cs
- IconBitmapDecoder.cs
- OpenTypeLayout.cs
- TreeNodeCollectionEditor.cs
- TimeSpanConverter.cs
- QuestionEventArgs.cs
- StringAnimationBase.cs
- BaseTemplateCodeDomTreeGenerator.cs
- BooleanAnimationUsingKeyFrames.cs
- XmlDownloadManager.cs
- TerminateDesigner.cs
- VirtualPathUtility.cs
- TextRenderingModeValidation.cs
- DbProviderFactory.cs
- Stylesheet.cs
- FormattedText.cs
- SafeArrayTypeMismatchException.cs
- ExcCanonicalXml.cs
- SqlMetaData.cs
- RowBinding.cs
- CollectionTypeElement.cs
- Main.cs
- OrthographicCamera.cs
- Panel.cs
- ColorTypeConverter.cs
- ParenExpr.cs
- objectresult_tresulttype.cs
- EntityDesignerUtils.cs
- ListViewInsertEventArgs.cs
- QuestionEventArgs.cs
- DataGridViewCheckBoxCell.cs
- ValidatorCompatibilityHelper.cs
- KeyTime.cs
- DesignerDataSourceView.cs
- SmtpNetworkElement.cs
- MDIClient.cs
- SecurityTokenException.cs
- List.cs