Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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: [....] - 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
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlClientWrapperSmiStreamChars.cs
- HostedTcpTransportManager.cs
- Exceptions.cs
- GAC.cs
- FileRecordSequenceCompletedAsyncResult.cs
- ConfigurationStrings.cs
- GPRECTF.cs
- FrameworkContentElement.cs
- QuotaThrottle.cs
- DataSourceControlBuilder.cs
- SqlNodeAnnotations.cs
- ServiceMetadataContractBehavior.cs
- Vector3dCollection.cs
- SaveRecipientRequest.cs
- EdmSchemaAttribute.cs
- PageCache.cs
- Roles.cs
- EUCJPEncoding.cs
- X509SecurityToken.cs
- ScrollChangedEventArgs.cs
- HttpConfigurationContext.cs
- ContextTokenTypeConverter.cs
- PngBitmapDecoder.cs
- PickBranchDesigner.xaml.cs
- ProviderConnectionPointCollection.cs
- AudioStateChangedEventArgs.cs
- TransactionTraceIdentifier.cs
- StrongNamePublicKeyBlob.cs
- DescendentsWalkerBase.cs
- HierarchicalDataSourceControl.cs
- DocumentReferenceCollection.cs
- CursorEditor.cs
- AlternateView.cs
- ParameterCollection.cs
- MultilineStringConverter.cs
- CultureTable.cs
- Hex.cs
- Bezier.cs
- EnvelopedPkcs7.cs
- SqlRecordBuffer.cs
- DataSetMappper.cs
- FreezableDefaultValueFactory.cs
- Psha1DerivedKeyGenerator.cs
- DataContractSet.cs
- ByteStream.cs
- LinqDataSourceValidationException.cs
- ConnectionProviderAttribute.cs
- MasterPageCodeDomTreeGenerator.cs
- HttpRequestBase.cs
- XmlDictionaryReader.cs
- ListDictionaryInternal.cs
- InputLangChangeEvent.cs
- UriSection.cs
- BindingOperations.cs
- TextBoxRenderer.cs
- OneOfConst.cs
- NeutralResourcesLanguageAttribute.cs
- MyContact.cs
- PopOutPanel.cs
- FocusChangedEventArgs.cs
- ServiceOperationWrapper.cs
- SuppressMergeCheckAttribute.cs
- AxisAngleRotation3D.cs
- EdmToObjectNamespaceMap.cs
- DataGridViewRow.cs
- RuleDefinitions.cs
- MaskInputRejectedEventArgs.cs
- OperationCanceledException.cs
- DtdParser.cs
- DbConnectionPoolGroupProviderInfo.cs
- CommonDialog.cs
- PreviewPrintController.cs
- UrlPath.cs
- ConnectorSelectionGlyph.cs
- KeyboardDevice.cs
- SafeFindHandle.cs
- WindowsListViewGroupSubsetLink.cs
- HtmlEncodedRawTextWriter.cs
- PasswordTextNavigator.cs
- XmlNodeReader.cs
- WrappedReader.cs
- ToolStripPanel.cs
- AdapterUtil.cs
- StrongNameUtility.cs
- XPathScanner.cs
- SerialStream.cs
- Wizard.cs
- StyleCollection.cs
- LinearQuaternionKeyFrame.cs
- TableProviderWrapper.cs
- BehaviorEditorPart.cs
- StorageTypeMapping.cs
- SplashScreenNativeMethods.cs
- EpmContentDeSerializerBase.cs
- Hex.cs
- SystemUdpStatistics.cs
- DataServiceRequest.cs
- DataGridViewComboBoxColumn.cs
- _ConnectOverlappedAsyncResult.cs
- XmlSchemaSimpleContentRestriction.cs