Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / Syndication / SyndicationContent.cs / 1 / SyndicationContent.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Syndication { using System; using System.Collections.Generic; using System.Text; using System.Xml; using System.Xml.Serialization; using System.Runtime.Serialization; using System.Diagnostics.CodeAnalysis; public abstract class SyndicationContent { DictionaryattributeExtensions; protected SyndicationContent() { } protected SyndicationContent(SyndicationContent source) { CopyAttributeExtensions(source); } public Dictionary AttributeExtensions { get { if (this.attributeExtensions == null) { this.attributeExtensions = new Dictionary (); } return this.attributeExtensions; } } public abstract string Type { get; } public static TextSyndicationContent CreateHtmlContent(string content) { return new TextSyndicationContent(content, TextSyndicationContentKind.Html); } public static TextSyndicationContent CreatePlaintextContent(string content) { return new TextSyndicationContent(content); } public static UrlSyndicationContent CreateUrlContent(Uri url, string mediaType) { return new UrlSyndicationContent(url, mediaType); } public static TextSyndicationContent CreateXhtmlContent(string content) { return new TextSyndicationContent(content, TextSyndicationContentKind.XHtml); } public static XmlSyndicationContent CreateXmlContent(object dataContractObject) { return new XmlSyndicationContent(Atom10Constants.XmlMediaType, dataContractObject, (DataContractSerializer) null); } public static XmlSyndicationContent CreateXmlContent(object dataContractObject, XmlObjectSerializer dataContractSerializer) { return new XmlSyndicationContent(Atom10Constants.XmlMediaType, dataContractObject, dataContractSerializer); } public static XmlSyndicationContent CreateXmlContent(XmlReader xmlReader) { return new XmlSyndicationContent(xmlReader); } public static XmlSyndicationContent CreateXmlContent(object xmlSerializerObject, XmlSerializer serializer) { return new XmlSyndicationContent(Atom10Constants.XmlMediaType, xmlSerializerObject, serializer); } public abstract SyndicationContent Clone(); public void WriteTo(XmlWriter writer, string outerElementName, string outerElementNamespace) { if (writer == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writer"); } if (string.IsNullOrEmpty(outerElementName)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR2.GetString(SR2.OuterElementNameNotSpecified)); } writer.WriteStartElement(outerElementName, outerElementNamespace); writer.WriteAttributeString(Atom10Constants.TypeTag, string.Empty, this.Type); if (this.attributeExtensions != null) { foreach (XmlQualifiedName key in this.attributeExtensions.Keys) { if (key.Name == Atom10Constants.TypeTag && key.Namespace == string.Empty) { continue; } string attrValue; if (this.attributeExtensions.TryGetValue(key, out attrValue)) { writer.WriteAttributeString(key.Name, key.Namespace, attrValue); } } } WriteContentsTo(writer); writer.WriteEndElement(); } internal void CopyAttributeExtensions(SyndicationContent source) { if (source == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("source"); } if (source.attributeExtensions != null) { foreach (XmlQualifiedName key in source.attributeExtensions.Keys) { this.AttributeExtensions.Add(key, source.attributeExtensions[key]); } } } protected abstract void WriteContentsTo(XmlWriter writer); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ObjectFullSpanRewriter.cs
- CryptoStream.cs
- TextTreeTextElementNode.cs
- BulletedList.cs
- MediaPlayerState.cs
- ToggleButton.cs
- CompatibleComparer.cs
- SizeAnimationUsingKeyFrames.cs
- DoubleUtil.cs
- TextServicesManager.cs
- JournalEntry.cs
- SettingsPropertyIsReadOnlyException.cs
- ObjectListCommandCollection.cs
- FileDialogCustomPlacesCollection.cs
- ProfilePropertyNameValidator.cs
- FunctionImportMapping.cs
- Component.cs
- TreeViewDataItemAutomationPeer.cs
- AncillaryOps.cs
- PageRouteHandler.cs
- FixedSOMTableCell.cs
- SqlProfileProvider.cs
- ToolStripDropDownMenu.cs
- EnumerableRowCollectionExtensions.cs
- Main.cs
- ActivityCodeDomReferenceService.cs
- DropShadowBitmapEffect.cs
- PropertyChangedEventManager.cs
- UITypeEditors.cs
- CompModSwitches.cs
- SpeechSynthesizer.cs
- WorkflowEnvironment.cs
- WebContext.cs
- MsmqIntegrationValidationBehavior.cs
- basemetadatamappingvisitor.cs
- BrushMappingModeValidation.cs
- Error.cs
- DataBoundControlHelper.cs
- CssClassPropertyAttribute.cs
- BufferedStream2.cs
- SecurityException.cs
- BrowserDefinition.cs
- MSG.cs
- BindingOperations.cs
- InputProviderSite.cs
- DataIdProcessor.cs
- SerialPort.cs
- RuleSettingsCollection.cs
- SizeKeyFrameCollection.cs
- WindowsFormsSectionHandler.cs
- ValidationEventArgs.cs
- FrameworkReadOnlyPropertyMetadata.cs
- HandlerWithFactory.cs
- BamlLocalizableResourceKey.cs
- DataGridViewEditingControlShowingEventArgs.cs
- ParameterReplacerVisitor.cs
- KeyValueConfigurationElement.cs
- StartFileNameEditor.cs
- DefaultSerializationProviderAttribute.cs
- DataGridTextBoxColumn.cs
- DefaultPrintController.cs
- ProfileSection.cs
- X509Certificate.cs
- SqlOuterApplyReducer.cs
- FileDialog_Vista.cs
- XPathExpr.cs
- SoapSchemaExporter.cs
- GreenMethods.cs
- ListenerConnectionModeReader.cs
- NativeWindow.cs
- InternalControlCollection.cs
- WebScriptEnablingBehavior.cs
- XamlTypeMapper.cs
- CertificateReferenceElement.cs
- OleDbConnectionFactory.cs
- PaginationProgressEventArgs.cs
- UnsafeNativeMethodsTablet.cs
- DataStreamFromComStream.cs
- ZipIOBlockManager.cs
- DynamicRenderer.cs
- EntityClassGenerator.cs
- XmlDictionaryWriter.cs
- Membership.cs
- CounterSample.cs
- ScaleTransform3D.cs
- ProviderSettings.cs
- PreviewKeyDownEventArgs.cs
- KeyFrames.cs
- CultureData.cs
- HttpHandlerAction.cs
- ColumnClickEvent.cs
- DeclarativeConditionsCollection.cs
- ToolStripRenderEventArgs.cs
- Decimal.cs
- StyleXamlParser.cs
- WebScriptServiceHostFactory.cs
- DataPager.cs
- RpcResponse.cs
- DataTableClearEvent.cs
- ToolStripItem.cs