Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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; i 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; i
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FigureParaClient.cs
- UIElementAutomationPeer.cs
- LocalizableResourceBuilder.cs
- RegisteredArrayDeclaration.cs
- LOSFormatter.cs
- WorkflowServiceNamespace.cs
- IssuanceLicense.cs
- PrimaryKeyTypeConverter.cs
- ExternalDataExchangeService.cs
- GridViewPageEventArgs.cs
- ObjectTag.cs
- Shared.cs
- FontUnitConverter.cs
- ServiceThrottle.cs
- ProxyManager.cs
- WindowsFormsSectionHandler.cs
- TcpChannelHelper.cs
- Guid.cs
- CodeTypeDelegate.cs
- RootBuilder.cs
- SmtpReplyReader.cs
- SqlFunctionAttribute.cs
- TabItemAutomationPeer.cs
- WebPartAddingEventArgs.cs
- RightsManagementInformation.cs
- Stroke.cs
- DependencyPropertyKey.cs
- Configuration.cs
- MetabaseSettingsIis7.cs
- PreviewControlDesigner.cs
- DataGridViewBindingCompleteEventArgs.cs
- ConfigurationSection.cs
- XmlParserContext.cs
- HandoffBehavior.cs
- WindowsTooltip.cs
- SqlCommandSet.cs
- IgnoreSectionHandler.cs
- TableLayoutSettingsTypeConverter.cs
- DataGridViewUtilities.cs
- LocatorPartList.cs
- JsonReaderWriterFactory.cs
- Font.cs
- UpdateCompiler.cs
- UrlPropertyAttribute.cs
- FixedTextContainer.cs
- InstanceCollisionException.cs
- ConstructorExpr.cs
- NotifyParentPropertyAttribute.cs
- FontFamily.cs
- HttpRequestTraceRecord.cs
- UserMapPath.cs
- ScrollBar.cs
- _NegoState.cs
- SimpleWebHandlerParser.cs
- ObjectViewFactory.cs
- RelOps.cs
- SortExpressionBuilder.cs
- DynamicPropertyReader.cs
- SiteMapDataSourceView.cs
- ToolStripDesignerAvailabilityAttribute.cs
- CompModSwitches.cs
- Ops.cs
- BamlTreeNode.cs
- EntityTransaction.cs
- TypeToken.cs
- PtsCache.cs
- CorrelationResolver.cs
- WinFormsSpinner.cs
- ConnectionProviderAttribute.cs
- WebRequestModuleElement.cs
- RootProfilePropertySettingsCollection.cs
- StrokeDescriptor.cs
- SqlTopReducer.cs
- WsatProxy.cs
- PiiTraceSource.cs
- EncryptedPackage.cs
- ProfileSection.cs
- CubicEase.cs
- ApplicationServiceManager.cs
- Event.cs
- DataObjectCopyingEventArgs.cs
- Identity.cs
- Adorner.cs
- DemultiplexingClientMessageFormatter.cs
- SplitContainer.cs
- Win32.cs
- IPAddressCollection.cs
- NullRuntimeConfig.cs
- WsrmTraceRecord.cs
- CompModSwitches.cs
- PrintSchema.cs
- Assert.cs
- XmlName.cs
- TemplateApplicationHelper.cs
- ConvertEvent.cs
- DefaultProxySection.cs
- SqlUserDefinedTypeAttribute.cs
- SimpleTypeResolver.cs
- CodeSubDirectory.cs
- UnmanagedMarshal.cs