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 / 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
- DateTimeEditor.cs
- MaskedTextProvider.cs
- BinaryParser.cs
- ComNativeDescriptor.cs
- HttpCachePolicyBase.cs
- UserNamePasswordValidator.cs
- EngineSite.cs
- LambdaCompiler.Generated.cs
- StrongNameKeyPair.cs
- QueryResponse.cs
- Pkcs7Recipient.cs
- ProcessModuleCollection.cs
- EqualityArray.cs
- ResourcesGenerator.cs
- _ScatterGatherBuffers.cs
- NamespaceTable.cs
- LinqDataSource.cs
- BuildProviderAppliesToAttribute.cs
- CodeSnippetCompileUnit.cs
- ServerValidateEventArgs.cs
- webclient.cs
- XamlTypeWithExplicitNamespace.cs
- GlobalItem.cs
- SerialPort.cs
- XmlParserContext.cs
- PackageRelationship.cs
- GeneralTransform3DGroup.cs
- SwitchLevelAttribute.cs
- RightsController.cs
- ManagementObjectSearcher.cs
- CommentEmitter.cs
- WriterOutput.cs
- Types.cs
- X509Logo.cs
- SqlDataSourceStatusEventArgs.cs
- GeneralTransform3DGroup.cs
- NativeMethods.cs
- FunctionImportElement.cs
- ServiceOperationWrapper.cs
- UserControlAutomationPeer.cs
- MenuItemCollection.cs
- ParserHooks.cs
- CharStorage.cs
- DomainUpDown.cs
- RangeValueProviderWrapper.cs
- XmlChildEnumerator.cs
- ListSortDescriptionCollection.cs
- SoapIgnoreAttribute.cs
- XmlNodeChangedEventArgs.cs
- SqlCachedBuffer.cs
- EntitySqlQueryBuilder.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- TemplatePropertyEntry.cs
- FontFamily.cs
- Attributes.cs
- ProfileManager.cs
- ScrollBarRenderer.cs
- HtmlLink.cs
- EncryptedData.cs
- TextServicesHost.cs
- Debugger.cs
- TreeViewEvent.cs
- MarshalByRefObject.cs
- EventRecordWrittenEventArgs.cs
- ModelTreeManager.cs
- DBSqlParser.cs
- XsltFunctions.cs
- MessageSecurityTokenVersion.cs
- ActionMismatchAddressingException.cs
- ComplexBindingPropertiesAttribute.cs
- UInt16Converter.cs
- XamlPoint3DCollectionSerializer.cs
- XamlClipboardData.cs
- GuidTagList.cs
- MethodInfo.cs
- FormClosedEvent.cs
- sqlcontext.cs
- DataGridViewRowConverter.cs
- Sorting.cs
- TemplatedAdorner.cs
- ChannelSinkStacks.cs
- ContextMenuAutomationPeer.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- FragmentQuery.cs
- EncodingNLS.cs
- Clause.cs
- PartitionResolver.cs
- OdbcDataAdapter.cs
- Rotation3DAnimationBase.cs
- RegionIterator.cs
- SetState.cs
- ControlCollection.cs
- SiteMapSection.cs
- precedingquery.cs
- CompilerTypeWithParams.cs
- StorageComplexTypeMapping.cs
- XmlLoader.cs
- ReadOnlyHierarchicalDataSourceView.cs
- EngineSite.cs
- FontInfo.cs