Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / FixedSOMTableCell.cs / 1305600 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PreservationFileReader.cs
- filewebresponse.cs
- LOSFormatter.cs
- HttpConfigurationSystem.cs
- ApplicationServicesHostFactory.cs
- AssemblyAssociatedContentFileAttribute.cs
- CodeDefaultValueExpression.cs
- UnmanagedMemoryStream.cs
- InstancePersistence.cs
- ShapeTypeface.cs
- NodeFunctions.cs
- FormatConvertedBitmap.cs
- ServiceDescriptionSerializer.cs
- XmlSerializableWriter.cs
- TransformedBitmap.cs
- CodeGeneratorOptions.cs
- WSSecurityOneDotZeroReceiveSecurityHeader.cs
- ToolStripLocationCancelEventArgs.cs
- ToolStripItemCollection.cs
- BigInt.cs
- Identity.cs
- ObservableDictionary.cs
- FlagsAttribute.cs
- TableItemProviderWrapper.cs
- SqlWriter.cs
- _DigestClient.cs
- TextEditorSpelling.cs
- PageOrientation.cs
- SafeRightsManagementEnvironmentHandle.cs
- ELinqQueryState.cs
- DictionaryEntry.cs
- RtfControlWordInfo.cs
- DrawingContext.cs
- RefreshInfo.cs
- SimpleRecyclingCache.cs
- ResourceContainerWrapper.cs
- HeaderCollection.cs
- DbParameterCollectionHelper.cs
- TreeViewHitTestInfo.cs
- HttpFileCollectionBase.cs
- BuildProvider.cs
- MenuEventArgs.cs
- XmlBinaryReaderSession.cs
- XhtmlBasicFormAdapter.cs
- ConvertTextFrag.cs
- SoundPlayerAction.cs
- InputMethodStateChangeEventArgs.cs
- RelatedCurrencyManager.cs
- EventLogPermissionEntry.cs
- HScrollProperties.cs
- Pair.cs
- XamlFxTrace.cs
- QilReference.cs
- ExecutionEngineException.cs
- MetadataItemSerializer.cs
- ToolStripArrowRenderEventArgs.cs
- XmlLanguageConverter.cs
- SymLanguageVendor.cs
- DataTrigger.cs
- PolyBezierSegmentFigureLogic.cs
- StatusCommandUI.cs
- ParallelTimeline.cs
- LogPolicy.cs
- RbTree.cs
- DesignBindingValueUIHandler.cs
- PropertyPathWorker.cs
- SamlSecurityTokenAuthenticator.cs
- FacetEnabledSchemaElement.cs
- XmlDictionary.cs
- CodeObjectCreateExpression.cs
- MobileControlsSectionHandler.cs
- RemotingException.cs
- EntitySetRetriever.cs
- OdbcStatementHandle.cs
- Sorting.cs
- PhysicalAddress.cs
- Operators.cs
- BaseComponentEditor.cs
- SendMailErrorEventArgs.cs
- BitmapFrameEncode.cs
- ToolStripItemCollection.cs
- FixedDocumentPaginator.cs
- basenumberconverter.cs
- BigInt.cs
- ServiceMoniker.cs
- ObjectSet.cs
- StringComparer.cs
- Odbc32.cs
- LinqDataSourceDisposeEventArgs.cs
- WpfXamlLoader.cs
- WindowsIPAddress.cs
- StorageMappingFragment.cs
- Stopwatch.cs
- AnonymousIdentificationModule.cs
- DataGridViewRowsRemovedEventArgs.cs
- NullableLongSumAggregationOperator.cs
- CodeMethodMap.cs
- IdentityManager.cs
- ParseElementCollection.cs
- HealthMonitoringSectionHelper.cs