Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Print / Reach / Serialization / manager / ReachDocumentReferenceCollectionSerializer.cs / 1 / ReachDocumentReferenceCollectionSerializer.cs
/*++ Copyright (C) 2004- 2005 Microsoft Corporation All rights reserved. Module Name: ReachDocumentReferenceCollectionSerializer.cs Abstract: Author: [....] ([....]) January 2005 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 { ////// /// internal class ReachDocumentReferenceCollectionSerializer : ReachSerializer { ////// Creates new serializer for a DocumentReferenceCollection /// /// serialization manager for this seriaizer public ReachDocumentReferenceCollectionSerializer( PackageSerializationManager manager ): base(manager) { } ////// /// internal override void PersistObjectData( SerializableObjectContext serializableObjectContext ) { if (serializableObjectContext == null) { throw new ArgumentNullException("serializableObjectContext"); } // get DocumentReferenceCollection System.Collections.Generic.IEnumerableenumerableObject = serializableObjectContext.TargetObject as System.Collections.Generic.IEnumerable ; if (enumerableObject == null) { throw new XpsSerializationException(ReachSR.Get(ReachSRID.MustBeOfType, "serializableObjectContext.TargetObject", typeof(System.Collections.Generic.IEnumerable ))); } SerializeDocumentReferences(serializableObjectContext); } /// /// This is being called to serialize the DocumentReference items /// contained within the colleciton /// private void SerializeDocumentReferences( SerializableObjectContext serializableObjectContext ) { // // Serialize each DocumentReference in DocumentReferenceColleciton // foreach (object documentReference in (System.Collections.Generic.IEnumerable)serializableObjectContext.TargetObject) { if (documentReference != null) { // Serialize the current item SerializeDocumentReference(documentReference); } } } /// /// Called to serialize a single DocumentReference /// private void SerializeDocumentReference( object documentReference ) { ReachSerializer serializer = SerializationManager.GetSerializer(documentReference); if(serializer!=null) { serializer.SerializeObject(documentReference); } else { // should we throw if this is not a DocumentReference or just not do anything? throw new XpsSerializationException(ReachSR.Get(ReachSRID.ReachSerialization_NoSerializer)); } } }; } // 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
- RenderData.cs
- TypeBuilder.cs
- KeyedHashAlgorithm.cs
- ToolTipService.cs
- ToolStripDropDownButton.cs
- PromptStyle.cs
- StylusPointPropertyInfoDefaults.cs
- Convert.cs
- DebugView.cs
- InvalidCastException.cs
- CustomValidator.cs
- InvalidateEvent.cs
- TextRunTypographyProperties.cs
- BitmapEffectDrawing.cs
- SiteOfOriginPart.cs
- TouchFrameEventArgs.cs
- CommonXSendMessage.cs
- EdmComplexPropertyAttribute.cs
- HtmlContainerControl.cs
- ToolStripPanelRow.cs
- WriteFileContext.cs
- CollectionsUtil.cs
- DesignTimeXamlWriter.cs
- ACL.cs
- WorkflowRuntimeServiceElement.cs
- ScrollableControl.cs
- URLString.cs
- ImageMap.cs
- CursorConverter.cs
- IndexingContentUnit.cs
- SequenceNumber.cs
- CounterSampleCalculator.cs
- GetFileNameResult.cs
- SkewTransform.cs
- StrokeDescriptor.cs
- ModuleConfigurationInfo.cs
- CustomErrorCollection.cs
- SourceChangedEventArgs.cs
- XsdValidatingReader.cs
- ApplicationException.cs
- SettingsPropertyNotFoundException.cs
- NativeMethods.cs
- DetailsViewCommandEventArgs.cs
- CodeTypeConstructor.cs
- CannotUnloadAppDomainException.cs
- StringAnimationBase.cs
- ConfigXmlText.cs
- ToolBarButtonDesigner.cs
- AnimationClock.cs
- CompiledQueryCacheKey.cs
- XmlHierarchicalEnumerable.cs
- indexingfiltermarshaler.cs
- SafeNativeMethodsOther.cs
- SqlBulkCopy.cs
- Adorner.cs
- DbConnectionPoolGroupProviderInfo.cs
- WindowsStatusBar.cs
- ParentControlDesigner.cs
- DynamicDataManager.cs
- PropertyStore.cs
- PassportAuthenticationEventArgs.cs
- EventNotify.cs
- SqlConnectionPoolGroupProviderInfo.cs
- ToolboxCategory.cs
- NamedPipeTransportBindingElement.cs
- JpegBitmapDecoder.cs
- PerformanceCounterCategory.cs
- WebService.cs
- securitycriticaldataClass.cs
- FontWeights.cs
- DtrList.cs
- WsdlImporterElementCollection.cs
- ConnectionsZone.cs
- TextLineResult.cs
- SendAgentStatusRequest.cs
- ImageAnimator.cs
- WindowsListViewSubItem.cs
- InstanceDataCollectionCollection.cs
- ValidationRule.cs
- GraphicsPath.cs
- DocumentationServerProtocol.cs
- TreeViewImageKeyConverter.cs
- BaseResourcesBuildProvider.cs
- SystemFonts.cs
- ComponentDispatcher.cs
- FixedSOMSemanticBox.cs
- Pair.cs
- SelectedPathEditor.cs
- RegistryPermission.cs
- SoapExtensionTypeElementCollection.cs
- TagMapInfo.cs
- Rectangle.cs
- LogManagementAsyncResult.cs
- X509ThumbprintKeyIdentifierClause.cs
- URLMembershipCondition.cs
- EntityViewGenerationAttribute.cs
- SplitterEvent.cs
- RawKeyboardInputReport.cs
- AmbiguousMatchException.cs
- AxisAngleRotation3D.cs