Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Documents / FixedSOMTableCell.cs / 1 / FixedSOMTableCell.cs
/*++ File: FixedSOMTableCell.cs Copyright (C) 2005 Microsoft Corporation. All rights reserved. Description: This class reprsents a table cell on the page. Objects of this class would contain several FixedBlocks, Images etc. that fit within the cell boundaries History: 05/17/2005: eleese - Created --*/ namespace System.Windows.Documents { using System.Windows.Shapes; using System.Windows.Media; using System.Diagnostics; using System.Windows; using System.Windows.Controls; internal sealed class FixedSOMTableCell : FixedSOMContainer { //-------------------------------------------------------------------- // // Constructors // //--------------------------------------------------------------------- #region Constructors public FixedSOMTableCell(double left, double top, double right, double bottom) { _boundingRect = new Rect(new Point(left, top), new Point(right, bottom)); _containsTable = false; _columnSpan = 1; } #endregion Constructors //------------------------------------------------------------------- // // Public Methods // //--------------------------------------------------------------------- #region Public Methods #if DEBUG public override void Render(DrawingContext dc, string label, DrawDebugVisual debugVisual) { Pen pen = new Pen(Brushes.Red, 2); Rect rect = _boundingRect; dc.DrawRectangle(null, pen , rect); /* for (int i = 0; i < _semanticBoxes.Count; i++) { _semanticBoxes[i].Render(dc, null,debugVisual); } */ } #endif public void AddContainer(FixedSOMContainer container) { //Check nested tables first if (!(_containsTable && _AddToInnerTable(container))) { base.Add(container); } if (container is FixedSOMTable) { _containsTable = true; } } public override void SetRTFProperties(FixedElement element) { element.SetValue(Block.BorderThicknessProperty, new Thickness(1)); element.SetValue(Block.BorderBrushProperty, Brushes.Black); element.SetValue(TableCell.ColumnSpanProperty, _columnSpan); } #endregion Public Methods #region Private Methods private bool _AddToInnerTable(FixedSOMContainer container) { foreach (FixedSOMSemanticBox box in _semanticBoxes) { FixedSOMTable table = box as FixedSOMTable; if (table != null && table.AddContainer(container)) { return true; } } return false; } #endregion Private Methods #region Internal Properties internal override FixedElement.ElementType[] ElementTypes { get { return new FixedElement.ElementType[1] { FixedElement.ElementType.TableCell }; } } internal bool IsEmpty { get { foreach (FixedSOMContainer container in this.SemanticBoxes) { FixedSOMTable table = container as FixedSOMTable; if (table != null && !table.IsEmpty) { return false; } FixedSOMFixedBlock block = container as FixedSOMFixedBlock; if (block != null && !block.IsWhiteSpace) { return false; } } return true; } } internal int ColumnSpan { get { return _columnSpan; } set { _columnSpan = value; } } #endregion Internal Properties //-------------------------------------------------------------------- // // Private Fields // //--------------------------------------------------------------------- #region Private Fields private bool _containsTable; private int _columnSpan; #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. /*++ File: FixedSOMTableCell.cs Copyright (C) 2005 Microsoft Corporation. All rights reserved. Description: This class reprsents a table cell on the page. Objects of this class would contain several FixedBlocks, Images etc. that fit within the cell boundaries History: 05/17/2005: eleese - Created --*/ namespace System.Windows.Documents { using System.Windows.Shapes; using System.Windows.Media; using System.Diagnostics; using System.Windows; using System.Windows.Controls; internal sealed class FixedSOMTableCell : FixedSOMContainer { //-------------------------------------------------------------------- // // Constructors // //--------------------------------------------------------------------- #region Constructors public FixedSOMTableCell(double left, double top, double right, double bottom) { _boundingRect = new Rect(new Point(left, top), new Point(right, bottom)); _containsTable = false; _columnSpan = 1; } #endregion Constructors //------------------------------------------------------------------- // // Public Methods // //--------------------------------------------------------------------- #region Public Methods #if DEBUG public override void Render(DrawingContext dc, string label, DrawDebugVisual debugVisual) { Pen pen = new Pen(Brushes.Red, 2); Rect rect = _boundingRect; dc.DrawRectangle(null, pen , rect); /* for (int i = 0; i < _semanticBoxes.Count; i++) { _semanticBoxes[i].Render(dc, null,debugVisual); } */ } #endif public void AddContainer(FixedSOMContainer container) { //Check nested tables first if (!(_containsTable && _AddToInnerTable(container))) { base.Add(container); } if (container is FixedSOMTable) { _containsTable = true; } } public override void SetRTFProperties(FixedElement element) { element.SetValue(Block.BorderThicknessProperty, new Thickness(1)); element.SetValue(Block.BorderBrushProperty, Brushes.Black); element.SetValue(TableCell.ColumnSpanProperty, _columnSpan); } #endregion Public Methods #region Private Methods private bool _AddToInnerTable(FixedSOMContainer container) { foreach (FixedSOMSemanticBox box in _semanticBoxes) { FixedSOMTable table = box as FixedSOMTable; if (table != null && table.AddContainer(container)) { return true; } } return false; } #endregion Private Methods #region Internal Properties internal override FixedElement.ElementType[] ElementTypes { get { return new FixedElement.ElementType[1] { FixedElement.ElementType.TableCell }; } } internal bool IsEmpty { get { foreach (FixedSOMContainer container in this.SemanticBoxes) { FixedSOMTable table = container as FixedSOMTable; if (table != null && !table.IsEmpty) { return false; } FixedSOMFixedBlock block = container as FixedSOMFixedBlock; if (block != null && !block.IsWhiteSpace) { return false; } } return true; } } internal int ColumnSpan { get { return _columnSpan; } set { _columnSpan = value; } } #endregion Internal Properties //-------------------------------------------------------------------- // // Private Fields // //--------------------------------------------------------------------- #region Private Fields private bool _containsTable; private int _columnSpan; #endregion Private Fields } } // 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
- EnvironmentPermission.cs
- DynamicRenderer.cs
- GrammarBuilderPhrase.cs
- IntSecurity.cs
- WorkflowRuntimeService.cs
- XmlBaseWriter.cs
- MetricEntry.cs
- XsltSettings.cs
- MatrixCamera.cs
- X509CertificateTrustedIssuerElementCollection.cs
- PropertyGeneratedEventArgs.cs
- FileFormatException.cs
- SqlBulkCopyColumnMappingCollection.cs
- CompositionAdorner.cs
- SHA512.cs
- StylusTip.cs
- VectorAnimationUsingKeyFrames.cs
- TransactedReceiveData.cs
- _RegBlobWebProxyDataBuilder.cs
- DeclarativeCatalogPart.cs
- RepeatInfo.cs
- ToolStripContentPanel.cs
- LabelTarget.cs
- LabelEditEvent.cs
- Lazy.cs
- ChannelProtectionRequirements.cs
- FastEncoder.cs
- SplitContainer.cs
- SQLSingleStorage.cs
- ObjectAnimationUsingKeyFrames.cs
- CodeCatchClause.cs
- NamespaceQuery.cs
- SimpleHandlerFactory.cs
- EditorPartChrome.cs
- StorageEntitySetMapping.cs
- GridViewColumnHeader.cs
- streamingZipPartStream.cs
- BindingWorker.cs
- OdbcInfoMessageEvent.cs
- EventLogInformation.cs
- MediaScriptCommandRoutedEventArgs.cs
- FontSizeConverter.cs
- GridViewRowEventArgs.cs
- _UriSyntax.cs
- StandardToolWindows.cs
- AttributeSetAction.cs
- RequiredFieldValidator.cs
- RequiredFieldValidator.cs
- DataGridViewTextBoxEditingControl.cs
- SoapFaultCodes.cs
- TreeNodeStyleCollection.cs
- WindowsFormsLinkLabel.cs
- MimeMapping.cs
- SerializationSectionGroup.cs
- DbSourceCommand.cs
- FindCriteriaApril2005.cs
- CodeGroup.cs
- RawStylusInputCustomDataList.cs
- ParallelForEach.cs
- Or.cs
- ButtonFlatAdapter.cs
- CriticalExceptions.cs
- OrderingExpression.cs
- relpropertyhelper.cs
- HttpCachePolicy.cs
- DoubleAnimationUsingKeyFrames.cs
- CleanUpVirtualizedItemEventArgs.cs
- CompensationParticipant.cs
- RuleProcessor.cs
- SignedInfo.cs
- DispatchChannelSink.cs
- DoubleAnimationClockResource.cs
- ToolStripSeparator.cs
- Version.cs
- ControlBuilder.cs
- XsdDateTime.cs
- XmlMemberMapping.cs
- TCPListener.cs
- MouseDevice.cs
- AliasExpr.cs
- DataGridLengthConverter.cs
- RuleAttributes.cs
- BindingContext.cs
- smtppermission.cs
- HTMLTagNameToTypeMapper.cs
- StreamSecurityUpgradeAcceptorBase.cs
- HttpProtocolImporter.cs
- OracleDateTime.cs
- ConvertEvent.cs
- CodeAccessPermission.cs
- AssemblyCache.cs
- ExpressionBindingCollection.cs
- RTLAwareMessageBox.cs
- WindowsImpersonationContext.cs
- RolePrincipal.cs
- MultipartContentParser.cs
- HtmlTableCell.cs
- SslStream.cs
- Privilege.cs
- StylusPointCollection.cs