Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Print / Reach / Serialization / manager / ReachPageContentCollectionSerializer.cs / 2 / ReachPageContentCollectionSerializer.cs
/*++ Copyright (C) 2004- 2005 Microsoft Corporation All rights reserved. Module Name: ReachPageContentCollectionSerializer.cs Abstract: This file contains the definition of a class that defines the common functionality required to serialize a PageContentCollection Author: [....] ([....]) 1-December-2004 Revision History: --*/ using System; using System.Collections; using System.Collections.Specialized; using System.ComponentModel; using System.Diagnostics; using System.Reflection; using System.Xml; using System.IO; using System.Security; using System.Security.Permissions; using System.ComponentModel.Design.Serialization; using System.Windows.Xps.Packaging; using System.Windows.Documents; using System.Windows.Media; using System.Windows.Markup; namespace System.Windows.Xps.Serialization { ////// Class defining common functionality required to /// serialize a PageContentCollectionSerializer. /// internal class ReachPageContentCollectionSerializer : ReachSerializer { #region Constructor ////// Constructor for class ReachPageContentCollectionSerializer /// /// /// The serialization manager, the services of which are /// used later in the serialization process of the type. /// public ReachPageContentCollectionSerializer( PackageSerializationManager manager ): base(manager) { } #endregion Constructor #region Internal Methods ////// The method is called once the object data is discovered at that /// point of the serialization process. /// /// /// The context of the object to be serialized at this time. /// internal override void PersistObjectData( SerializableObjectContext serializableObjectContext ) { if (serializableObjectContext == null) { throw new ArgumentNullException("serializableObjectContext"); } IEnumerable enumerableObject = serializableObjectContext.TargetObject as IEnumerable; if (enumerableObject == null) { throw new XpsSerializationException(ReachSR.Get(ReachSRID.MustBeOfType, "serializableObjectContext.TargetObject", typeof(IEnumerable))); } // // Serialize the PageContent Items contained within the collection // SerializePageContents(serializableObjectContext); } #endregion Internal Methods #region Private Methods ////// This is being called to serialize the Page Content items /// contained within the collection /// /// /// The context of the object to be serialized at this time. /// private void SerializePageContents( SerializableObjectContext serializableObjectContext ) { // // Serialize each PageContent in PageContentColleciton // foreach (object pageContent in (IEnumerable)serializableObjectContext.TargetObject) { if (pageContent != null) { // Serialize the current item SerializePageContent(pageContent); } } } ////// Called to serialize a single PageContent /// /// /// The PageContent to be serialized. /// private void SerializePageContent( object pageContent ) { Toolbox.StartEvent(MS.Utility.EventTraceGuidId.DRXSAVEPAGEGUID); ReachSerializer serializer = SerializationManager.GetSerializer(pageContent); if(serializer!=null) { serializer.SerializeObject(pageContent); } else { throw new XpsSerializationException(ReachSR.Get(ReachSRID.ReachSerialization_NoSerializer)); } Toolbox.EndEvent(MS.Utility.EventTraceGuidId.DRXSAVEPAGEGUID); } #endregion Private Methods }; } // 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
- TabControlCancelEvent.cs
- EdmEntityTypeAttribute.cs
- OneToOneMappingSerializer.cs
- DependencyPropertyAttribute.cs
- URLAttribute.cs
- DataServiceClientException.cs
- Models.cs
- PersonalizationStateInfo.cs
- BufferAllocator.cs
- Point3DCollectionValueSerializer.cs
- SchemaTableColumn.cs
- Parser.cs
- SeekableReadStream.cs
- PeerServiceMessageContracts.cs
- FormattedTextSymbols.cs
- NavigatorInput.cs
- LeafCellTreeNode.cs
- HttpFileCollection.cs
- MdImport.cs
- unsafeIndexingFilterStream.cs
- OperationAbortedException.cs
- DotAtomReader.cs
- SignatureHelper.cs
- ListViewItem.cs
- ScrollBar.cs
- WsdlImporter.cs
- KeyValueSerializer.cs
- ParameterCollection.cs
- RegexCapture.cs
- CompareValidator.cs
- CustomErrorsSectionWrapper.cs
- AssemblyCache.cs
- SourceFileBuildProvider.cs
- ToolStripDropTargetManager.cs
- ConnectionsZone.cs
- DataObjectPastingEventArgs.cs
- EventHandlersStore.cs
- ScriptingProfileServiceSection.cs
- DataSourceControlBuilder.cs
- DbConnectionStringCommon.cs
- ReferenceTypeElement.cs
- XhtmlBasicPanelAdapter.cs
- Matrix3D.cs
- Vector3DAnimation.cs
- TraceContext.cs
- UnmanagedMarshal.cs
- TailCallAnalyzer.cs
- RefreshPropertiesAttribute.cs
- LockCookie.cs
- EntityTypeEmitter.cs
- AutomationElementIdentifiers.cs
- CodeIterationStatement.cs
- ItemCollection.cs
- DataMemberAttribute.cs
- CircleEase.cs
- TextChangedEventArgs.cs
- EntityDataSourceView.cs
- ProfileService.cs
- DataTemplateSelector.cs
- ProfilePropertyNameValidator.cs
- HtmlHead.cs
- COMException.cs
- ListBoxAutomationPeer.cs
- RangeContentEnumerator.cs
- OraclePermissionAttribute.cs
- StdValidatorsAndConverters.cs
- DataGridCellsPanel.cs
- PeerDefaultCustomResolverClient.cs
- TypedServiceChannelBuilder.cs
- PreviewPageInfo.cs
- NativeMethods.cs
- LineBreakRecord.cs
- Codec.cs
- BitmapEffect.cs
- PointLight.cs
- PeerNameRecordCollection.cs
- UpdateCompiler.cs
- TableAutomationPeer.cs
- TreeViewTemplateSelector.cs
- AtomServiceDocumentSerializer.cs
- ResourceExpressionEditorSheet.cs
- CompilerScopeManager.cs
- CryptoConfig.cs
- TableRowCollection.cs
- SqlNotificationRequest.cs
- MinimizableAttributeTypeConverter.cs
- DataBinder.cs
- ControlIdConverter.cs
- ExcCanonicalXml.cs
- StructuralType.cs
- DbException.cs
- ResourceBinder.cs
- BindToObject.cs
- odbcmetadatacolumnnames.cs
- WebRequest.cs
- SQLInt64Storage.cs
- GregorianCalendarHelper.cs
- HttpDictionary.cs
- CryptoApi.cs
- TrackingMemoryStreamFactory.cs