Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / Documents / FixedSOMFixedBlock.cs / 1 / 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
- DataGridCellClipboardEventArgs.cs
- DataGridPagerStyle.cs
- TextProperties.cs
- DropShadowEffect.cs
- SupportingTokenAuthenticatorSpecification.cs
- ExpressionConverter.cs
- BatchServiceHost.cs
- OledbConnectionStringbuilder.cs
- DbSetClause.cs
- ChannelManager.cs
- _ScatterGatherBuffers.cs
- WhitespaceRuleLookup.cs
- VerificationException.cs
- XXXOnTypeBuilderInstantiation.cs
- XPathSelfQuery.cs
- HttpProfileGroupBase.cs
- ClientTargetSection.cs
- HttpCacheVary.cs
- TreeView.cs
- RawStylusSystemGestureInputReport.cs
- UnicodeEncoding.cs
- TaskbarItemInfo.cs
- RangeValidator.cs
- HtmlCalendarAdapter.cs
- IdentityModelDictionary.cs
- TranslateTransform.cs
- WsdlImporter.cs
- GPPOINTF.cs
- PrinterResolution.cs
- FileSystemEventArgs.cs
- TcpHostedTransportConfiguration.cs
- SortedDictionary.cs
- TransformerTypeCollection.cs
- CaseCqlBlock.cs
- GenericPrincipal.cs
- SystemInformation.cs
- PrimitiveSchema.cs
- RemotingConfiguration.cs
- WindowInteropHelper.cs
- ActivityPreviewDesigner.cs
- DataGridAutoGeneratingColumnEventArgs.cs
- SmtpAuthenticationManager.cs
- ObjectDataSourceSelectingEventArgs.cs
- BitmapCacheBrush.cs
- SemanticResultKey.cs
- EncoderExceptionFallback.cs
- TableItemProviderWrapper.cs
- CodeIdentifiers.cs
- DrawingState.cs
- CmsInterop.cs
- SessionPageStateSection.cs
- DecimalFormatter.cs
- PingOptions.cs
- TiffBitmapEncoder.cs
- PtsCache.cs
- ApplicationFileParser.cs
- StorageModelBuildProvider.cs
- ConfigsHelper.cs
- followingquery.cs
- ItemsControlAutomationPeer.cs
- MergeFilterQuery.cs
- Activation.cs
- TreeNodeStyle.cs
- SkewTransform.cs
- PresentationTraceSources.cs
- AQNBuilder.cs
- PersonalizablePropertyEntry.cs
- EntityDataSourceDesigner.cs
- CustomCategoryAttribute.cs
- XmlSchemaDatatype.cs
- TypeDescriptionProviderAttribute.cs
- DocobjHost.cs
- UserPreferenceChangingEventArgs.cs
- ImageDesigner.cs
- StringUtil.cs
- XsltSettings.cs
- HtmlInputPassword.cs
- HebrewNumber.cs
- XslTransformFileEditor.cs
- PersonalizationStateQuery.cs
- ByteStorage.cs
- ResolveCriteria11.cs
- ManipulationInertiaStartingEventArgs.cs
- ReflectionTypeLoadException.cs
- PackagePartCollection.cs
- RelationshipSet.cs
- DataListCommandEventArgs.cs
- FileDialog.cs
- CompensableActivity.cs
- DataStorage.cs
- nulltextcontainer.cs
- Transform3DCollection.cs
- BamlRecords.cs
- CompilerWrapper.cs
- QilXmlWriter.cs
- FormParameter.cs
- TextUtf8RawTextWriter.cs
- XmlSchemaComplexContentRestriction.cs
- MailWebEventProvider.cs
- StylusPointPropertyInfoDefaults.cs