Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / DocumentStructures / SemanticBasicElement.cs / 1305600 / SemanticBasicElement.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // History: // 05/12/2005 : mingliu - created. // // //--------------------------------------------------------------------------- using MS.Internal.Documents; using MS.Utility; using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Reflection; using System.Security.Permissions; using System.Windows.Controls.Primitives; using System.Windows.Documents; using System.Windows.Media; using System.Windows.Shapes; using System.Windows.Markup; [assembly: XmlnsDefinition( "http://schemas.microsoft.com/xps/2005/06/documentstructure", "System.Windows.Documents.DocumentStructures")] namespace System.Windows.Documents.DocumentStructures { ////// /// public class SemanticBasicElement : BlockElement { ////// /// internal SemanticBasicElement() { _elementList = new List(); } internal List BlockElementList { get { return _elementList; } } /// /// /// internal List_elementList; } /// /// /// public class SectionStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public SectionStructure() { _elementType = FixedElement.ElementType.Section; } public void Add(BlockElement element) { if (element == null) { throw new ArgumentNullException("element"); } ((IAddChild) this).AddChild(element); } void IAddChild.AddChild(object value) { if (value is ParagraphStructure || value is FigureStructure || value is ListStructure || value is TableStructure ) { _elementList.Add((BlockElement)value); return; } throw new ArgumentException(SR.Get(SRID.DocumentStructureUnexpectedParameterType4, value.GetType(), typeof(ParagraphStructure), typeof(FigureStructure), typeof(ListStructure), typeof(TableStructure)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } } /// /// /// public class ParagraphStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public ParagraphStructure() { _elementType = FixedElement.ElementType.Paragraph; } public void Add(NamedElement element) { if (element == null) { throw new ArgumentNullException("element"); } ((IAddChild) this).AddChild(element); } void IAddChild.AddChild(object value) { if (value is NamedElement) { _elementList.Add((BlockElement)value); return; } throw new ArgumentException(SR.Get(SRID.DocumentStructureUnexpectedParameterType1, value.GetType(), typeof(NamedElement)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } } /// /// /// public class FigureStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public FigureStructure() { _elementType = FixedElement.ElementType.Figure; } void IAddChild.AddChild(object value) { if (value is NamedElement) { _elementList.Add((BlockElement)value); return; } throw new ArgumentException(SR.Get(SRID.UnexpectedParameterType, value.GetType(), typeof(NamedElement)), "value"); } void IAddChild.AddText(string text) { } public void Add(NamedElement element) { if (element == null) { throw new ArgumentNullException("element"); } ((IAddChild) this).AddChild(element); } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } } /// /// /// public class ListStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public ListStructure() { _elementType = FixedElement.ElementType.List; } public void Add(ListItemStructure listItem) { if (listItem == null) { throw new ArgumentNullException("listItem"); } ((IAddChild) this).AddChild(listItem); } void IAddChild.AddChild(object value) { if (value is ListItemStructure) { _elementList.Add((ListItemStructure)value); return; } throw new ArgumentException(SR.Get(SRID.UnexpectedParameterType, value.GetType(), typeof(ListItemStructure)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } } /// /// /// public class ListItemStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public ListItemStructure() { _elementType = FixedElement.ElementType.ListItem; } public void Add(BlockElement element) { if (element == null) { throw new ArgumentNullException("element"); } ((IAddChild) this).AddChild(element); } void IAddChild.AddChild(object value) { if (value is ParagraphStructure || value is TableStructure || value is ListStructure || value is FigureStructure) { _elementList.Add((BlockElement)value); return; } throw new ArgumentException(SR.Get(SRID.DocumentStructureUnexpectedParameterType4, value.GetType(), typeof(ParagraphStructure), typeof(TableStructure), typeof(ListStructure), typeof(FigureStructure)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } /// /// /// public String Marker { get { return _markerName; } set { _markerName = value; } } private String _markerName; } ////// /// public class TableStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public TableStructure() { _elementType = FixedElement.ElementType.Table; } public void Add(TableRowGroupStructure tableRowGroup) { if (tableRowGroup == null) { throw new ArgumentNullException("tableRowGroup"); } ((IAddChild) this).AddChild(tableRowGroup); } void IAddChild.AddChild(object value) { if (value is TableRowGroupStructure) { _elementList.Add((TableRowGroupStructure)value); return; } throw new ArgumentException(SR.Get(SRID.UnexpectedParameterType, value.GetType(), typeof(TableRowGroupStructure)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } } /// /// /// public class TableRowGroupStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public TableRowGroupStructure() { _elementType = FixedElement.ElementType.TableRowGroup; } public void Add(TableRowStructure tableRow) { if (tableRow == null) { throw new ArgumentNullException("tableRow"); } ((IAddChild) this).AddChild(tableRow); } void IAddChild.AddChild(object value) { if (value is TableRowStructure) { _elementList.Add((TableRowStructure)value); return; } throw new ArgumentException(SR.Get(SRID.UnexpectedParameterType, value.GetType(), typeof(TableRowStructure)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } } /// /// /// public class TableRowStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public TableRowStructure() { _elementType = FixedElement.ElementType.TableRow; } public void Add(TableCellStructure tableCell) { if (tableCell == null) { throw new ArgumentNullException("tableCell"); } ((IAddChild) this).AddChild(tableCell); } void IAddChild.AddChild(object value) { if (value is TableCellStructure) { _elementList.Add((TableCellStructure)value); return; } throw new ArgumentException(SR.Get(SRID.UnexpectedParameterType, value.GetType(), typeof(TableCellStructure)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } } /// /// /// public class TableCellStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public TableCellStructure() { _elementType = FixedElement.ElementType.TableCell; _rowSpan = 1; _columnSpan = 1; } public void Add(BlockElement element) { if (element == null) { throw new ArgumentNullException("element"); } ((IAddChild) this).AddChild(element); } void IAddChild.AddChild(object value) { if (value is ParagraphStructure || value is TableStructure || value is ListStructure || value is FigureStructure) { _elementList.Add((BlockElement)value); return; } throw new ArgumentException(SR.Get(SRID.DocumentStructureUnexpectedParameterType4, value.GetType(), typeof(ParagraphStructure), typeof(TableStructure), typeof(ListStructure), typeof(FigureStructure)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } /// /// /// public int RowSpan { get { return _rowSpan; } set {_rowSpan = value; } } ////// /// public int ColumnSpan { get { return _columnSpan; } set {_columnSpan = value; } } private int _rowSpan; private int _columnSpan; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // History: // 05/12/2005 : mingliu - created. // // //--------------------------------------------------------------------------- using MS.Internal.Documents; using MS.Utility; using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Reflection; using System.Security.Permissions; using System.Windows.Controls.Primitives; using System.Windows.Documents; using System.Windows.Media; using System.Windows.Shapes; using System.Windows.Markup; [assembly: XmlnsDefinition( "http://schemas.microsoft.com/xps/2005/06/documentstructure", "System.Windows.Documents.DocumentStructures")] namespace System.Windows.Documents.DocumentStructures { ////// /// public class SemanticBasicElement : BlockElement { ////// /// internal SemanticBasicElement() { _elementList = new List(); } internal List BlockElementList { get { return _elementList; } } /// /// /// internal List_elementList; } /// /// /// public class SectionStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public SectionStructure() { _elementType = FixedElement.ElementType.Section; } public void Add(BlockElement element) { if (element == null) { throw new ArgumentNullException("element"); } ((IAddChild) this).AddChild(element); } void IAddChild.AddChild(object value) { if (value is ParagraphStructure || value is FigureStructure || value is ListStructure || value is TableStructure ) { _elementList.Add((BlockElement)value); return; } throw new ArgumentException(SR.Get(SRID.DocumentStructureUnexpectedParameterType4, value.GetType(), typeof(ParagraphStructure), typeof(FigureStructure), typeof(ListStructure), typeof(TableStructure)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } } /// /// /// public class ParagraphStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public ParagraphStructure() { _elementType = FixedElement.ElementType.Paragraph; } public void Add(NamedElement element) { if (element == null) { throw new ArgumentNullException("element"); } ((IAddChild) this).AddChild(element); } void IAddChild.AddChild(object value) { if (value is NamedElement) { _elementList.Add((BlockElement)value); return; } throw new ArgumentException(SR.Get(SRID.DocumentStructureUnexpectedParameterType1, value.GetType(), typeof(NamedElement)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } } /// /// /// public class FigureStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public FigureStructure() { _elementType = FixedElement.ElementType.Figure; } void IAddChild.AddChild(object value) { if (value is NamedElement) { _elementList.Add((BlockElement)value); return; } throw new ArgumentException(SR.Get(SRID.UnexpectedParameterType, value.GetType(), typeof(NamedElement)), "value"); } void IAddChild.AddText(string text) { } public void Add(NamedElement element) { if (element == null) { throw new ArgumentNullException("element"); } ((IAddChild) this).AddChild(element); } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } } /// /// /// public class ListStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public ListStructure() { _elementType = FixedElement.ElementType.List; } public void Add(ListItemStructure listItem) { if (listItem == null) { throw new ArgumentNullException("listItem"); } ((IAddChild) this).AddChild(listItem); } void IAddChild.AddChild(object value) { if (value is ListItemStructure) { _elementList.Add((ListItemStructure)value); return; } throw new ArgumentException(SR.Get(SRID.UnexpectedParameterType, value.GetType(), typeof(ListItemStructure)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } } /// /// /// public class ListItemStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public ListItemStructure() { _elementType = FixedElement.ElementType.ListItem; } public void Add(BlockElement element) { if (element == null) { throw new ArgumentNullException("element"); } ((IAddChild) this).AddChild(element); } void IAddChild.AddChild(object value) { if (value is ParagraphStructure || value is TableStructure || value is ListStructure || value is FigureStructure) { _elementList.Add((BlockElement)value); return; } throw new ArgumentException(SR.Get(SRID.DocumentStructureUnexpectedParameterType4, value.GetType(), typeof(ParagraphStructure), typeof(TableStructure), typeof(ListStructure), typeof(FigureStructure)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } /// /// /// public String Marker { get { return _markerName; } set { _markerName = value; } } private String _markerName; } ////// /// public class TableStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public TableStructure() { _elementType = FixedElement.ElementType.Table; } public void Add(TableRowGroupStructure tableRowGroup) { if (tableRowGroup == null) { throw new ArgumentNullException("tableRowGroup"); } ((IAddChild) this).AddChild(tableRowGroup); } void IAddChild.AddChild(object value) { if (value is TableRowGroupStructure) { _elementList.Add((TableRowGroupStructure)value); return; } throw new ArgumentException(SR.Get(SRID.UnexpectedParameterType, value.GetType(), typeof(TableRowGroupStructure)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } } /// /// /// public class TableRowGroupStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public TableRowGroupStructure() { _elementType = FixedElement.ElementType.TableRowGroup; } public void Add(TableRowStructure tableRow) { if (tableRow == null) { throw new ArgumentNullException("tableRow"); } ((IAddChild) this).AddChild(tableRow); } void IAddChild.AddChild(object value) { if (value is TableRowStructure) { _elementList.Add((TableRowStructure)value); return; } throw new ArgumentException(SR.Get(SRID.UnexpectedParameterType, value.GetType(), typeof(TableRowStructure)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } } /// /// /// public class TableRowStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public TableRowStructure() { _elementType = FixedElement.ElementType.TableRow; } public void Add(TableCellStructure tableCell) { if (tableCell == null) { throw new ArgumentNullException("tableCell"); } ((IAddChild) this).AddChild(tableCell); } void IAddChild.AddChild(object value) { if (value is TableCellStructure) { _elementList.Add((TableCellStructure)value); return; } throw new ArgumentException(SR.Get(SRID.UnexpectedParameterType, value.GetType(), typeof(TableCellStructure)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } } /// /// /// public class TableCellStructure : SemanticBasicElement, IAddChild, IEnumerable, IEnumerable { /// /// /// public TableCellStructure() { _elementType = FixedElement.ElementType.TableCell; _rowSpan = 1; _columnSpan = 1; } public void Add(BlockElement element) { if (element == null) { throw new ArgumentNullException("element"); } ((IAddChild) this).AddChild(element); } void IAddChild.AddChild(object value) { if (value is ParagraphStructure || value is TableStructure || value is ListStructure || value is FigureStructure) { _elementList.Add((BlockElement)value); return; } throw new ArgumentException(SR.Get(SRID.DocumentStructureUnexpectedParameterType4, value.GetType(), typeof(ParagraphStructure), typeof(TableStructure), typeof(ListStructure), typeof(FigureStructure)), "value"); } void IAddChild.AddText(string text) { } IEnumeratorIEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } /// /// /// public int RowSpan { get { return _rowSpan; } set {_rowSpan = value; } } ////// /// public int ColumnSpan { get { return _columnSpan; } set {_columnSpan = value; } } private int _rowSpan; private int _columnSpan; } } // 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
- OracleBFile.cs
- IdentifierService.cs
- XamlFigureLengthSerializer.cs
- DocumentPage.cs
- DocumentPageViewAutomationPeer.cs
- TreeNodeClickEventArgs.cs
- SystemTcpConnection.cs
- SchemaImporter.cs
- FusionWrap.cs
- IItemProperties.cs
- PenContexts.cs
- KeyedCollection.cs
- HashCodeCombiner.cs
- CachedBitmap.cs
- diagnosticsswitches.cs
- Pair.cs
- WebBrowserNavigatedEventHandler.cs
- DateTimeHelper.cs
- SharedDp.cs
- MouseOverProperty.cs
- AbstractSvcMapFileLoader.cs
- ParameterReplacerVisitor.cs
- MetaDataInfo.cs
- RouteCollection.cs
- DrawingCollection.cs
- IDispatchConstantAttribute.cs
- FlowLayoutSettings.cs
- BaseDataBoundControlDesigner.cs
- XPathCompileException.cs
- FlowLayoutPanel.cs
- Internal.cs
- Margins.cs
- BlockCollection.cs
- TableRow.cs
- MessageSecurityTokenVersion.cs
- ListView.cs
- LiteralText.cs
- StrongNameKeyPair.cs
- WebConfigurationFileMap.cs
- Storyboard.cs
- MdbDataFileEditor.cs
- SoapFault.cs
- OleDbPropertySetGuid.cs
- SessionSwitchEventArgs.cs
- RemoteCryptoTokenProvider.cs
- Event.cs
- WebPartActionVerb.cs
- EditorAttributeInfo.cs
- BitmapMetadata.cs
- XamlBrushSerializer.cs
- RSAPKCS1SignatureDeformatter.cs
- BoolExpression.cs
- DefaultAssemblyResolver.cs
- TemplatePartAttribute.cs
- ReadOnlyCollection.cs
- Control.cs
- SerializerWriterEventHandlers.cs
- DBPropSet.cs
- PropertyManager.cs
- EventLogEntry.cs
- ManipulationInertiaStartingEventArgs.cs
- ContentValidator.cs
- AttributeCollection.cs
- RemoteDebugger.cs
- SetStateEventArgs.cs
- CustomCredentialPolicy.cs
- RestHandlerFactory.cs
- EditorZoneAutoFormat.cs
- RequestContext.cs
- DynamicDocumentPaginator.cs
- DefaultValueAttribute.cs
- Point.cs
- PageThemeCodeDomTreeGenerator.cs
- IpcServerChannel.cs
- SocketCache.cs
- RelatedEnd.cs
- ScriptBehaviorDescriptor.cs
- HwndSubclass.cs
- ListViewSelectEventArgs.cs
- __FastResourceComparer.cs
- HtmlTable.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- XPathAncestorQuery.cs
- MemberAccessException.cs
- UrlMappingCollection.cs
- FederatedMessageSecurityOverHttpElement.cs
- HttpStreams.cs
- StagingAreaInputItem.cs
- GetPageNumberCompletedEventArgs.cs
- StylusCaptureWithinProperty.cs
- BinaryMessageEncoder.cs
- BinarySerializer.cs
- SiteMapPath.cs
- BrushConverter.cs
- ExplicitDiscriminatorMap.cs
- QilReference.cs
- DataBindingExpressionBuilder.cs
- PointCollectionValueSerializer.cs
- UnsignedPublishLicense.cs
- ContentHostHelper.cs