Skip to content

Commit a2b08f1

Browse files
CopilotjeffhandleyPranavSenthilnathantarekgh
authored
Add XML documentation for 29 undocumented .NET 7.0 APIs (#117697)
* Initial plan * Add documentation for System.Data.SqlTypes and System.Diagnostics APIs Co-authored-by: jeffhandley <[email protected]> * Add documentation for System.Reflection.Metadata, System.Runtime.Versioning, System.Security.Cryptography.Cose and System.Runtime.Serialization.Json APIs Co-authored-by: jeffhandley <[email protected]> * Add documentation for System.Security.Cryptography.X509Certificates.X509SubjectAlternativeNameExtension and System.Runtime.Serialization.DataContracts.DataContract APIs Co-authored-by: jeffhandley <[email protected]> * Use <see> tags and remove trailing whitespace * Remove trailing whitespace * Add missing <see> tag * Revert to using <inheritdoc/> where it already existed * Remove redundant X509SubjectAlternativeNameExtension documentation Co-authored-by: PranavSenthilnathan <[email protected]> * Update TraceConfiguration summary to reference TraceSource with proper XML doc tags Co-authored-by: tarekgh <[email protected]> * Apply XML documentation feedback: improve cref tags, fix whitespace, and restore X509SubjectAlternativeNameExtension docs Co-authored-by: tarekgh <[email protected]> * Apply feedback from code review: update FieldTypeEncoder.CustomModifiers documentation Co-authored-by: tarekgh <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jeffhandley <[email protected]> Co-authored-by: Jeff Handley <[email protected]> Co-authored-by: PranavSenthilnathan <[email protected]> Co-authored-by: tarekgh <[email protected]>
1 parent d58e9aa commit a2b08f1

File tree

11 files changed

+120
-0
lines changed

11 files changed

+120
-0
lines changed

src/libraries/System.Configuration.ConfigurationManager/src/System/Diagnostics/TraceConfiguration.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
namespace System.Diagnostics
55
{
6+
/// <summary>
7+
/// Provides methods to register and configure tracing settings from configuration files to <see cref="TraceSource" /> and related classes.
8+
/// </summary>
69
public static class TraceConfiguration
710
{
811
private static volatile bool s_registered;

src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLBinary.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,11 @@ public static XmlQualifiedName GetXsdType(XmlSchemaSet schemaSet)
460460
return new XmlQualifiedName("base64Binary", XmlSchema.Namespace);
461461
}
462462

463+
/// <summary>
464+
/// Wraps a byte array in a <see cref="SqlBinary" /> without copying the data.
465+
/// </summary>
466+
/// <param name="bytes">The byte array to wrap.</param>
467+
/// <returns>A <see cref="SqlBinary" /> that wraps the provided byte array.</returns>
463468
public static SqlBinary WrapBytes(byte[] bytes)
464469
{
465470
return new SqlBinary(bytes, copy: false);

src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,13 @@ private decimal ToDecimal()
11541154
}
11551155
}
11561156

1157+
/// <summary>
1158+
/// Writes the TDS (Tabular Data Stream) representation of this <see cref="SqlDecimal" /> to the specified destination.
1159+
/// </summary>
1160+
/// <param name="destination">The destination span to write the TDS (Tabular Data Stream) value to. Must be at least 4 elements long.</param>
1161+
/// <returns>The number of <see langword="uint" /> values written to the destination.</returns>
1162+
/// <exception cref="SqlNullValueException">Thrown when the <see cref="SqlDecimal" /> is <see langword="null" />.</exception>
1163+
/// <exception cref="ArgumentOutOfRangeException">Thrown when the destination span is too small.</exception>
11571164
[CLSCompliant(false)]
11581165
public int WriteTdsValue(Span<uint> destination)
11591166
{

src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLMoney.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ public override string ToString()
208208
return money.ToString("#0.00##", null);
209209
}
210210

211+
/// <summary>
212+
/// Gets the TDS (Tabular Data Stream) representation of this <see cref="SqlMoney" /> value.
213+
/// </summary>
214+
/// <returns>A long value representing the TDS (Tabular Data Stream) representation.</returns>
215+
/// <exception cref="SqlNullValueException">Thrown when the <see cref="SqlMoney" /> is <see langword="null" />.</exception>
211216
public long GetTdsValue()
212217
{
213218
if (IsNull)
@@ -249,6 +254,11 @@ public static SqlMoney Parse(string s)
249254
return money;
250255
}
251256

257+
/// <summary>
258+
/// Creates a <see cref="SqlMoney" /> from a TDS (Tabular Data Stream) value.
259+
/// </summary>
260+
/// <param name="value">The TDS value to convert to <see cref="SqlMoney" />.</param>
261+
/// <returns>A <see cref="SqlMoney" /> representing the TDS value.</returns>
252262
public static SqlMoney FromTdsValue(long value)
253263
{
254264
return new SqlMoney(value, 0);

src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/InitializingSwitchEventArgs.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@ namespace System.Diagnostics
88
/// </summary>
99
public sealed class InitializingSwitchEventArgs : EventArgs
1010
{
11+
/// <summary>
12+
/// Initializes a new instance of the <see cref="InitializingSwitchEventArgs"/> class.
13+
/// </summary>
14+
/// <param name="switch">The switch that is being initialized.</param>
1115
public InitializingSwitchEventArgs(Switch @switch)
1216
{
1317
Switch = @switch;
1418
}
1519

20+
/// <summary>
21+
/// Gets the <see cref="Switch" /> that is being initialized.
22+
/// </summary>
1623
public Switch Switch { get; }
1724
}
1825
}

src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/InitializingTraceSourceEventArgs.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,23 @@ namespace System.Diagnostics
88
/// </summary>
99
public sealed class InitializingTraceSourceEventArgs : EventArgs
1010
{
11+
/// <summary>
12+
/// Initializes a new instance of the <see cref="InitializingTraceSourceEventArgs"/> class.
13+
/// </summary>
14+
/// <param name="traceSource">The trace source that is being initialized.</param>
1115
public InitializingTraceSourceEventArgs(TraceSource traceSource)
1216
{
1317
TraceSource = traceSource;
1418
}
1519

20+
/// <summary>
21+
/// Gets the trace source that is being initialized.
22+
/// </summary>
1623
public TraceSource TraceSource { get; }
24+
25+
/// <summary>
26+
/// Gets or sets a value indicating whether the trace source was initialized from configuration.
27+
/// </summary>
1728
public bool WasInitialized { get; set; }
1829
}
1930
}

