Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- EntityWrapperFactory.cs
- TdsParserSafeHandles.cs
- HttpCachePolicyElement.cs
- ProofTokenCryptoHandle.cs
- MarshalByRefObject.cs
- UICuesEvent.cs
- SQLConvert.cs
- HMACSHA512.cs
- EnumerableValidator.cs
- sortedlist.cs
- GACMembershipCondition.cs
- EncodingInfo.cs
- BamlTreeUpdater.cs
- MetadataCache.cs
- SplitterEvent.cs
- ConfigXmlWhitespace.cs
- StorageComplexTypeMapping.cs
- ModuleBuilderData.cs
- SQLDecimalStorage.cs
- Light.cs
- SerializationFieldInfo.cs
- EndpointDiscoveryElement.cs
- SafeProcessHandle.cs
- WindowsComboBox.cs
- XPathNavigatorReader.cs
- ContextMenu.cs
- GridLengthConverter.cs
- ConfigurationManager.cs
- UniqueIdentifierService.cs
- QueryAccessibilityHelpEvent.cs
- ProcessingInstructionAction.cs
- WindowsScrollBarBits.cs
- XmlIlGenerator.cs
- CqlWriter.cs
- ItemsPresenter.cs
- TimelineCollection.cs
- ProjectionAnalyzer.cs
- ConfigurationSchemaErrors.cs
- WorkerRequest.cs
- CurrentChangingEventManager.cs
- IdentitySection.cs
- FigureHelper.cs
- SqlDataSourceCommandEventArgs.cs
- MimeTypeAttribute.cs
- ProviderCommandInfoUtils.cs
- ProfileModule.cs
- KerberosTicketHashIdentifierClause.cs
- TraceData.cs
- GlobalEventManager.cs
- StylusPointPropertyInfoDefaults.cs
- UriScheme.cs
- PathFigureCollectionValueSerializer.cs
- PeerNameRecord.cs
- TextSegment.cs
- WebRequestModuleElementCollection.cs
- EnumerableRowCollection.cs
- httpserverutility.cs
- ObjectItemConventionAssemblyLoader.cs
- SortFieldComparer.cs
- WebPartRestoreVerb.cs
- Assembly.cs
- TextBoxBase.cs
- ApplicationGesture.cs
- InkPresenterAutomationPeer.cs
- EventListener.cs
- ContentPropertyAttribute.cs
- OracleConnectionFactory.cs
- XmlNode.cs
- Visual3DCollection.cs
- CompositeCollection.cs
- SchemaElementDecl.cs
- ToolStripDropTargetManager.cs
- Ticks.cs
- TabControlEvent.cs
- ThreadNeutralSemaphore.cs
- ListBindableAttribute.cs
- ExpressionList.cs
- SqlSelectClauseBuilder.cs
- Tracer.cs
- Globals.cs
- wgx_render.cs
- PrimitiveXmlSerializers.cs
- Screen.cs
- NTAccount.cs
- CompositionTarget.cs
- TemplatedControlDesigner.cs
- JsonFormatWriterGenerator.cs
- SaveFileDialogDesigner.cs
- HelloMessageCD1.cs
- StatusBarItemAutomationPeer.cs
- QueryRelOp.cs
- Transform.cs
- PieceDirectory.cs
- MappedMetaModel.cs
- DelimitedListTraceListener.cs
- DesignerCategoryAttribute.cs
- SystemIcmpV4Statistics.cs
- CompositeCollectionView.cs
- BindingContext.cs
- Vector3DAnimation.cs