From 8f6c48fcf0333b684cda3ae185d65ee39317a738 Mon Sep 17 00:00:00 2001 From: hrrrrustic Date: Mon, 12 Apr 2021 13:36:43 +0300 Subject: [PATCH] readonly annotation --- .../ServiceModel/Syndication/ExtensibleSyndicationObject.cs | 6 +++--- .../src/System/ServiceModel/Syndication/XmlDateTimeData.cs | 4 ++-- .../src/System/ServiceModel/Syndication/XmlUriData.cs | 6 +++--- .../src/System/ServiceModel/XmlBuffer.cs | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/ExtensibleSyndicationObject.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/ExtensibleSyndicationObject.cs index 318b0014f45f5b..a397a3bd78f710 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/ExtensibleSyndicationObject.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/ExtensibleSyndicationObject.cs @@ -84,7 +84,7 @@ internal void LoadElementExtensions(XmlBuffer buffer) _elementExtensions = new SyndicationElementExtensionCollection(buffer); } - internal void WriteAttributeExtensions(XmlWriter writer) + internal readonly void WriteAttributeExtensions(XmlWriter writer) { if (writer == null) { @@ -101,7 +101,7 @@ internal void WriteAttributeExtensions(XmlWriter writer) } } - internal void WriteElementExtensions(XmlWriter writer, Func shouldSkipElement = null) + internal readonly void WriteElementExtensions(XmlWriter writer, Func shouldSkipElement = null) { if (writer == null) { @@ -114,6 +114,6 @@ internal void WriteElementExtensions(XmlWriter writer, Func new ExtensibleSyndicationObject(this); + public readonly ExtensibleSyndicationObject Clone() => new ExtensibleSyndicationObject(this); } } diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/XmlDateTimeData.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/XmlDateTimeData.cs index 689bf0e88315bb..e9dad6a68fb0b2 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/XmlDateTimeData.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/XmlDateTimeData.cs @@ -13,8 +13,8 @@ public XmlDateTimeData(string dateTimeString, XmlQualifiedName elementQualifiedN ElementQualifiedName = elementQualifiedName; } - public string DateTimeString { get; } + public readonly string DateTimeString { get; } - public XmlQualifiedName ElementQualifiedName { get; } + public readonly XmlQualifiedName ElementQualifiedName { get; } } } diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/XmlUriData.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/XmlUriData.cs index 274045403abd9b..a1ceb27f6f4c96 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/XmlUriData.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/XmlUriData.cs @@ -14,10 +14,10 @@ public XmlUriData(string uriString, UriKind uriKind, XmlQualifiedName elementQua ElementQualifiedName = elementQualifiedName; } - public XmlQualifiedName ElementQualifiedName { get; } + public readonly XmlQualifiedName ElementQualifiedName { get; } - public UriKind UriKind { get; } + public readonly UriKind UriKind { get; } - public string UriString { get; } + public readonly string UriString { get; } } } diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/XmlBuffer.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/XmlBuffer.cs index 08f68ba039acab..6d1326b927af48 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/XmlBuffer.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/XmlBuffer.cs @@ -33,11 +33,11 @@ public Section(int offset, int size, XmlDictionaryReaderQuotas quotas) Quotas = quotas; } - public int Offset { get; } + public readonly int Offset { get; } - public int Size { get; } + public readonly int Size { get; } - public XmlDictionaryReaderQuotas Quotas { get; } + public readonly XmlDictionaryReaderQuotas Quotas { get; } } public XmlBuffer(int maxBufferSize)