Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Server / System / Data / Services / Serializers / XmlDocumentSerializer.cs / 1305376 / XmlDocumentSerializer.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides a serializer for the Atom Service Document format. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services.Serializers { using System; using System.Data.Services.Providers; using System.Diagnostics; using System.IO; using System.Text; using System.Xml; ///Provides support for serializing generic XML documents. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable", Justification = "Pending review.")] [DebuggerDisplay("XmlDocumentSerializer={baseUri}")] internal abstract class XmlDocumentSerializer : IExceptionWriter { ///Base URI from which resources should be resolved. private readonly Uri baseUri; ///Data provider from which metadata should be gathered. private readonly DataServiceProviderWrapper provider; ///Writer to which output is sent. private readonly XmlWriter writer; ////// Initializes a new XmlDocumentSerializer, ready to write /// out an XML document /// /// Stream to which output should be sent. /// Base URI from which resources should be resolved. /// Data provider from which metadata should be gathered. /// Text encoding for the response. internal XmlDocumentSerializer( Stream output, Uri baseUri, DataServiceProviderWrapper provider, Encoding encoding) { Debug.Assert(output != null, "output != null"); Debug.Assert(provider != null, "provider != null"); Debug.Assert(baseUri != null, "baseUri != null"); Debug.Assert(encoding != null, "encoding != null"); Debug.Assert(baseUri.IsAbsoluteUri, "baseUri.IsAbsoluteUri(" + baseUri + ")"); Debug.Assert(baseUri.AbsoluteUri[baseUri.AbsoluteUri.Length - 1] == '/', "baseUri(" + baseUri.AbsoluteUri + ") ends with '/'"); this.writer = XmlUtil.CreateXmlWriterAndWriteProcessingInstruction(output, encoding); this.provider = provider; this.baseUri = baseUri; } ///Base URI from which resources should be resolved. protected Uri BaseUri { get { return this.baseUri; } } ///Data provider from which metadata should be gathered. protected DataServiceProviderWrapper Provider { get { return this.provider; } } ///Writer to which output is sent. protected XmlWriter Writer { get { return this.writer; } } ///Serializes exception information. /// Description of exception to serialize. public void WriteException(HandleExceptionArgs args) { ErrorHandler.SerializeXmlError(args, this.writer); } ///Writes the document for this request.. /// Data service instance. internal abstract void WriteRequest(IDataService service); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DocumentXPathNavigator.cs
- GeneralTransform3DGroup.cs
- DoubleLinkList.cs
- TextContainerChangeEventArgs.cs
- PasswordTextContainer.cs
- AddInAttribute.cs
- SqlStatistics.cs
- IsolatedStorageFile.cs
- EdmComplexPropertyAttribute.cs
- X509ServiceCertificateAuthenticationElement.cs
- SqlException.cs
- RuntimeComponentFilter.cs
- InternalConfigConfigurationFactory.cs
- VariableExpressionConverter.cs
- FormsAuthenticationUserCollection.cs
- IdentityReference.cs
- ProtectedConfiguration.cs
- StyleTypedPropertyAttribute.cs
- EventManager.cs
- TextClipboardData.cs
- ReservationCollection.cs
- CryptoProvider.cs
- SchemaNames.cs
- WpfKnownMemberInvoker.cs
- SplineKeyFrames.cs
- Byte.cs
- Style.cs
- wmiprovider.cs
- initElementDictionary.cs
- MessageQueuePermission.cs
- Message.cs
- SqlDataSourceQuery.cs
- ClickablePoint.cs
- CredentialSelector.cs
- PersonalizationAdministration.cs
- HandledMouseEvent.cs
- StylusButtonEventArgs.cs
- OracleInternalConnection.cs
- CodeParameterDeclarationExpressionCollection.cs
- ClientSettings.cs
- BooleanFunctions.cs
- SelectionChangedEventArgs.cs
- DataGridViewElement.cs
- SqlUserDefinedAggregateAttribute.cs
- PartManifestEntry.cs
- HScrollBar.cs
- ElementUtil.cs
- Win32.cs
- EmissiveMaterial.cs
- InlineObject.cs
- HttpConfigurationContext.cs
- Predicate.cs
- XmlArrayItemAttributes.cs
- TableItemStyle.cs
- WebResourceUtil.cs
- FirstQueryOperator.cs
- SchemaElementLookUpTable.cs
- KnownTypes.cs
- VectorKeyFrameCollection.cs
- XPathExpr.cs
- CodeIndexerExpression.cs
- Internal.cs
- Rect3DConverter.cs
- DataGridViewComboBoxCell.cs
- VersionPair.cs
- FrameworkContentElementAutomationPeer.cs
- LockedAssemblyCache.cs
- CodeTypeDeclaration.cs
- ExceptionTrace.cs
- ListCollectionView.cs
- ResXResourceWriter.cs
- ListParagraph.cs
- PaintEvent.cs
- PrefixHandle.cs
- TypeDescriptionProviderAttribute.cs
- CheckBoxBaseAdapter.cs
- FrameworkReadOnlyPropertyMetadata.cs
- SqlConnectionHelper.cs
- ThreadStaticAttribute.cs
- UInt16Storage.cs
- SystemNetHelpers.cs
- DateTime.cs
- Hex.cs
- TagPrefixInfo.cs
- WindowsListViewGroup.cs
- GcSettings.cs
- DocumentXPathNavigator.cs
- PlatformNotSupportedException.cs
- AnnotationResource.cs
- MbpInfo.cs
- ExtractorMetadata.cs
- TextEditorLists.cs
- DesignTimeData.cs
- File.cs
- DateTimeOffset.cs
- StreamingContext.cs
- LayoutExceptionEventArgs.cs
- AnimationException.cs
- Exceptions.cs
- Canvas.cs