Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Server / System / Data / Services / Serializers / Atom10FormatterFactory.cs / 1305376 / Atom10FormatterFactory.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides a formatter factory for ATOM 1.0. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services.Serializers { using System.Diagnostics; using System.IO; using System.ServiceModel.Syndication; using System.Text; using System.Xml; ///Provides support for serializing responses in ATOM 1.0 format. ////// For more information, see http://tools.ietf.org/html/rfc4287. /// internal sealed class Atom10FormatterFactory : SyndicationFormatterFactory { ///Creates a new instance of the ///class. A new instance of the internal override SyndicationFeedFormatter CreateSyndicationFeedFormatter() { return new Atom10FeedFormatter(); } ///class. /// Creates a new instance of the /// Theclass with the specified /// instance. /// to serialize. /// /// A new instance of the internal override SyndicationFeedFormatter CreateSyndicationFeedFormatter(SyndicationFeed feedToWrite) { Debug.Assert(feedToWrite != null, "feedToWrite != null"); return new Atom10FeedFormatter(feedToWrite); } ///class with the specified /// instance. /// Creates a new instance of the ///class. A new instance of the internal override SyndicationItemFormatter CreateSyndicationItemFormatter() { return new Atom10ItemFormatter(); } ///class. /// Creates a new instance of the /// Theclass with the specified /// instance. /// to serialize. /// A new instance of the internal override SyndicationItemFormatter CreateSyndicationItemFormatter(SyndicationItem itemToWrite) { Debug.Assert(itemToWrite != null, "itemToWrite != null"); string value; if (itemToWrite.AttributeExtensions.TryGetValue(SyndicationSerializer.QualifiedNullAttribute, out value) && value == XmlConstants.XmlTrueLiteral) { return null; } return new Atom10ItemFormatter(itemToWrite); } ///class. /// Creates an /// Stream over which to read (the reader should close it when it's done with it). /// Encoding of the stream, possibly null. ///over the specified with the given /// , to be used with an appropriate formatter. /// A new internal override XmlReader CreateReader(Stream stream, Encoding encoding) { Debug.Assert(stream != null, "stream != null"); return XmlUtil.CreateXmlReader(stream, encoding); } ///instance. /// Creates an /// Stream over which to write (the writer should close it when it's done with it). /// Encoding of the stream. ///into the specified with the given /// , to be used with an appropriate formatter. /// A new internal override XmlWriter CreateWriter(Stream stream, Encoding encoding) { Debug.Assert(stream != null, "stream != null"); Debug.Assert(encoding != null, "encoding != null"); return XmlUtil.CreateXmlWriterAndWriteProcessingInstruction(stream, encoding); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //instance. // Copyright (c) Microsoft Corporation. All rights reserved. // //// Provides a formatter factory for ATOM 1.0. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services.Serializers { using System.Diagnostics; using System.IO; using System.ServiceModel.Syndication; using System.Text; using System.Xml; ///Provides support for serializing responses in ATOM 1.0 format. ////// For more information, see http://tools.ietf.org/html/rfc4287. /// internal sealed class Atom10FormatterFactory : SyndicationFormatterFactory { ///Creates a new instance of the ///class. A new instance of the internal override SyndicationFeedFormatter CreateSyndicationFeedFormatter() { return new Atom10FeedFormatter(); } ///class. /// Creates a new instance of the /// Theclass with the specified /// instance. /// to serialize. /// /// A new instance of the internal override SyndicationFeedFormatter CreateSyndicationFeedFormatter(SyndicationFeed feedToWrite) { Debug.Assert(feedToWrite != null, "feedToWrite != null"); return new Atom10FeedFormatter(feedToWrite); } ///class with the specified /// instance. /// Creates a new instance of the ///class. A new instance of the internal override SyndicationItemFormatter CreateSyndicationItemFormatter() { return new Atom10ItemFormatter(); } ///class. /// Creates a new instance of the /// Theclass with the specified /// instance. /// to serialize. /// A new instance of the internal override SyndicationItemFormatter CreateSyndicationItemFormatter(SyndicationItem itemToWrite) { Debug.Assert(itemToWrite != null, "itemToWrite != null"); string value; if (itemToWrite.AttributeExtensions.TryGetValue(SyndicationSerializer.QualifiedNullAttribute, out value) && value == XmlConstants.XmlTrueLiteral) { return null; } return new Atom10ItemFormatter(itemToWrite); } ///class. /// Creates an /// Stream over which to read (the reader should close it when it's done with it). /// Encoding of the stream, possibly null. ///over the specified with the given /// , to be used with an appropriate formatter. /// A new internal override XmlReader CreateReader(Stream stream, Encoding encoding) { Debug.Assert(stream != null, "stream != null"); return XmlUtil.CreateXmlReader(stream, encoding); } ///instance. /// Creates an /// Stream over which to write (the writer should close it when it's done with it). /// Encoding of the stream. ///into the specified with the given /// , to be used with an appropriate formatter. /// A new internal override XmlWriter CreateWriter(Stream stream, Encoding encoding) { Debug.Assert(stream != null, "stream != null"); Debug.Assert(encoding != null, "encoding != null"); return XmlUtil.CreateXmlWriterAndWriteProcessingInstruction(stream, encoding); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.instance.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FileChangesMonitor.cs
- SupportsEventValidationAttribute.cs
- ParserHooks.cs
- SqlInternalConnectionTds.cs
- ActivityValidator.cs
- figurelength.cs
- EventLogPermission.cs
- SamlAuthorityBinding.cs
- SoapMessage.cs
- StateInitializationDesigner.cs
- Mapping.cs
- ObsoleteAttribute.cs
- ValidationResults.cs
- StreamAsIStream.cs
- XPathAxisIterator.cs
- VirtualDirectoryMapping.cs
- TypefaceCollection.cs
- WindowsGraphics2.cs
- HitTestParameters.cs
- ObjectConverter.cs
- PtsContext.cs
- GraphicsPathIterator.cs
- DispatcherOperation.cs
- ErrorFormatterPage.cs
- controlskin.cs
- SmiConnection.cs
- NavigatingCancelEventArgs.cs
- BoolExpr.cs
- TimerEventSubscription.cs
- UserInitiatedRoutedEventPermission.cs
- WebPartsPersonalization.cs
- Int32Collection.cs
- PageVisual.cs
- ReadOnlyCollectionBuilder.cs
- Literal.cs
- Hex.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- BoundingRectTracker.cs
- SmtpNtlmAuthenticationModule.cs
- MobileComponentEditorPage.cs
- DocumentSchemaValidator.cs
- GenericWebPart.cs
- ThreadAbortException.cs
- VirtualPathUtility.cs
- AutomationPropertyInfo.cs
- AggregateNode.cs
- RuleSettings.cs
- ToolStripSystemRenderer.cs
- ParameterSubsegment.cs
- SystemDiagnosticsSection.cs
- ViewgenContext.cs
- WebPartRestoreVerb.cs
- NodeLabelEditEvent.cs
- CodeNamespaceImport.cs
- PeerValidationBehavior.cs
- InlineCollection.cs
- MetadataCollection.cs
- DateTimeFormatInfo.cs
- Screen.cs
- EntitySet.cs
- EntitySetDataBindingList.cs
- ZipIOModeEnforcingStream.cs
- SeverityFilter.cs
- Utils.cs
- LayoutDump.cs
- WarningException.cs
- UpdateCommand.cs
- ReadContentAsBinaryHelper.cs
- DBSchemaTable.cs
- LabelDesigner.cs
- ToolStripGrip.cs
- Signature.cs
- Preprocessor.cs
- ItemAutomationPeer.cs
- HttpModuleActionCollection.cs
- CasesDictionary.cs
- X509SecurityTokenAuthenticator.cs
- StrokeNodeOperations.cs
- StaticContext.cs
- CoreChannel.cs
- OutputCacheProfileCollection.cs
- BufferedResponseStream.cs
- Subtree.cs
- BridgeDataRecord.cs
- Gdiplus.cs
- ServiceReflector.cs
- ProcessModelInfo.cs
- SmtpException.cs
- GregorianCalendar.cs
- DbSourceCommand.cs
- FontEmbeddingManager.cs
- LineVisual.cs
- prefixendpointaddressmessagefilter.cs
- SqlProvider.cs
- FullTextLine.cs
- PermissionSetTriple.cs
- LambdaValue.cs
- HttpHeaderCollection.cs
- Operand.cs
- Utility.cs