Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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: [....] - 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
- XPathSelfQuery.cs
- BufferedReadStream.cs
- RecordManager.cs
- GenericUriParser.cs
- DefaultSerializationProviderAttribute.cs
- DataView.cs
- GifBitmapDecoder.cs
- MessagePropertyDescription.cs
- StorageTypeMapping.cs
- DataGridViewRowConverter.cs
- InteropAutomationProvider.cs
- ValidatorCompatibilityHelper.cs
- ObjectKeyFrameCollection.cs
- ComplexPropertyEntry.cs
- ProfilePropertySettings.cs
- LogicalMethodInfo.cs
- SetState.cs
- DocumentPaginator.cs
- RsaSecurityKey.cs
- XPathNode.cs
- DataTemplateSelector.cs
- ClientCultureInfo.cs
- TableCellCollection.cs
- CustomAttributeBuilder.cs
- TextEffectResolver.cs
- LocalFileSettingsProvider.cs
- GacUtil.cs
- CacheRequest.cs
- GridItemCollection.cs
- oledbmetadatacollectionnames.cs
- RenderingBiasValidation.cs
- ComponentResourceKey.cs
- MarkupExtensionReturnTypeAttribute.cs
- TimeSpanMinutesConverter.cs
- InternalConfigEventArgs.cs
- DateTimeParse.cs
- TypeForwardedToAttribute.cs
- FunctionCommandText.cs
- GroupDescription.cs
- XPathDocumentNavigator.cs
- ConnectorEditor.cs
- ListSortDescription.cs
- GroupItemAutomationPeer.cs
- RoutedEventHandlerInfo.cs
- VerificationException.cs
- DBCommand.cs
- ConnectionPointCookie.cs
- ViewKeyConstraint.cs
- ActivityDesignerAccessibleObject.cs
- DbParameterHelper.cs
- CacheSection.cs
- UserPersonalizationStateInfo.cs
- PixelFormats.cs
- CfgSemanticTag.cs
- TableCell.cs
- Win32Native.cs
- HtmlWindow.cs
- ConfigurationSection.cs
- _AutoWebProxyScriptWrapper.cs
- WebResourceUtil.cs
- StyleCollectionEditor.cs
- GridViewRowPresenter.cs
- EventLogPermissionEntryCollection.cs
- _DomainName.cs
- UnauthorizedWebPart.cs
- DeferredReference.cs
- Bits.cs
- securitymgrsite.cs
- TreeWalkHelper.cs
- WindowsListViewGroup.cs
- XPathConvert.cs
- BooleanAnimationUsingKeyFrames.cs
- FrameworkElementAutomationPeer.cs
- CompleteWizardStep.cs
- SecurityKeyIdentifier.cs
- LinqDataSourceDisposeEventArgs.cs
- SystemKeyConverter.cs
- oledbconnectionstring.cs
- MatrixTransform.cs
- ObjectHelper.cs
- Encoding.cs
- Matrix3DConverter.cs
- PowerModeChangedEventArgs.cs
- EntityTemplateUserControl.cs
- SchemaNames.cs
- XmlReflectionMember.cs
- StatusStrip.cs
- SqlConnectionPoolProviderInfo.cs
- ToolStripMenuItem.cs
- WsdlImporterElement.cs
- ExpandableObjectConverter.cs
- GacUtil.cs
- keycontainerpermission.cs
- ExtensionFile.cs
- OutputCacheSection.cs
- ContainerActivationHelper.cs
- HtmlMobileTextWriter.cs
- ScriptReferenceBase.cs
- GlobalAllocSafeHandle.cs
- UnmanagedMemoryStream.cs