Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWeb / Server / System / Data / Services / Serializers / Atom10FormatterFactory.cs / 2 / 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
- ButtonBase.cs
- CustomError.cs
- WebPartExportVerb.cs
- XmlLoader.cs
- CompilationSection.cs
- InfiniteTimeSpanConverter.cs
- webclient.cs
- Claim.cs
- __ComObject.cs
- AssertFilter.cs
- Activity.cs
- ImageDrawing.cs
- CodeDOMProvider.cs
- VariableAction.cs
- CustomValidator.cs
- DataGridRowAutomationPeer.cs
- MeasureItemEvent.cs
- DataGridViewHitTestInfo.cs
- PropertyReferenceSerializer.cs
- SapiRecognizer.cs
- LogReserveAndAppendState.cs
- RolePrincipal.cs
- XmlNamespaceMappingCollection.cs
- ConfigurationFileMap.cs
- EventItfInfo.cs
- SqlGatherProducedAliases.cs
- XMLSyntaxException.cs
- DataMemberConverter.cs
- SqlTypeSystemProvider.cs
- LockRecursionException.cs
- AnnotationAuthorChangedEventArgs.cs
- DataContractSerializer.cs
- DataGridColumnHeadersPresenter.cs
- LongPath.cs
- DesignerWithHeader.cs
- XmlValueConverter.cs
- TextRangeBase.cs
- TcpClientSocketManager.cs
- SafeCryptContextHandle.cs
- MarginsConverter.cs
- SrgsSubset.cs
- ScriptControlManager.cs
- PersonalizationProvider.cs
- ClientSideQueueItem.cs
- StandardOleMarshalObject.cs
- XmlSchema.cs
- Asn1Utilities.cs
- LinkedList.cs
- SrgsRulesCollection.cs
- PerfProviderCollection.cs
- SapiRecoInterop.cs
- ManagementQuery.cs
- DataTableNewRowEvent.cs
- ObjectPersistData.cs
- BindingExpressionUncommonField.cs
- RelationshipWrapper.cs
- StandardOleMarshalObject.cs
- StateRuntime.cs
- RegisteredExpandoAttribute.cs
- XmlSchemaCollection.cs
- CreateSequence.cs
- InlineUIContainer.cs
- StaticSiteMapProvider.cs
- CellNormalizer.cs
- ProfileWorkflowElement.cs
- DataListItemEventArgs.cs
- MULTI_QI.cs
- PointConverter.cs
- CodeLinePragma.cs
- XmlIgnoreAttribute.cs
- ExpressionEvaluator.cs
- PreProcessInputEventArgs.cs
- DataSpaceManager.cs
- SHA256Cng.cs
- PersonalizableTypeEntry.cs
- Version.cs
- PageParser.cs
- TargetInvocationException.cs
- BamlRecordReader.cs
- Setter.cs
- StorageModelBuildProvider.cs
- PartialCachingAttribute.cs
- XmlFileEditor.cs
- TTSEngineProxy.cs
- CurrencyWrapper.cs
- DebugController.cs
- SqlCrossApplyToCrossJoin.cs
- AttributeConverter.cs
- SingleObjectCollection.cs
- TextWriter.cs
- SmiMetaData.cs
- NumberFormatInfo.cs
- RenderDataDrawingContext.cs
- KeyPullup.cs
- Console.cs
- ConstantExpression.cs
- ParserHooks.cs
- CultureMapper.cs
- Animatable.cs
- ExpressionNormalizer.cs