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
- CookieParameter.cs
- FileDialog.cs
- BooleanKeyFrameCollection.cs
- CalendarButton.cs
- InputLanguage.cs
- ProfileService.cs
- StorageMappingFragment.cs
- Expression.cs
- ImpersonationContext.cs
- SchemaMapping.cs
- DataGridViewCellCollection.cs
- Deflater.cs
- CancelRequestedQuery.cs
- DataMemberFieldConverter.cs
- DefaultHttpHandler.cs
- ExclusiveNamedPipeTransportManager.cs
- PathGeometry.cs
- SQLMoneyStorage.cs
- HttpContext.cs
- BitmapSourceSafeMILHandle.cs
- IndexerHelper.cs
- WebBrowsableAttribute.cs
- RegistryKey.cs
- DynamicMethod.cs
- ClipboardProcessor.cs
- Converter.cs
- InvalidPrinterException.cs
- InputBinding.cs
- ToolStripArrowRenderEventArgs.cs
- ReliableChannelBinder.cs
- StoreContentChangedEventArgs.cs
- Quad.cs
- EntityDataSourceDesignerHelper.cs
- CharAnimationBase.cs
- listitem.cs
- Base64Stream.cs
- CompositionAdorner.cs
- PageAdapter.cs
- DesignSurfaceManager.cs
- Walker.cs
- WindowsToolbar.cs
- ClassHandlersStore.cs
- AssemblyCollection.cs
- FilterEventArgs.cs
- ExecutionContext.cs
- TemplateXamlParser.cs
- EntityCommandDefinition.cs
- RootNamespaceAttribute.cs
- List.cs
- _IPv4Address.cs
- BindableTemplateBuilder.cs
- DefinitionUpdate.cs
- OleStrCAMarshaler.cs
- LocalizationParserHooks.cs
- LayoutEvent.cs
- ObjectNavigationPropertyMapping.cs
- UpdateRecord.cs
- BatchStream.cs
- SortableBindingList.cs
- SiteMapHierarchicalDataSourceView.cs
- CodeCompileUnit.cs
- StaticExtension.cs
- HMACSHA512.cs
- ImageIndexConverter.cs
- Error.cs
- CalendarDay.cs
- Line.cs
- HopperCache.cs
- ControlPaint.cs
- DataRelation.cs
- Int32Rect.cs
- SimpleLine.cs
- DummyDataSource.cs
- OperationResponse.cs
- LogPolicy.cs
- PauseStoryboard.cs
- WebBrowserSiteBase.cs
- TemplateBindingExtension.cs
- PerfCounters.cs
- PropertyCondition.cs
- DataShape.cs
- CultureSpecificStringDictionary.cs
- CacheMemory.cs
- StringPropertyBuilder.cs
- ProfileInfo.cs
- DocumentDesigner.cs
- SpeechAudioFormatInfo.cs
- MemoryStream.cs
- ItemList.cs
- ADMembershipUser.cs
- Mapping.cs
- ChameleonKey.cs
- SqlGatherConsumedAliases.cs
- PreservationFileReader.cs
- StylusPointProperties.cs
- Module.cs
- XmlSchemaObject.cs
- PointValueSerializer.cs
- Attributes.cs
- TextElementCollectionHelper.cs