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
- ClientOptions.cs
- TerminateSequence.cs
- UxThemeWrapper.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- FileSystemWatcher.cs
- Int16.cs
- FontWeight.cs
- DefaultValueAttribute.cs
- DiscardableAttribute.cs
- XmlTextReaderImplHelpers.cs
- FrameSecurityDescriptor.cs
- DesignerSerializationVisibilityAttribute.cs
- BuilderPropertyEntry.cs
- OverlappedAsyncResult.cs
- DateTimeUtil.cs
- XmlSchemaSimpleType.cs
- PowerModeChangedEventArgs.cs
- InkSerializer.cs
- RichTextBoxAutomationPeer.cs
- WebService.cs
- DataGridViewRowPostPaintEventArgs.cs
- SubclassTypeValidatorAttribute.cs
- ErrorProvider.cs
- Stream.cs
- EntityDesignerUtils.cs
- XPathSingletonIterator.cs
- DataGridViewRowHeaderCell.cs
- Point3DValueSerializer.cs
- WebContext.cs
- ButtonBaseAdapter.cs
- XmlWhitespace.cs
- DerivedKeyCachingSecurityTokenSerializer.cs
- DbExpressionBuilder.cs
- TCPClient.cs
- BindingsCollection.cs
- UnmanagedHandle.cs
- PermissionSetTriple.cs
- DoubleLinkList.cs
- TemplateField.cs
- DynamicPhysicalDiscoSearcher.cs
- KeyTime.cs
- SimpleHandlerBuildProvider.cs
- X509ScopedServiceCertificateElement.cs
- ElementHostAutomationPeer.cs
- MatrixConverter.cs
- Emitter.cs
- ArrayWithOffset.cs
- TextUtf8RawTextWriter.cs
- Clause.cs
- compensatingcollection.cs
- App.cs
- RequestDescription.cs
- XmlNamespaceManager.cs
- ResourceAssociationSet.cs
- MessageQueueTransaction.cs
- DefaultMemberAttribute.cs
- ResourceDescriptionAttribute.cs
- DateRangeEvent.cs
- DataGridCheckBoxColumn.cs
- NotFiniteNumberException.cs
- StorageMappingItemCollection.cs
- VsPropertyGrid.cs
- FilterableAttribute.cs
- DocumentOutline.cs
- RuleConditionDialog.cs
- DefaultValueConverter.cs
- XmlAttributeProperties.cs
- DataGridItemEventArgs.cs
- CryptoApi.cs
- ForeignConstraint.cs
- ParserContext.cs
- MouseOverProperty.cs
- InputMethodStateTypeInfo.cs
- SqlComparer.cs
- PrinterResolution.cs
- DynamicControl.cs
- Boolean.cs
- FlowNode.cs
- SecurityTokenAuthenticator.cs
- SystemInfo.cs
- ArrayExtension.cs
- SymLanguageVendor.cs
- New.cs
- ObjectDataSourceEventArgs.cs
- CustomLineCap.cs
- SoundPlayerAction.cs
- NullToBooleanConverter.cs
- FreezableCollection.cs
- TextLineBreak.cs
- RemoteWebConfigurationHostServer.cs
- GeometryGroup.cs
- SelectManyQueryOperator.cs
- WinInetCache.cs
- DocComment.cs
- AttachedAnnotation.cs
- ArgIterator.cs
- SynchronizedDispatch.cs
- DrawListViewSubItemEventArgs.cs
- Util.cs
- ResolvedKeyFrameEntry.cs