Skip to content

Commit 0c041e7

Browse files
committed
Annotations in depending projects
1 parent 5b2ebe4 commit 0c041e7

File tree

14 files changed

+72
-72
lines changed

14 files changed

+72
-72
lines changed

src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/MetadataPropertyDescriptorWrapper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public MetadataPropertyDescriptorWrapper(PropertyDescriptor descriptor, Attribut
2626

2727
public override Type ComponentType { get { return _descriptor.ComponentType; } }
2828

29-
public override object GetValue(object component) { return _descriptor.GetValue(component); }
29+
public override object? GetValue(object? component) { return _descriptor.GetValue(component); }
3030

3131
public override bool IsReadOnly
3232
{
@@ -45,7 +45,7 @@ public override bool IsReadOnly
4545

4646
public override void ResetValue(object component) { _descriptor.ResetValue(component); }
4747

48-
public override void SetValue(object component, object value) { _descriptor.SetValue(component, value); }
48+
public override void SetValue(object? component, object? value) { _descriptor.SetValue(component, value); }
4949

5050
public override bool ShouldSerializeValue(object component) { return _descriptor.ShouldSerializeValue(component); }
5151

src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/RangeAttribute.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ private void SetupConversion()
207207

208208
TypeConverter converter = GetOperandTypeConverter();
209209
IComparable min = (IComparable)(ParseLimitsInInvariantCulture
210-
? converter.ConvertFromInvariantString((string)minimum)
211-
: converter.ConvertFromString((string)minimum));
210+
? converter.ConvertFromInvariantString((string)minimum)!
211+
: converter.ConvertFromString((string)minimum))!;
212212
IComparable max = (IComparable)(ParseLimitsInInvariantCulture
213-
? converter.ConvertFromInvariantString((string)maximum)
214-
: converter.ConvertFromString((string)maximum));
213+
? converter.ConvertFromInvariantString((string)maximum)!
214+
: converter.ConvertFromString((string)maximum))!;
215215

216216
Func<object, object?> conversion;
217217
if (ConvertValueInInvariantCulture)

src/libraries/System.Data.OleDb/src/OleDbConnectionStringBuilder.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -540,17 +540,17 @@ public OleDbProviderConverter()
540540
{
541541
}
542542

543-
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
543+
public override bool GetStandardValuesSupported(ITypeDescriptorContext? context)
544544
{
545545
return true;
546546
}
547547

548-
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
548+
public override bool GetStandardValuesExclusive(ITypeDescriptorContext? context)
549549
{
550550
return false;
551551
}
552552

553-
public override StandardValuesCollection? GetStandardValues(ITypeDescriptorContext context)
553+
public override StandardValuesCollection? GetStandardValues(ITypeDescriptorContext? context)
554554
{
555555
StandardValuesCollection? dataSourceNames = _standardValues;
556556
if (null == _standardValues)
@@ -608,13 +608,13 @@ public OleDbServicesConverter() : base()
608608
{
609609
}
610610

611-
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
611+
public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType)
612612
{
613613
// Only know how to convert from a string
614614
return ((typeof(string) == sourceType) || base.CanConvertFrom(context, sourceType));
615615
}
616616

617-
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
617+
public override object? ConvertFrom(ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value)
618618
{
619619
string? svalue = (value as string);
620620
if (null != svalue)
@@ -645,13 +645,13 @@ public override object ConvertFrom(ITypeDescriptorContext context, System.Global
645645
return base.ConvertFrom(context, culture, value);
646646
}
647647

648-
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
648+
public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType)
649649
{
650650
// Only know how to convert to the NetworkLibrary enumeration
651651
return ((typeof(string) == destinationType) || base.CanConvertTo(context, destinationType));
652652
}
653653

