Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Print / Reach / Serialization / manager / ReachUIElementCollectionSerializer.cs / 1 / ReachUIElementCollectionSerializer.cs
/*++ Copyright (C) 2004- 2005 Microsoft Corporation All rights reserved. Module Name: ReachUIElementCollectionSerializer.cs Abstract: This file contains the definition of a class that defines the common functionality required to serialize a UIElementCollection 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 UIElementCollection. /// internal class ReachUIElementCollectionSerializer : ReachSerializer { #region Constructor ////// Constructor for class ReachUIElementCollectionSerializer /// /// /// The serialization manager, the services of which are /// used later in the serialization process of the type. /// public ReachUIElementCollectionSerializer( PackageSerializationManager manager ): base(manager) { } #endregion Constructor #region Public Methods ////// The main method that is called to serialize a UIElementCollection. /// /// /// Instance of object to be serialized. /// public override void SerializeObject( Object serializedObject ) { base.SerializeObject(serializedObject); } #endregion Public Methods #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 // SerializeUIElements(serializableObjectContext); } #endregion Internal Methods #region Private Methods ////// This is being called to serialize the Page Content items /// contained within the collection /// private void SerializeUIElements( SerializableObjectContext serializableObjectContext ) { // // Serialize each PageContent in PageContentCollection // foreach (object uiElement in (IEnumerable)serializableObjectContext.TargetObject) { if (uiElement != null) { // // Serialize the current ui element // SerializeUIElement(uiElement); } } } ////// Called to serialize a single UIElement /// private void SerializeUIElement( object uiElement ) { Visual visual = uiElement as Visual; if(visual != null) { ReachSerializer serializer = SerializationManager.GetSerializer(visual); if(serializer!=null) { serializer.SerializeObject(visual); } else { throw new XpsSerializationException(ReachSR.Get(ReachSRID.ReachSerialization_NoSerializer)); } } } #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
- BaseTemplateParser.cs
- _UriTypeConverter.cs
- GlobalProxySelection.cs
- AccessDataSource.cs
- XPathAncestorQuery.cs
- WebDisplayNameAttribute.cs
- WebPartHeaderCloseVerb.cs
- Debug.cs
- NamedElement.cs
- KeyBinding.cs
- EmptyControlCollection.cs
- LocalizabilityAttribute.cs
- DebugView.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- VisualBasicSettingsHandler.cs
- SliderAutomationPeer.cs
- UndirectedGraph.cs
- UnicastIPAddressInformationCollection.cs
- PropertyMetadata.cs
- ToolZone.cs
- DelegateSerializationHolder.cs
- SessionIDManager.cs
- UnrecognizedPolicyAssertionElement.cs
- NetTcpBinding.cs
- TreeViewImageIndexConverter.cs
- StringFunctions.cs
- XmlSchemaComplexType.cs
- DockProviderWrapper.cs
- Win32Native.cs
- MinMaxParagraphWidth.cs
- TrackingLocationCollection.cs
- DataControlReferenceCollection.cs
- DataRow.cs
- UTF8Encoding.cs
- SimpleBitVector32.cs
- DeviceSpecificDesigner.cs
- MenuItemBinding.cs
- EntitySetBaseCollection.cs
- MdiWindowListItemConverter.cs
- ReachFixedDocumentSerializerAsync.cs
- MULTI_QI.cs
- SpotLight.cs
- ResourceCollectionInfo.cs
- JavaScriptObjectDeserializer.cs
- LabelEditEvent.cs
- RuleSettingsCollection.cs
- CorePropertiesFilter.cs
- TrackingProfileCache.cs
- XmlDictionaryReaderQuotas.cs
- BoundField.cs
- PeerPresenceInfo.cs
- ReferencedType.cs
- QilPatternFactory.cs
- XmlSchemaAnnotation.cs
- ReliableOutputSessionChannel.cs
- OwnerDrawPropertyBag.cs
- ImageFormat.cs
- NameNode.cs
- WindowsListViewGroupSubsetLink.cs
- UnsafeNativeMethods.cs
- DigitShape.cs
- UserControl.cs
- SequentialOutput.cs
- MSG.cs
- ActiveXSite.cs
- TabPage.cs
- CodeArrayCreateExpression.cs
- Int16AnimationBase.cs
- SourceFileBuildProvider.cs
- ProgressBarHighlightConverter.cs
- XPathException.cs
- PersonalizationProvider.cs
- ReadWriteSpinLock.cs
- ProgressPage.cs
- HttpCookieCollection.cs
- OperationContractGenerationContext.cs
- httpserverutility.cs
- ManagementException.cs
- XmlJsonWriter.cs
- CodeNamespaceImport.cs
- FtpWebRequest.cs
- PipeStream.cs
- _HelperAsyncResults.cs
- TreeViewCancelEvent.cs
- HitTestWithPointDrawingContextWalker.cs
- TypeRestriction.cs
- IdentityModelDictionary.cs
- ProxyHelper.cs
- PanelStyle.cs
- HttpListenerContext.cs
- SqlRowUpdatedEvent.cs
- RootBrowserWindowAutomationPeer.cs
- PaperSource.cs
- GorillaCodec.cs
- HtmlShim.cs
- XmlILCommand.cs
- InstancePersistence.cs
- HtmlObjectListAdapter.cs
- LogRecordSequence.cs
- SingleConverter.cs