Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / Syndication / ExtensibleSyndicationObject.cs / 1 / ExtensibleSyndicationObject.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Syndication { using System.Collections.ObjectModel; using System.Collections.Generic; using System.Runtime.Serialization; using System.Xml.Serialization; using System.Xml; // NOTE: This class implements Clone so if you add any members, please update the copy ctor struct ExtensibleSyndicationObject : IExtensibleSyndicationObject { DictionaryattributeExtensions; SyndicationElementExtensionCollection elementExtensions; ExtensibleSyndicationObject(ExtensibleSyndicationObject source) { if (source.attributeExtensions != null) { this.attributeExtensions = new Dictionary (); foreach (XmlQualifiedName key in source.attributeExtensions.Keys) { this.attributeExtensions.Add(key, source.attributeExtensions[key]); } } else { this.attributeExtensions = null; } if (source.elementExtensions != null) { this.elementExtensions = new SyndicationElementExtensionCollection(source.elementExtensions); } else { this.elementExtensions = null; } } public Dictionary AttributeExtensions { get { if (this.attributeExtensions == null) { this.attributeExtensions = new Dictionary (); } return this.attributeExtensions; } } public SyndicationElementExtensionCollection ElementExtensions { get { if (this.elementExtensions == null) { this.elementExtensions = new SyndicationElementExtensionCollection(); } return this.elementExtensions; } } static XmlBuffer CreateXmlBuffer(XmlDictionaryReader unparsedExtensionsReader, int maxExtensionSize) { XmlBuffer buffer = new XmlBuffer(maxExtensionSize); using (XmlDictionaryWriter writer = buffer.OpenSection(unparsedExtensionsReader.Quotas)) { writer.WriteStartElement(Rss20Constants.ExtensionWrapperTag); while (unparsedExtensionsReader.IsStartElement()) { writer.WriteNode(unparsedExtensionsReader, false); } writer.WriteEndElement(); } buffer.CloseSection(); buffer.Close(); return buffer; } internal void LoadElementExtensions(XmlReader readerOverUnparsedExtensions, int maxExtensionSize) { if (readerOverUnparsedExtensions == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("readerOverUnparsedExtensions"); } if (maxExtensionSize < 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("maxExtensionSize")); } XmlDictionaryReader r = XmlDictionaryReader.CreateDictionaryReader(readerOverUnparsedExtensions); this.elementExtensions = new SyndicationElementExtensionCollection(CreateXmlBuffer(r, maxExtensionSize)); } internal void LoadElementExtensions(XmlBuffer buffer) { this.elementExtensions = new SyndicationElementExtensionCollection(buffer); } internal void WriteAttributeExtensions(XmlWriter writer) { if (writer == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writer"); } if (this.attributeExtensions != null) { foreach (XmlQualifiedName qname in this.attributeExtensions.Keys) { string value = this.attributeExtensions[qname]; writer.WriteAttributeString(qname.Name, qname.Namespace, value); } } } internal void WriteElementExtensions(XmlWriter writer) { if (writer == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writer"); } if (this.elementExtensions != null) { this.elementExtensions.WriteTo(writer); } } public ExtensibleSyndicationObject Clone() { return new ExtensibleSyndicationObject(this); } } } // 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
- SchemaImporterExtension.cs
- MobileContainerDesigner.cs
- StatusBarPanel.cs
- NominalTypeEliminator.cs
- IDReferencePropertyAttribute.cs
- HtmlAnchor.cs
- DiscoveryDocumentSerializer.cs
- SystemIPv4InterfaceProperties.cs
- RbTree.cs
- XamlTreeBuilder.cs
- SHA512.cs
- DataGridViewCellStyleChangedEventArgs.cs
- SiblingIterators.cs
- ClientTarget.cs
- URLMembershipCondition.cs
- EntityDataSourceChangingEventArgs.cs
- PlatformNotSupportedException.cs
- ExpressionContext.cs
- MachineKeyConverter.cs
- XmlSchemaSimpleTypeList.cs
- TemplateXamlTreeBuilder.cs
- ProfileEventArgs.cs
- SimpleRecyclingCache.cs
- ListBoxDesigner.cs
- DoubleUtil.cs
- Message.cs
- IdentityReference.cs
- ClusterRegistryConfigurationProvider.cs
- UpdateException.cs
- MemoryMappedViewAccessor.cs
- InternalDispatchObject.cs
- SecurityCredentialsManager.cs
- HwndSubclass.cs
- UpdateTracker.cs
- TypeSystem.cs
- BamlLocalizableResource.cs
- LoadedOrUnloadedOperation.cs
- SplitterDesigner.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- FileChangesMonitor.cs
- GifBitmapDecoder.cs
- Vector.cs
- RadioButtonFlatAdapter.cs
- AutomationTextAttribute.cs
- DisposableCollectionWrapper.cs
- Glyph.cs
- TemplatedAdorner.cs
- LateBoundBitmapDecoder.cs
- Rectangle.cs
- ThreadWorkerController.cs
- TextCompositionManager.cs
- Schema.cs
- ExpressionQuoter.cs
- BlurEffect.cs
- StickyNoteAnnotations.cs
- GetPageNumberCompletedEventArgs.cs
- TreeNodeMouseHoverEvent.cs
- Vector3D.cs
- HandlerMappingMemo.cs
- RichTextBox.cs
- SeekStoryboard.cs
- DataRowView.cs
- StickyNoteContentControl.cs
- RequestSecurityTokenForRemoteTokenFactory.cs
- SharedDp.cs
- XsltQilFactory.cs
- AsyncOperationManager.cs
- ToolStripDropDownMenu.cs
- Array.cs
- AssemblyCache.cs
- ProfileEventArgs.cs
- Sql8ExpressionRewriter.cs
- ConfigXmlSignificantWhitespace.cs
- WebPartEditorOkVerb.cs
- AdornerDecorator.cs
- X509PeerCertificateAuthentication.cs
- WebRequestModuleElement.cs
- StateMachineAction.cs
- AppDomainProtocolHandler.cs
- CodeCommentStatement.cs
- XmlWhitespace.cs
- Debug.cs
- WindowsEditBoxRange.cs
- TextServicesDisplayAttribute.cs
- PerformanceCountersElement.cs
- FunctionUpdateCommand.cs
- PrinterSettings.cs
- ObservableDictionary.cs
- ToolStripContentPanel.cs
- HttpRequest.cs
- DPTypeDescriptorContext.cs
- RegexMatch.cs
- MemberDomainMap.cs
- SiteMapDataSource.cs
- BitHelper.cs
- AssociationSetMetadata.cs
- StyleSheetDesigner.cs
- _RequestCacheProtocol.cs
- ToolStripControlHost.cs
- DashStyles.cs