From 8d5c3030316d2f147e33c269f16a275a756f5e26 Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed Date: Thu, 21 Jul 2022 18:57:08 -0700 Subject: [PATCH] Port the doc changes to source (#72638) * Port the doc changes to source * Address the feedback * Update src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/DateOnlyConverter.cs Co-authored-by: Eric Erhardt * Remove duplicated summary section * reorder the doc elements * reorder the remaining doc elements Co-authored-by: Eric Erhardt --- .../src/System/ComponentModel/DateOnlyConverter.cs | 14 ++++++-------- .../src/System/ComponentModel/TimeOnlyConverter.cs | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/DateOnlyConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/DateOnlyConverter.cs index c036846b97acd..5bfe8223a8600 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/DateOnlyConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/DateOnlyConverter.cs @@ -9,25 +9,21 @@ namespace System.ComponentModel { /// - /// Provides a type converter to convert - /// objects to and from various other representations. + /// Provides a type converter to convert objects to and from various other representations. /// public class DateOnlyConverter : TypeConverter { /// - /// Gets a value indicating whether this converter can convert an - /// object in the given source type to a + /// Gets a value indicating whether this converter can convert an object in the given source type to a /// object using the specified context. /// + /// public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) { return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); } - /// - /// Gets a value indicating whether this converter can convert an object - /// to the given destination type using the context. - /// + /// public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) { return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); @@ -36,6 +32,7 @@ public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen( /// /// Converts the given value object to a object. /// + /// public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value) { if (value is string text) @@ -77,6 +74,7 @@ public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen( /// /// Converts the given value object from a object using the arguments. /// + /// public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) { if (destinationType == typeof(string) && value is DateOnly dateOnly) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TimeOnlyConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TimeOnlyConverter.cs index 7dc61debaf41d..4180508d2cc99 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TimeOnlyConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TimeOnlyConverter.cs @@ -9,25 +9,21 @@ namespace System.ComponentModel { /// - /// Provides a type converter to convert - /// objects to and from various other representations. + /// Provides a type converter to convert objects to and from various other representations. /// public class TimeOnlyConverter : TypeConverter { /// - /// Gets a value indicating whether this converter can convert an - /// object in the given source type to a + /// Gets a value indicating whether this converter can convert an object in the given source type to a /// object using the specified context. /// + /// public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) { return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); } - /// - /// Gets a value indicating whether this converter can convert an object - /// to the given destination type using the context. - /// + /// public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen(true)] Type? destinationType) { return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); @@ -36,6 +32,7 @@ public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen( /// /// Converts the given value object to a object. /// + /// public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value) { if (value is string text) @@ -77,6 +74,7 @@ public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen( /// /// Converts the given value object from a object using the arguments. /// + /// public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) { if (destinationType == typeof(string) && value is TimeOnly timeOnly)