Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- PersistenceTypeAttribute.cs
- AnchoredBlock.cs
- SecUtil.cs
- EntitySqlQueryCacheEntry.cs
- RegistrationServices.cs
- BuildProviderCollection.cs
- WsdlInspector.cs
- ResourcePool.cs
- InternalDispatchObject.cs
- PrePrepareMethodAttribute.cs
- _SpnDictionary.cs
- DataGridLinkButton.cs
- SessionStateUtil.cs
- ActionFrame.cs
- DataSource.cs
- XamlBrushSerializer.cs
- MessageSecurityOverMsmqElement.cs
- FileDataSourceCache.cs
- TextTreeTextBlock.cs
- _FixedSizeReader.cs
- HttpClientProtocol.cs
- CardSpaceShim.cs
- Tablet.cs
- DllNotFoundException.cs
- MetabaseSettingsIis7.cs
- XmlNamespaceMapping.cs
- ActivityTypeDesigner.xaml.cs
- DataListItemEventArgs.cs
- ProfilePropertyNameValidator.cs
- AnimationClockResource.cs
- Convert.cs
- RootBrowserWindowProxy.cs
- CommonXSendMessage.cs
- PropertyOverridesDialog.cs
- DependentList.cs
- FixedSOMFixedBlock.cs
- SerializationEventsCache.cs
- CompiledIdentityConstraint.cs
- SystemSounds.cs
- DateTimeConverter2.cs
- Renderer.cs
- Image.cs
- GcSettings.cs
- MultiPageTextView.cs
- ElasticEase.cs
- DateTimePicker.cs
- MenuAutomationPeer.cs
- StateInitializationDesigner.cs
- SqlBulkCopyColumnMapping.cs
- VariableQuery.cs
- IntegerCollectionEditor.cs
- ReadOnlyCollection.cs
- SR.cs
- ContractMapping.cs
- PriorityQueue.cs
- ScriptResourceAttribute.cs
- MetadataLocation.cs
- DataRecordInternal.cs
- DataConnectionHelper.cs
- Stackframe.cs
- LookupNode.cs
- ReflectionHelper.cs
- SystemParameters.cs
- RegisteredDisposeScript.cs
- FixedPageAutomationPeer.cs
- _AuthenticationState.cs
- SocketException.cs
- FlagsAttribute.cs
- SqlConnectionPoolProviderInfo.cs
- SmiEventSink.cs
- PersistChildrenAttribute.cs
- ConfigXmlReader.cs
- Grid.cs
- CompilerError.cs
- NumericUpDown.cs
- FacetDescriptionElement.cs
- ObservableCollection.cs
- DateTimeFormatInfo.cs
- NotSupportedException.cs
- EventWaitHandle.cs
- Vector3D.cs
- SoapTypeAttribute.cs
- EntityParameterCollection.cs
- ValueSerializer.cs
- ADMembershipUser.cs
- SqlBulkCopyColumnMappingCollection.cs
- GridToolTip.cs
- AspProxy.cs
- EncoderNLS.cs
- SecurityKeyIdentifierClause.cs
- InputLanguageManager.cs
- NameValueSectionHandler.cs
- ElementsClipboardData.cs
- SqlUserDefinedTypeAttribute.cs
- MessageQueuePermissionAttribute.cs
- DbConnectionClosed.cs
- Attribute.cs
- TextEditorSpelling.cs
- CriticalFinalizerObject.cs
- StringToken.cs