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
- HitTestWithGeometryDrawingContextWalker.cs
- BinaryMethodMessage.cs
- WebPartTransformerCollection.cs
- ConnectorRouter.cs
- GridItemProviderWrapper.cs
- mactripleDES.cs
- ProtocolReflector.cs
- UIElementCollection.cs
- OciHandle.cs
- ClaimComparer.cs
- PatternMatcher.cs
- StackOverflowException.cs
- SafeLocalMemHandle.cs
- DataContractSerializerFaultFormatter.cs
- ApplyTemplatesAction.cs
- CultureTableRecord.cs
- FloaterBaseParagraph.cs
- PointIndependentAnimationStorage.cs
- DependencyPropertyChangedEventArgs.cs
- SetterBaseCollection.cs
- ImageSource.cs
- DataGridColumn.cs
- SafeSecurityHandles.cs
- XmlCDATASection.cs
- StyleTypedPropertyAttribute.cs
- UncommonField.cs
- WorkflowCompensationBehavior.cs
- Speller.cs
- SessionStateSection.cs
- DrawingContextDrawingContextWalker.cs
- EventProviderClassic.cs
- ObsoleteAttribute.cs
- MsmqIntegrationChannelListener.cs
- ExceptionWrapper.cs
- DisplayInformation.cs
- ItemCollection.cs
- Label.cs
- SchemaTableOptionalColumn.cs
- CryptoApi.cs
- RectAnimationBase.cs
- DebugViewWriter.cs
- TempEnvironment.cs
- TrustManager.cs
- Knowncolors.cs
- ToolStripHighContrastRenderer.cs
- DbMetaDataColumnNames.cs
- NavigationProperty.cs
- DrawingContext.cs
- SerialPort.cs
- XPathDocumentBuilder.cs
- ViewgenGatekeeper.cs
- RuntimeVariablesExpression.cs
- CommonDialog.cs
- ThaiBuddhistCalendar.cs
- webeventbuffer.cs
- IntegrationExceptionEventArgs.cs
- GridViewColumn.cs
- RuntimeResourceSet.cs
- BindingElementExtensionElement.cs
- ObjectQuery.cs
- ThreadStartException.cs
- TextRangeEditLists.cs
- ColumnTypeConverter.cs
- VisualTreeHelper.cs
- __ComObject.cs
- XPathMultyIterator.cs
- SponsorHelper.cs
- DirectoryNotFoundException.cs
- KnownBoxes.cs
- PaperSource.cs
- ChangeDirector.cs
- ListArgumentProvider.cs
- AssemblyAttributes.cs
- DesignTimeParseData.cs
- ToolStripContentPanelDesigner.cs
- ScriptManager.cs
- ResumeStoryboard.cs
- PolyQuadraticBezierSegment.cs
- SendMailErrorEventArgs.cs
- StandardCommandToolStripMenuItem.cs
- DataGridColumnReorderingEventArgs.cs
- OleStrCAMarshaler.cs
- RepeaterItemEventArgs.cs
- MonikerUtility.cs
- XmlAttributeAttribute.cs
- EditorPartCollection.cs
- ConstrainedDataObject.cs
- FolderNameEditor.cs
- QuarticEase.cs
- NameSpaceExtractor.cs
- JsonGlobals.cs
- FlowThrottle.cs
- KoreanCalendar.cs
- MailFileEditor.cs
- ProvideValueServiceProvider.cs
- DataServiceQueryProvider.cs
- RegistrySecurity.cs
- WebRequestModuleElement.cs
- LinqDataSourceStatusEventArgs.cs
- DynamicPropertyHolder.cs