Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- TextShapeableCharacters.cs
- SendingRequestEventArgs.cs
- ThreadStartException.cs
- CurrentChangingEventArgs.cs
- NullableDoubleMinMaxAggregationOperator.cs
- NameTable.cs
- ComplexBindingPropertiesAttribute.cs
- ControllableStoryboardAction.cs
- XmlAutoDetectWriter.cs
- xmlfixedPageInfo.cs
- CacheDependency.cs
- Timer.cs
- IndexedGlyphRun.cs
- BindableTemplateBuilder.cs
- Timer.cs
- Emitter.cs
- DataRecord.cs
- InvariantComparer.cs
- HandlerWithFactory.cs
- CreateUserErrorEventArgs.cs
- TypeDelegator.cs
- InheritablePropertyChangeInfo.cs
- ContextMenuService.cs
- NativeMethods.cs
- SafeBitVector32.cs
- Help.cs
- CapabilitiesUse.cs
- storepermissionattribute.cs
- SqlServer2KCompatibilityCheck.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- DataContract.cs
- EditingCoordinator.cs
- WorkflowQueueInfo.cs
- TabControlEvent.cs
- IgnoreSection.cs
- DataPagerFieldCollection.cs
- CultureMapper.cs
- Base64Stream.cs
- TableCell.cs
- ErrorStyle.cs
- RawTextInputReport.cs
- GeneralTransform.cs
- DistributedTransactionPermission.cs
- IISUnsafeMethods.cs
- TreeNodeEventArgs.cs
- ThreadAbortException.cs
- HashAlgorithm.cs
- HtmlTableCell.cs
- PropertyEmitterBase.cs
- SchemaEntity.cs
- ImageField.cs
- SelectManyQueryOperator.cs
- ToolStripDropDownItem.cs
- ObjectTag.cs
- SubclassTypeValidatorAttribute.cs
- Wildcard.cs
- TextSelectionProcessor.cs
- DateTimeOffsetConverter.cs
- OdbcConnectionOpen.cs
- SQLCharsStorage.cs
- TableRowCollection.cs
- AutomationElementIdentifiers.cs
- SmtpCommands.cs
- HttpHandler.cs
- WebPartEditorOkVerb.cs
- DbParameterHelper.cs
- TextViewSelectionProcessor.cs
- SqlNotificationRequest.cs
- Win32Interop.cs
- XamlStream.cs
- CustomErrorsSection.cs
- ScriptModule.cs
- EventLogPermissionEntryCollection.cs
- Permission.cs
- HelpKeywordAttribute.cs
- RuntimeConfigurationRecord.cs
- TrackingMemoryStreamFactory.cs
- AudienceUriMode.cs
- BaseResourcesBuildProvider.cs
- SoapIgnoreAttribute.cs
- UIElementParaClient.cs
- PackWebRequest.cs
- HtmlImage.cs
- VerticalAlignConverter.cs
- TemplateField.cs
- RequestCachePolicy.cs
- WebEventTraceProvider.cs
- ElapsedEventArgs.cs
- ProgressBar.cs
- RadioButtonStandardAdapter.cs
- XmlSchemaImport.cs
- CachedPathData.cs
- PartialTrustHelpers.cs
- _AutoWebProxyScriptHelper.cs
- PersonalizationProviderCollection.cs
- ListBoxItemAutomationPeer.cs
- AutoGeneratedFieldProperties.cs
- ConfigXmlText.cs
- ObjectNavigationPropertyMapping.cs
- ListBoxAutomationPeer.cs