Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataWeb / Server / System / Data / Services / Serializers / Atom10FormatterFactory.cs / 1 / 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
- PartBasedPackageProperties.cs
- AttributedMetaModel.cs
- NonVisualControlAttribute.cs
- KeyMatchBuilder.cs
- MessageSmuggler.cs
- X509CertificateCollection.cs
- AttributeExtensions.cs
- NegatedCellConstant.cs
- BitmapEffectGroup.cs
- TraceContext.cs
- BinaryNegotiation.cs
- PackageRelationshipCollection.cs
- ConstructorArgumentAttribute.cs
- SimpleRecyclingCache.cs
- VirtualizingStackPanel.cs
- cache.cs
- CallbackValidator.cs
- SafeLocalMemHandle.cs
- HttpsTransportBindingElement.cs
- HtmlInputRadioButton.cs
- HandlerBase.cs
- XmlPreloadedResolver.cs
- ApplicationDirectory.cs
- Misc.cs
- OrthographicCamera.cs
- ImageBrush.cs
- ControlParameter.cs
- EntityDescriptor.cs
- SafePEFileHandle.cs
- HtmlControlPersistable.cs
- ColumnClickEvent.cs
- IndexedEnumerable.cs
- EnvelopedPkcs7.cs
- ListChangedEventArgs.cs
- ToolTipAutomationPeer.cs
- CodeTypeReference.cs
- COMException.cs
- DeferredTextReference.cs
- RuntimeWrappedException.cs
- TypeNameConverter.cs
- XmlAttributeOverrides.cs
- TabRenderer.cs
- DataGrid.cs
- Enum.cs
- KeyedHashAlgorithm.cs
- ContextMenuStrip.cs
- WebBrowser.cs
- X509Chain.cs
- InstalledFontCollection.cs
- Misc.cs
- VirtualPathExtension.cs
- ListControlConvertEventArgs.cs
- Viewport2DVisual3D.cs
- MarkupCompilePass1.cs
- PackUriHelper.cs
- EncodingDataItem.cs
- SafeEventLogReadHandle.cs
- StateManagedCollection.cs
- CodeThrowExceptionStatement.cs
- documentsequencetextview.cs
- DirectoryRootQuery.cs
- LicenseManager.cs
- SimpleRecyclingCache.cs
- FixedDocumentSequencePaginator.cs
- DataRecordInternal.cs
- ping.cs
- sqlpipe.cs
- WebPartMenuStyle.cs
- AttributeEmitter.cs
- SQLMembershipProvider.cs
- DateTimeHelper.cs
- MultipartIdentifier.cs
- ParameterElement.cs
- HtmlElement.cs
- SafeNativeMethods.cs
- ParentQuery.cs
- CopyAction.cs
- ParagraphVisual.cs
- SymLanguageVendor.cs
- PropertyValueUIItem.cs
- KeyPressEvent.cs
- SwitchLevelAttribute.cs
- MembershipUser.cs
- ControllableStoryboardAction.cs
- DescendantBaseQuery.cs
- CheckBoxRenderer.cs
- PrintDialog.cs
- Win32MouseDevice.cs
- Propagator.cs
- TransformationRules.cs
- coordinator.cs
- FixedSOMLineRanges.cs
- WebCodeGenerator.cs
- IDispatchConstantAttribute.cs
- BitmapEffectGroup.cs
- CellRelation.cs
- PropertyCondition.cs
- DataList.cs
- DynamicRendererThreadManager.cs
- XmlParserContext.cs