src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/PlatformAttributes.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,32 @@ public UnsupportedOSPlatformAttribute(string platformName, string? message) : ba
134134
#endif
135135
sealed class ObsoletedOSPlatformAttribute : OSPlatformAttribute
136136
{
137+
/// <summary>
138+
/// Initializes a new instance of the <see cref="ObsoletedOSPlatformAttribute"/> class with the specified platform name.
139+
/// </summary>
140+
/// <param name="platformName">The name of the platform where the API was obsoleted.</param>
137141
public ObsoletedOSPlatformAttribute(string platformName) : base(platformName)
138142
{
139143
}
144+
145+
/// <summary>
146+
/// Initializes a new instance of the <see cref="ObsoletedOSPlatformAttribute"/> class with the specified platform name and message.
147+
/// </summary>
148+
/// <param name="platformName">The name of the platform where the API was obsoleted.</param>
149+
/// <param name="message">The message that explains the obsolescence.</param>
140150
public ObsoletedOSPlatformAttribute(string platformName, string? message) : base(platformName)
141151
{
142152
Message = message;
143153
}
154+
155+
/// <summary>
156+
/// Gets the message that explains the obsolescence.
157+
/// </summary>
144158
public string? Message { get; }
159+
160+
/// <summary>
161+
/// Gets or sets the URL that provides more information about the obsolescence.
162+
/// </summary>
145163
public string? Url { get; set; }
146164
}
147165

