protected SyndicationCategory(SyndicationCategory source) { if (source == null) { throw new ArgumentNullException(nameof(source)); } _label = source._label; _name = source._name; _scheme = source._scheme; _extensions = source._extensions.Clone(); }
protected SyndicationPerson(SyndicationPerson source) { if (source == null) { throw new ArgumentNullException(nameof(source)); } _email = source._email; _name = source._name; _uri = source._uri; _extensions = source._extensions.Clone(); }
protected SyndicationLink(SyndicationLink source) { if (source == null) { throw new ArgumentNullException(nameof(source)); } _length = source._length; _mediaType = source._mediaType; _relationshipType = source._relationshipType; _title = source._title; _baseUri = source._baseUri; _uri = source._uri; _extensions = source._extensions.Clone(); }
protected SyndicationFeed(SyndicationFeed source, bool cloneItems) { if (source == null) { throw new ArgumentNullException(nameof(source)); } _authors = FeedUtils.ClonePersons(source._authors); _categories = FeedUtils.CloneCategories(source._categories); _contributors = FeedUtils.ClonePersons(source._contributors); _copyright = FeedUtils.CloneTextContent(source._copyright); _description = FeedUtils.CloneTextContent(source._description); _extensions = source._extensions.Clone(); _generator = source._generator; _id = source._id; _imageUrl = source._imageUrl; _language = source._language; _lastUpdatedTime = source._lastUpdatedTime; _links = FeedUtils.CloneLinks(source._links); _title = FeedUtils.CloneTextContent(source._title); _baseUri = source._baseUri; IList <SyndicationItem> srcList = source._items as IList <SyndicationItem>; if (srcList != null) { Collection <SyndicationItem> tmp = new NullNotAllowedCollection <SyndicationItem>(); for (int i = 0; i < srcList.Count; ++i) { tmp.Add((cloneItems) ? srcList[i].Clone() : srcList[i]); } _items = tmp; } else { if (cloneItems) { throw new InvalidOperationException(SR.UnbufferedItemsCannotBeCloned); } _items = source._items; } }
private ExtensibleSyndicationObject(ExtensibleSyndicationObject source) { if (source._attributeExtensions != null) { _attributeExtensions = new Dictionary <XmlQualifiedName, string>(); foreach (XmlQualifiedName key in source._attributeExtensions.Keys) { _attributeExtensions.Add(key, source._attributeExtensions[key]); } } else { _attributeExtensions = null; } if (source._elementExtensions != null) { _elementExtensions = new SyndicationElementExtensionCollection(source._elementExtensions); } else { _elementExtensions = null; } }