Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- ListViewGroupCollectionEditor.cs
- DataGridViewImageCell.cs
- ConfigXmlWhitespace.cs
- EntityDataSourceValidationException.cs
- OneOfTypeConst.cs
- ToolStripKeyboardHandlingService.cs
- AutomationPropertyInfo.cs
- Positioning.cs
- ResourceIDHelper.cs
- ListViewCancelEventArgs.cs
- GenericAuthenticationEventArgs.cs
- JournalEntryStack.cs
- SQLDecimalStorage.cs
- ClientFactory.cs
- DataFormats.cs
- RecordsAffectedEventArgs.cs
- SecureStringHasher.cs
- DllNotFoundException.cs
- WebBrowserProgressChangedEventHandler.cs
- _ListenerRequestStream.cs
- SQLDecimalStorage.cs
- XmlIncludeAttribute.cs
- SafeFreeMibTable.cs
- Tracking.cs
- XPathAncestorIterator.cs
- SystemDropShadowChrome.cs
- Peer.cs
- Int32Animation.cs
- DataBindingHandlerAttribute.cs
- MenuItemCollectionEditorDialog.cs
- FunctionGenerator.cs
- SafeFindHandle.cs
- LifetimeMonitor.cs
- XmlSortKey.cs
- XmlTextReaderImplHelpers.cs
- httpserverutility.cs
- DrawToolTipEventArgs.cs
- ProviderCommandInfoUtils.cs
- AbstractDataSvcMapFileLoader.cs
- OutputCacheModule.cs
- MessageQueueInstaller.cs
- ExpressionValueEditor.cs
- InstalledVoice.cs
- MD5.cs
- DesignTimeTemplateParser.cs
- SettingsPropertyValue.cs
- _NegoState.cs
- SymbolEqualComparer.cs
- SerializationFieldInfo.cs
- SourceElementsCollection.cs
- WizardDesigner.cs
- WindowsRichEdit.cs
- ResourcePool.cs
- Control.cs
- StatusBar.cs
- IOException.cs
- Binding.cs
- StructuredTypeEmitter.cs
- RegexMatchCollection.cs
- UnsafeNativeMethods.cs
- TrustSection.cs
- XmlAnyElementAttribute.cs
- OdbcCommand.cs
- DataGridTextBox.cs
- WebEventTraceProvider.cs
- SqlNode.cs
- RequestCachePolicyConverter.cs
- NativeMethods.cs
- PinnedBufferMemoryStream.cs
- MoveSizeWinEventHandler.cs
- XmlProcessingInstruction.cs
- PostBackTrigger.cs
- XPathException.cs
- ValueProviderWrapper.cs
- TileBrush.cs
- BooleanToVisibilityConverter.cs
- DataQuery.cs
- ActivityExecutionFilter.cs
- CodeTypeOfExpression.cs
- HttpCapabilitiesEvaluator.cs
- SqlClientPermission.cs
- ChannelCredentials.cs
- coordinatorscratchpad.cs
- PassportIdentity.cs
- ZoneLinkButton.cs
- InfoCardProofToken.cs
- AccessedThroughPropertyAttribute.cs
- PartialClassGenerationTask.cs
- _FixedSizeReader.cs
- Selector.cs
- ToolStripArrowRenderEventArgs.cs
- TextBoxView.cs
- WeakReference.cs
- CodeCatchClause.cs
- DockPatternIdentifiers.cs
- ListControl.cs
- GacUtil.cs
- HTTP_SERVICE_CONFIG_URLACL_KEY.cs
- TriggerCollection.cs
- QilTargetType.cs