Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / DocumentStructures / StoryFragments.cs / 1305600 / StoryFragments.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 { ////// /// [ContentProperty("StoryFragmentList")] public class StoryFragments : IAddChild, IEnumerable, IEnumerable { /// /// /// public StoryFragments() { _elementList = new List(); } public void Add(StoryFragment storyFragment) { if (storyFragment == null) { throw new ArgumentNullException("storyFragment"); } ((IAddChild) this).AddChild(storyFragment); } void IAddChild.AddChild(object value) { // // Only the StoryFragment type are accepted. // if (value is StoryFragment) { _elementList.Add( (StoryFragment) value); return; } throw new ArgumentException(SR.Get(SRID.UnexpectedParameterType, value.GetType(), typeof(StoryFragment)), "value"); } void IAddChild.AddText(string text) { } IEnumerator IEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } internal List StoryFragmentList { get { return _elementList; } } private List _elementList; } /// /// /// [ContentProperty("BlockElementList")] public class StoryFragment : IAddChild, IEnumerable, IEnumerable { /// /// /// public StoryFragment() { _elementList = new List(); } public void Add(BlockElement element) { if (element == null) { throw new ArgumentNullException("element"); } ((IAddChild) this).AddChild(element); } void IAddChild.AddChild(object value) { // // Only the following type are accepted. // Section|Paragraph|Inline(Bold|Italic|Underline)|Floater|Figure|List // |Table|StoryBreak // if (value is SectionStructure || value is ParagraphStructure || value is FigureStructure || value is ListStructure || value is TableStructure || value is StoryBreak) { _elementList.Add( (BlockElement) value); return; } throw new ArgumentException(SR.Get(SRID.DocumentStructureUnexpectedParameterType6, value.GetType(), typeof(SectionStructure), typeof(ParagraphStructure), typeof(FigureStructure), typeof(ListStructure), typeof(TableStructure), typeof(StoryBreak)), "value"); } void IAddChild.AddText(string text) { } IEnumerator IEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } /// /// The element name /// public string StoryName { get { return _storyName; } set { _storyName = value; } } ////// The element name /// public string FragmentName { get { return _fragmentName; } set { _fragmentName = value; } } ////// The element name /// public String FragmentType { get { return _fragmentType; } set { _fragmentType = value; } } internal ListBlockElementList { get { return _elementList; } } private List _elementList; private String _storyName; private String _fragmentName; private String _fragmentType; } } // 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 { ////// /// [ContentProperty("StoryFragmentList")] public class StoryFragments : IAddChild, IEnumerable, IEnumerable { /// /// /// public StoryFragments() { _elementList = new List(); } public void Add(StoryFragment storyFragment) { if (storyFragment == null) { throw new ArgumentNullException("storyFragment"); } ((IAddChild) this).AddChild(storyFragment); } void IAddChild.AddChild(object value) { // // Only the StoryFragment type are accepted. // if (value is StoryFragment) { _elementList.Add( (StoryFragment) value); return; } throw new ArgumentException(SR.Get(SRID.UnexpectedParameterType, value.GetType(), typeof(StoryFragment)), "value"); } void IAddChild.AddText(string text) { } IEnumerator IEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } internal List StoryFragmentList { get { return _elementList; } } private List _elementList; } /// /// /// [ContentProperty("BlockElementList")] public class StoryFragment : IAddChild, IEnumerable, IEnumerable { /// /// /// public StoryFragment() { _elementList = new List(); } public void Add(BlockElement element) { if (element == null) { throw new ArgumentNullException("element"); } ((IAddChild) this).AddChild(element); } void IAddChild.AddChild(object value) { // // Only the following type are accepted. // Section|Paragraph|Inline(Bold|Italic|Underline)|Floater|Figure|List // |Table|StoryBreak // if (value is SectionStructure || value is ParagraphStructure || value is FigureStructure || value is ListStructure || value is TableStructure || value is StoryBreak) { _elementList.Add( (BlockElement) value); return; } throw new ArgumentException(SR.Get(SRID.DocumentStructureUnexpectedParameterType6, value.GetType(), typeof(SectionStructure), typeof(ParagraphStructure), typeof(FigureStructure), typeof(ListStructure), typeof(TableStructure), typeof(StoryBreak)), "value"); } void IAddChild.AddText(string text) { } IEnumerator IEnumerable .GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable )this).GetEnumerator(); } /// /// The element name /// public string StoryName { get { return _storyName; } set { _storyName = value; } } ////// The element name /// public string FragmentName { get { return _fragmentName; } set { _fragmentName = value; } } ////// The element name /// public String FragmentType { get { return _fragmentType; } set { _fragmentType = value; } } internal ListBlockElementList { get { return _elementList; } } private List _elementList; private String _storyName; private String _fragmentName; private String _fragmentType; } } // 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
- SmtpNetworkElement.cs
- EventLogEntry.cs
- WebServiceData.cs
- CreateBookmarkScope.cs
- XmlNodeChangedEventArgs.cs
- Int32Rect.cs
- CharUnicodeInfo.cs
- XmlDataCollection.cs
- ProtocolElement.cs
- WebServiceData.cs
- BaseParser.cs
- odbcmetadatacolumnnames.cs
- login.cs
- ListControlBoundActionList.cs
- mactripleDES.cs
- XmlMembersMapping.cs
- RowSpanVector.cs
- Pointer.cs
- FilteredReadOnlyMetadataCollection.cs
- InertiaTranslationBehavior.cs
- PeerObject.cs
- Cursor.cs
- ResourceDefaultValueAttribute.cs
- HttpCapabilitiesSectionHandler.cs
- TreeView.cs
- CodeIndexerExpression.cs
- _HTTPDateParse.cs
- ScriptModule.cs
- GeneralTransform3D.cs
- Constraint.cs
- DataContractSet.cs
- CompoundFileStreamReference.cs
- TreeViewItem.cs
- CaseInsensitiveOrdinalStringComparer.cs
- URIFormatException.cs
- EntityDataSourceWizardForm.cs
- UrlMappingsModule.cs
- ServicePointManagerElement.cs
- MessageSmuggler.cs
- SqlNamer.cs
- User.cs
- SafeEventLogWriteHandle.cs
- CodeDomConfigurationHandler.cs
- Matrix.cs
- QilReplaceVisitor.cs
- StylusLogic.cs
- ExceptionUtil.cs
- ClientOptions.cs
- ConfigurationElementCollection.cs
- DataGridViewSelectedCellCollection.cs
- ContentOnlyMessage.cs
- ContentFilePart.cs
- ListItemParagraph.cs
- TreeViewHitTestInfo.cs
- ErrorFormatterPage.cs
- ConfigurationException.cs
- DurationConverter.cs
- IisTraceWebEventProvider.cs
- FormViewInsertedEventArgs.cs
- BuildManager.cs
- SrgsRuleRef.cs
- PipeStream.cs
- ColorBlend.cs
- ListViewUpdateEventArgs.cs
- MetadataItemSerializer.cs
- BounceEase.cs
- DateRangeEvent.cs
- PolyLineSegment.cs
- ThicknessAnimation.cs
- ArgIterator.cs
- followingquery.cs
- XamlTreeBuilderBamlRecordWriter.cs
- WebPartConnectionCollection.cs
- ListItemCollection.cs
- TableCellAutomationPeer.cs
- OrderPreservingPipeliningSpoolingTask.cs
- TrackingMemoryStream.cs
- RelationshipConstraintValidator.cs
- PropertyPath.cs
- WindowsRichEdit.cs
- BamlReader.cs
- HTMLTextWriter.cs
- DataSourceHelper.cs
- EventMappingSettings.cs
- Interlocked.cs
- EventArgs.cs
- IncrementalReadDecoders.cs
- SqlServer2KCompatibilityCheck.cs
- DecimalKeyFrameCollection.cs
- VectorAnimationBase.cs
- SqlTrackingQuery.cs
- Stack.cs
- SQLBoolean.cs
- EventRecord.cs
- MsmqReceiveParameters.cs
- NullEntityWrapper.cs
- StorageFunctionMapping.cs
- TextDecorationUnitValidation.cs
- UndoManager.cs
- NamespaceCollection.cs