src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
namespace System.Runtime.Serialization.DataContracts
2323
{
24+
/// <summary>
25+
/// Represents a data contract that defines serialization and deserialization behavior for types.
26+
/// </summary>
2427
public abstract class DataContract
2528
{
2629
internal const string SerializerTrimmerWarning = "Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the " +
@@ -46,6 +49,9 @@ internal DataContract(DataContractCriticalHelper helper)
4649
_ns = helper.Namespace;
4750
}
4851

52+
/// <summary>
53+
/// Gets the contract type name for this data contract.
54+
/// </summary>
4955
public virtual string? ContractType => null;
5056

5157
internal MethodInfo? ParseMethod => _helper.ParseMethod;
@@ -190,24 +196,36 @@ internal virtual object ReadXmlElement(XmlReaderDelegator xmlReader, XmlObjectSe
190196
throw new InvalidDataContractException(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
191197
}
192198

199+
/// <summary>
200+
/// Gets a value indicating whether the data contract represents a value type.
201+
/// </summary>
193202
public virtual bool IsValueType
194203
{
195204
get => _helper.IsValueType;
196205
internal set => _helper.IsValueType = value;
197206
}
198207

208+
/// <summary>
209+
/// Gets a value indicating whether the data contract is serialized by reference.
210+
/// </summary>
199211
public virtual bool IsReference
200212
{
201213
get => _helper.IsReference;
202214
internal set => _helper.IsReference = value;
203215
}
204216

217+
/// <summary>
218+
/// Gets the XML qualified name for the data contract.
219+
/// </summary>
205220
public virtual XmlQualifiedName XmlName
206221
{
207222
get => _helper.XmlName;
208223
internal set => _helper.XmlName = value;
209224
}
210225

226+
/// <summary>
227+
/// Gets the base data contract for this data contract.
228+
/// </summary>
211229
public virtual DataContract? BaseContract
212230
{
213231
[RequiresDynamicCode(DataContract.SerializerAOTWarning)]

src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/DataContractJsonSerializer.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,20 @@ private XmlDictionaryString RootName
206206
// These Get/Set methods mirror the extensions that were added to DCS in the early days of Core, which allowed
207207
// using a slimmed-down surrogate on both NetFx and Core via type-forwarding mechanisms. That's why these are
208208
// a pair of methods instead of making the property itself public.
209+
210+
/// <summary>
211+
/// Gets the current serialization surrogate provider.
212+
/// </summary>
213+
/// <returns>The current <see cref="ISerializationSurrogateProvider"/> instance, or <see langword="null"/> if no provider is set.</returns>
209214
public ISerializationSurrogateProvider? GetSerializationSurrogateProvider()
210215
{
211216
return SerializationSurrogateProvider;
212217
}
213218

219+
/// <summary>
220+
/// Sets the serialization surrogate provider.
221+
/// </summary>
222+
/// <param name="provider">The <see cref="ISerializationSurrogateProvider"/> to use for serialization, or <see langword="null"/> to remove the current provider.</param>
214223
public void SetSerializationSurrogateProvider(ISerializationSurrogateProvider? provider)
215224
{
216225
SerializationSurrogateProvider = provider;

src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Ecma335/Encoding/BlobEncoders.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,10 @@ public FieldTypeEncoder(BlobBuilder builder)
424424
Builder = builder;
425425
}
426426

427+
/// <summary>
428+
/// Creates <see cref="CustomModifiersEncoder" /> object that can be used to encode custom modifiers.
429+
/// </summary>
430+
/// <returns>A <see cref="CustomModifiersEncoder"/> instance that can be used to encode custom modifiers.</returns>
427431
public CustomModifiersEncoder CustomModifiers()
428432
{
429433
return new CustomModifiersEncoder(Builder);

0 commit comments

Comments
 (0)