Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataWeb / Server / System / Data / Services / Serializers / XmlDocumentSerializer.cs / 1 / 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 IDataServiceProvider 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, IDataServiceProvider 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 IDataServiceProvider 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.. internal abstract void WriteRequest(); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// 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 IDataServiceProvider 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, IDataServiceProvider 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 IDataServiceProvider 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.. internal abstract void WriteRequest(); } } // 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
- MexNamedPipeBindingElement.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- CodeIdentifier.cs
- SharedUtils.cs
- Utils.cs
- ScriptingWebServicesSectionGroup.cs
- basenumberconverter.cs
- TextContainer.cs
- UpdateExpressionVisitor.cs
- TextBoxBase.cs
- OdbcConnectionPoolProviderInfo.cs
- FullTextState.cs
- StrokeFIndices.cs
- CallbackException.cs
- Utility.cs
- columnmapkeybuilder.cs
- WebPartEditVerb.cs
- ToolStripDropDownClosingEventArgs.cs
- RuntimeConfig.cs
- SuppressMergeCheckAttribute.cs
- DXD.cs
- GroupItemAutomationPeer.cs
- PersonalizationState.cs
- AnnotationResourceChangedEventArgs.cs
- ListViewGroupItemCollection.cs
- BooleanStorage.cs
- WithStatement.cs
- CollectionsUtil.cs
- DBSqlParserColumnCollection.cs
- WebPartVerbsEventArgs.cs
- WebPartAddingEventArgs.cs
- EventArgs.cs
- DataServiceQuery.cs
- Label.cs
- ExpandCollapseProviderWrapper.cs
- Deserializer.cs
- ClientConfigurationHost.cs
- ObfuscationAttribute.cs
- KeyboardNavigation.cs
- OperatorExpressions.cs
- Popup.cs
- DataObjectEventArgs.cs
- CardSpaceShim.cs
- XmlSerializationGeneratedCode.cs
- DataRelationPropertyDescriptor.cs
- ConnectionPointGlyph.cs
- TrustLevel.cs
- ObjectView.cs
- CaseInsensitiveOrdinalStringComparer.cs
- FragmentQueryProcessor.cs
- bindurihelper.cs
- ReadOnlyPropertyMetadata.cs
- DSACryptoServiceProvider.cs
- TableItemPatternIdentifiers.cs
- SharedDp.cs
- XamlSerializationHelper.cs
- DataGridViewLayoutData.cs
- DataObjectMethodAttribute.cs
- ClientSettingsStore.cs
- XDeferredAxisSource.cs
- FactoryGenerator.cs
- shaperfactoryquerycachekey.cs
- _BasicClient.cs
- QualifiedCellIdBoolean.cs
- EdmItemError.cs
- SecurityElementBase.cs
- DefaultValueTypeConverter.cs
- WorkflowItemsPresenter.cs
- XmlEnumAttribute.cs
- ButtonRenderer.cs
- ViewStateModeByIdAttribute.cs
- SerializationException.cs
- RequestCachingSection.cs
- ErrorRuntimeConfig.cs
- BevelBitmapEffect.cs
- FeatureSupport.cs
- NegationPusher.cs
- TextHidden.cs
- ClientApiGenerator.cs
- Rect.cs
- XPathArrayIterator.cs
- VectorKeyFrameCollection.cs
- IResourceProvider.cs
- Scheduling.cs
- SapiRecoInterop.cs
- SharedUtils.cs
- IgnorePropertiesAttribute.cs
- AutomationElementCollection.cs
- StructuredProperty.cs
- CaretElement.cs
- Expression.cs
- IndexingContentUnit.cs
- AutomationPropertyInfo.cs
- QueryResponse.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- ObjectToIdCache.cs
- RichTextBox.cs
- GradientStop.cs
- DataServiceQueryOfT.cs
- ThrowHelper.cs