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
- ReadOnlyTernaryTree.cs
- AdornerPresentationContext.cs
- WSTrustDec2005.cs
- XMLSchema.cs
- FieldCollectionEditor.cs
- PermissionRequestEvidence.cs
- Model3DGroup.cs
- DataBoundControlActionList.cs
- IPGlobalProperties.cs
- CodeAttributeArgument.cs
- XmlNode.cs
- QilLiteral.cs
- ComEventsInfo.cs
- ChildrenQuery.cs
- DatePickerTextBox.cs
- CheckBoxList.cs
- DbTransaction.cs
- DashStyles.cs
- IndependentAnimationStorage.cs
- Interlocked.cs
- QilName.cs
- DataSourceComponent.cs
- Axis.cs
- _OSSOCK.cs
- PagePropertiesChangingEventArgs.cs
- ProfileService.cs
- InkPresenterAutomationPeer.cs
- BitmapEffectDrawingContent.cs
- SecondaryIndexList.cs
- ManagementEventWatcher.cs
- SerializationFieldInfo.cs
- PropertyMap.cs
- StorageEndPropertyMapping.cs
- ConvertEvent.cs
- RawStylusInputReport.cs
- GeneralTransform3DTo2DTo3D.cs
- MergeEnumerator.cs
- FrameworkElementFactoryMarkupObject.cs
- UnknownBitmapDecoder.cs
- FrameworkObject.cs
- HelpInfo.cs
- ConfigXmlCDataSection.cs
- ContextMenuStrip.cs
- TextBoxView.cs
- HttpCookieCollection.cs
- Clause.cs
- LongValidatorAttribute.cs
- MachineKeySection.cs
- DesignerDeviceConfig.cs
- ToolboxItemCollection.cs
- ShellProvider.cs
- RelationshipFixer.cs
- SharedUtils.cs
- DataTableMappingCollection.cs
- HostProtectionException.cs
- ComponentChangedEvent.cs
- EventSinkActivity.cs
- CDSsyncETWBCLProvider.cs
- PipelineComponent.cs
- WeakRefEnumerator.cs
- AppDomainAttributes.cs
- util.cs
- OleDbRowUpdatedEvent.cs
- WhitespaceRule.cs
- OpenTypeCommon.cs
- FrameworkElementAutomationPeer.cs
- SequenceNumber.cs
- DynamicPhysicalDiscoSearcher.cs
- QueryOperator.cs
- ListenerBinder.cs
- ChildrenQuery.cs
- OperationPickerDialog.cs
- RSAPKCS1SignatureFormatter.cs
- ProfileModule.cs
- ExternalCalls.cs
- StagingAreaInputItem.cs
- Compiler.cs
- Trace.cs
- TypeSemantics.cs
- MaskedTextBox.cs
- TrustManagerMoreInformation.cs
- KerberosRequestorSecurityToken.cs
- ImmComposition.cs
- GregorianCalendarHelper.cs
- PointF.cs
- FormsAuthenticationCredentials.cs
- DiscoveryEndpointValidator.cs
- PromptEventArgs.cs
- KeyConstraint.cs
- Timer.cs
- ReliabilityContractAttribute.cs
- Journal.cs
- ToolStrip.cs
- KoreanLunisolarCalendar.cs
- CustomMenuItemCollection.cs
- TreePrinter.cs
- Thumb.cs
- SafeNativeMethods.cs
- Rotation3DAnimation.cs
- PixelShader.cs