Skip to content

Commit

Permalink
Annotations in depending projects
Browse files Browse the repository at this point in the history
  • Loading branch information
krwq committed Jul 1, 2021
1 parent 5b2ebe4 commit 0c041e7
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public MetadataPropertyDescriptorWrapper(PropertyDescriptor descriptor, Attribut

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

public override object GetValue(object component) { return _descriptor.GetValue(component); }
public override object? GetValue(object? component) { return _descriptor.GetValue(component); }

public override bool IsReadOnly
{
Expand All @@ -45,7 +45,7 @@ public override bool IsReadOnly

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ private void SetupConversion()

TypeConverter converter = GetOperandTypeConverter();
IComparable min = (IComparable)(ParseLimitsInInvariantCulture
? converter.ConvertFromInvariantString((string)minimum)
: converter.ConvertFromString((string)minimum));
? converter.ConvertFromInvariantString((string)minimum)!
: converter.ConvertFromString((string)minimum))!;
IComparable max = (IComparable)(ParseLimitsInInvariantCulture
? converter.ConvertFromInvariantString((string)maximum)
: converter.ConvertFromString((string)maximum));
? converter.ConvertFromInvariantString((string)maximum)!
: converter.ConvertFromString((string)maximum))!;

Func<object, object?> conversion;
if (ConvertValueInInvariantCulture)
Expand Down
26 changes: 13 additions & 13 deletions src/libraries/System.Data.OleDb/src/OleDbConnectionStringBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -540,17 +540,17 @@ public OleDbProviderConverter()
{
}

public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
public override bool GetStandardValuesSupported(ITypeDescriptorContext? context)
{
return true;
}

public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
public override bool GetStandardValuesExclusive(ITypeDescriptorContext? context)
{
return false;
}

public override StandardValuesCollection? GetStandardValues(ITypeDescriptorContext context)
public override StandardValuesCollection? GetStandardValues(ITypeDescriptorContext? context)
{
StandardValuesCollection? dataSourceNames = _standardValues;
if (null == _standardValues)
Expand Down Expand Up @@ -608,13 +608,13 @@ public OleDbServicesConverter() : base()
{
}

public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType)
{
// Only know how to convert from a string
return ((typeof(string) == sourceType) || base.CanConvertFrom(context, sourceType));
}

public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
public override object? ConvertFrom(ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value)
{
string? svalue = (value as string);
if (null != svalue)
Expand Down Expand Up @@ -645,13 +645,13 @@ public override object ConvertFrom(ITypeDescriptorContext context, System.Global
return base.ConvertFrom(context, culture, value);
}

public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType)
{
// Only know how to convert to the NetworkLibrary enumeration
return ((typeof(string) == destinationType) || base.CanConvertTo(context, destinationType));
}

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

public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
public override bool GetStandardValuesSupported(ITypeDescriptorContext? context)
{
return true;
}

public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
public override bool GetStandardValuesExclusive(ITypeDescriptorContext? context)
{
return false;
}

public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext? context)
{
StandardValuesCollection? standardValues = _standardValues;
if (null == standardValues)
Expand All @@ -683,7 +683,7 @@ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContex
return standardValues;
}

public override bool IsValid(ITypeDescriptorContext context, object value)
public override bool IsValid(ITypeDescriptorContext? context, object? value)
{
return true;
//return Enum.IsDefined(type, value);
Expand All @@ -697,7 +697,7 @@ public OleDbConnectionStringBuilderConverter()
{
}

public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType)
{
if (typeof(System.ComponentModel.Design.Serialization.InstanceDescriptor) == destinationType)
{
Expand All @@ -706,7 +706,7 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati
return base.CanConvertTo(context, destinationType);
}

public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
{
if (destinationType == null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Data.OleDb/src/OleDbException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public ErrorCodeConverter()
{
}

public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
{
if (destinationType == null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/System.Data.OleDb/src/OleDbParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ public OleDbParameterConverter()
{
}

public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType)
{
if (typeof(System.ComponentModel.Design.Serialization.InstanceDescriptor) == destinationType)
{
Expand All @@ -637,7 +637,7 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati
return base.CanConvertTo(context, destinationType);
}

public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType)
{
if (null == destinationType)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal sealed class DirectoryEntryConverter : TypeConverter
private static StandardValuesCollection? s_values;
private static readonly Hashtable s_componentsCreated = new Hashtable(StringComparer.OrdinalIgnoreCase);

public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType)
{
if (sourceType == typeof(string))
{
Expand All @@ -22,7 +22,7 @@ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceT
return base.CanConvertFrom(context, sourceType);
}

public override object? ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object? value)
public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object? value)
{
if (value != null && value is string)
{
Expand All @@ -49,7 +49,7 @@ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceT
return null;
}

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

return base.ConvertTo(context, culture, value, destinationType);
return base.ConvertTo(context, culture, value, destinationType!);
}

public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext? context)
{
if (s_values == null)
{
Expand Down Expand Up @@ -90,8 +90,8 @@ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContex
return null;
}

public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) => false;
public override bool GetStandardValuesExclusive(ITypeDescriptorContext? context) => false;

public override bool GetStandardValuesSupported(ITypeDescriptorContext context) => true;
public override bool GetStandardValuesSupported(ITypeDescriptorContext? context) => true;
}
}
Loading

0 comments on commit 0c041e7

Please sign in to comment.