654-
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
654+
public override object? ConvertTo(ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, Type destinationType)
655655
{
656656
if ((typeof(string) == destinationType) && (null != value) && (typeof(int) == value.GetType()))
657657
{
@@ -660,17 +660,17 @@ public override object ConvertTo(ITypeDescriptorContext context, System.Globaliz
660660
return base.ConvertTo(context, culture, value, destinationType);
661661
}
662662

663-
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
663+
public override bool GetStandardValuesSupported(ITypeDescriptorContext? context)
664664
{
665665
return true;
666666
}
667667

668-
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
668+
public override bool GetStandardValuesExclusive(ITypeDescriptorContext? context)
669669
{
670670
return false;
671671
}
672672

673-
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
673+
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext? context)
674674
{
675675
StandardValuesCollection? standardValues = _standardValues;
676676
if (null == standardValues)
@@ -683,7 +683,7 @@ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContex
683683
return standardValues;
684684
}
685685

686-
public override bool IsValid(ITypeDescriptorContext context, object value)
686+
public override bool IsValid(ITypeDescriptorContext? context, object? value)
687687
{
688688
return true;
689689
//return Enum.IsDefined(type, value);
@@ -697,7 +697,7 @@ public OleDbConnectionStringBuilderConverter()
697697
{
698698
}
699699

700-
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
700+
public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType)
701701
{
702702
if (typeof(System.ComponentModel.Design.Serialization.InstanceDescriptor) == destinationType)
703703
{
@@ -706,7 +706,7 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati
706706
return base.CanConvertTo(context, destinationType);
707707
}
708708

709-
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
709+
public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
710710
{
711711
if (destinationType == null)
712712
{

src/libraries/System.Data.OleDb/src/OleDbException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public ErrorCodeConverter()
137137
{
138138
}
139139

140-
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
140+
public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
141141
{
142142
if (destinationType == null)
143143
{

src/libraries/System.Data.OleDb/src/OleDbParameter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ public OleDbParameterConverter()
628628
{
629629
}
630630

631-
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
631+
public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType)
632632
{
633633
if (typeof(System.ComponentModel.Design.Serialization.InstanceDescriptor) == destinationType)
634634
{
@@ -637,7 +637,7 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati
637637
return base.CanConvertTo(context, destinationType);
638638
}
639639

640-
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
640+
public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
641641
{
642642
if (null == destinationType)
643643
{

src/libraries/System.DirectoryServices/src/System/DirectoryServices/Design/DirectoryEntryConverter.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal sealed class DirectoryEntryConverter : TypeConverter
1212
private static StandardValuesCollection? s_values;
1313
private static readonly Hashtable s_componentsCreated = new Hashtable(StringComparer.OrdinalIgnoreCase);
1414

15-
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
15+
public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType)
1616
{
1717
if (sourceType == typeof(string))
1818
{
@@ -22,7 +22,7 @@ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceT
2222
return base.CanConvertFrom(context, sourceType);
2323
}
2424

25-
public override object? ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object? value)
25+
public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object? value)
2626
{
2727
if (value != null && value is string)
2828
{
@@ -49,7 +49,7 @@ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceT
4949
return null;
5050
}
5151

52-
public override object? ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object? value, Type? destinationType)
52+
public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
5353
{
5454
if (destinationType != null && destinationType == typeof(string))
5555
{
@@ -59,10 +59,10 @@ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceT
5959
return SR.DSNotSet;
6060
}
6161

62-
return base.ConvertTo(context, culture, value, destinationType);
62+
return base.ConvertTo(context, culture, value, destinationType!);
6363
}
6464

65-
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
65+
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext? context)
6666
{
6767
if (s_values == null)
6868
{
@@ -90,8 +90,8 @@ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContex
9090
return null;
9191
}
9292

93-
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) => false;
93+
public override bool GetStandardValuesExclusive(ITypeDescriptorContext? context) => false;
9494

95-
public override bool GetStandardValuesSupported(ITypeDescriptorContext context) => true;
95+
public override bool GetStandardValuesSupported(ITypeDescriptorContext? context) => true;
9696
}
9797
}

0 commit comments

Comments
 (0)