From: Stephen Toub Date: Wed, 18 Mar 2020 20:49:18 +0000 (-0400) Subject: Annotate System.Runtime.WindowsRuntime.UI.Xaml for nullable reference types (#33725) X-Git-Tag: submit/tizen/20210909.063632~9094 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be96b18de04bb0da444657c18c53e52ea38e4d73;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Annotate System.Runtime.WindowsRuntime.UI.Xaml for nullable reference types (#33725) --- diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/System.Runtime.WindowsRuntime.UI.Xaml.sln b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/System.Runtime.WindowsRuntime.UI.Xaml.sln index e2a35b0..261d24e 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/System.Runtime.WindowsRuntime.UI.Xaml.sln +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/System.Runtime.WindowsRuntime.UI.Xaml.sln @@ -26,6 +26,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {69FC7EB5-64FD-4464-88B1-B8ADD3870640}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {69FC7EB5-64FD-4464-88B1-B8ADD3870640}.Debug|Any CPU.Build.0 = Debug|Any CPU + {69FC7EB5-64FD-4464-88B1-B8ADD3870640}.Release|Any CPU.ActiveCfg = Release|Any CPU + {69FC7EB5-64FD-4464-88B1-B8ADD3870640}.Release|Any CPU.Build.0 = Release|Any CPU {263DA4F1-C3BC-4B43-98E7-9F38B419A131}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {263DA4F1-C3BC-4B43-98E7-9F38B419A131}.Debug|Any CPU.Build.0 = Debug|Any CPU {263DA4F1-C3BC-4B43-98E7-9F38B419A131}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/ref/System.Runtime.WindowsRuntime.UI.Xaml.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/ref/System.Runtime.WindowsRuntime.UI.Xaml.cs index 0f26e08..3a5592a 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/ref/System.Runtime.WindowsRuntime.UI.Xaml.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/ref/System.Runtime.WindowsRuntime.UI.Xaml.cs @@ -16,7 +16,7 @@ namespace Windows.UI.Xaml public double BottomRight { get { throw null; } set { } } public double TopLeft { get { throw null; } set { } } public double TopRight { get { throw null; } set { } } - public override bool Equals(object obj) { throw null; } + public override bool Equals(object? obj) { throw null; } public bool Equals(Windows.UI.Xaml.CornerRadius cornerRadius) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(Windows.UI.Xaml.CornerRadius cr1, Windows.UI.Xaml.CornerRadius cr2) { throw null; } @@ -33,7 +33,7 @@ namespace Windows.UI.Xaml public System.TimeSpan TimeSpan { get { throw null; } } public Windows.UI.Xaml.Duration Add(Windows.UI.Xaml.Duration duration) { throw null; } public static int Compare(Windows.UI.Xaml.Duration t1, Windows.UI.Xaml.Duration t2) { throw null; } - public override bool Equals(object value) { throw null; } + public override bool Equals(object? value) { throw null; } public bool Equals(Windows.UI.Xaml.Duration duration) { throw null; } public static bool Equals(Windows.UI.Xaml.Duration t1, Windows.UI.Xaml.Duration t2) { throw null; } public override int GetHashCode() { throw null; } @@ -67,7 +67,7 @@ namespace Windows.UI.Xaml public bool IsAuto { get { throw null; } } public bool IsStar { get { throw null; } } public double Value { get { throw null; } } - public override bool Equals(object oCompare) { throw null; } + public override bool Equals(object? oCompare) { throw null; } public bool Equals(Windows.UI.Xaml.GridLength gridLength) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(Windows.UI.Xaml.GridLength gl1, Windows.UI.Xaml.GridLength gl2) { throw null; } @@ -84,8 +84,8 @@ namespace Windows.UI.Xaml { public LayoutCycleException() { } protected LayoutCycleException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { } - public LayoutCycleException(string message) { } - public LayoutCycleException(string message, System.Exception innerException) { } + public LayoutCycleException(string? message) { } + public LayoutCycleException(string? message, System.Exception? innerException) { } } public partial struct Thickness { @@ -96,7 +96,7 @@ namespace Windows.UI.Xaml public double Left { get { throw null; } set { } } public double Right { get { throw null; } set { } } public double Top { get { throw null; } set { } } - public override bool Equals(object obj) { throw null; } + public override bool Equals(object? obj) { throw null; } public bool Equals(Windows.UI.Xaml.Thickness thickness) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(Windows.UI.Xaml.Thickness t1, Windows.UI.Xaml.Thickness t2) { throw null; } @@ -110,14 +110,14 @@ namespace Windows.UI.Xaml.Automation { public ElementNotAvailableException() { } protected ElementNotAvailableException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { } - public ElementNotAvailableException(string message) { } - public ElementNotAvailableException(string message, System.Exception innerException) { } + public ElementNotAvailableException(string? message) { } + public ElementNotAvailableException(string? message, System.Exception? innerException) { } } public partial class ElementNotEnabledException : System.Exception { public ElementNotEnabledException() { } - public ElementNotEnabledException(string message) { } - public ElementNotEnabledException(string message, System.Exception innerException) { } + public ElementNotEnabledException(string? message) { } + public ElementNotEnabledException(string? message, System.Exception? innerException) { } } } namespace Windows.UI.Xaml.Controls.Primitives @@ -128,7 +128,7 @@ namespace Windows.UI.Xaml.Controls.Primitives public GeneratorPosition(int index, int offset) { throw null; } public int Index { get { throw null; } set { } } public int Offset { get { throw null; } set { } } - public override bool Equals(object o) { throw null; } + public override bool Equals(object? o) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(Windows.UI.Xaml.Controls.Primitives.GeneratorPosition gp1, Windows.UI.Xaml.Controls.Primitives.GeneratorPosition gp2) { throw null; } public static bool operator !=(Windows.UI.Xaml.Controls.Primitives.GeneratorPosition gp1, Windows.UI.Xaml.Controls.Primitives.GeneratorPosition gp2) { throw null; } @@ -140,8 +140,8 @@ namespace Windows.UI.Xaml.Markup public partial class XamlParseException : System.Exception { public XamlParseException() { } - public XamlParseException(string message) { } - public XamlParseException(string message, System.Exception innerException) { } + public XamlParseException(string? message) { } + public XamlParseException(string? message, System.Exception? innerException) { } } } namespace Windows.UI.Xaml.Media @@ -158,14 +158,14 @@ namespace Windows.UI.Xaml.Media public double M22 { get { throw null; } set { } } public double OffsetX { get { throw null; } set { } } public double OffsetY { get { throw null; } set { } } - public override bool Equals(object o) { throw null; } + public override bool Equals(object? o) { throw null; } public bool Equals(Windows.UI.Xaml.Media.Matrix value) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(Windows.UI.Xaml.Media.Matrix matrix1, Windows.UI.Xaml.Media.Matrix matrix2) { throw null; } public static bool operator !=(Windows.UI.Xaml.Media.Matrix matrix1, Windows.UI.Xaml.Media.Matrix matrix2) { throw null; } - string System.IFormattable.ToString(string format, System.IFormatProvider provider) { throw null; } + string System.IFormattable.ToString(string? format, System.IFormatProvider? provider) { throw null; } public override string ToString() { throw null; } - public string ToString(System.IFormatProvider provider) { throw null; } + public string ToString(System.IFormatProvider? provider) { throw null; } public Windows.Foundation.Point Transform(Windows.Foundation.Point point) { throw null; } } } @@ -175,7 +175,7 @@ namespace Windows.UI.Xaml.Media.Animation { private int _dummyPrimitive; public System.TimeSpan TimeSpan { get { throw null; } } - public override bool Equals(object value) { throw null; } + public override bool Equals(object? value) { throw null; } public bool Equals(Windows.UI.Xaml.Media.Animation.KeyTime value) { throw null; } public static bool Equals(Windows.UI.Xaml.Media.Animation.KeyTime keyTime1, Windows.UI.Xaml.Media.Animation.KeyTime keyTime2) { throw null; } public static Windows.UI.Xaml.Media.Animation.KeyTime FromTimeSpan(System.TimeSpan timeSpan) { throw null; } @@ -196,15 +196,15 @@ namespace Windows.UI.Xaml.Media.Animation public bool HasCount { get { throw null; } } public bool HasDuration { get { throw null; } } public Windows.UI.Xaml.Media.Animation.RepeatBehaviorType Type { get { throw null; } set { } } - public override bool Equals(object value) { throw null; } + public override bool Equals(object? value) { throw null; } public bool Equals(Windows.UI.Xaml.Media.Animation.RepeatBehavior repeatBehavior) { throw null; } public static bool Equals(Windows.UI.Xaml.Media.Animation.RepeatBehavior repeatBehavior1, Windows.UI.Xaml.Media.Animation.RepeatBehavior repeatBehavior2) { throw null; } public override int GetHashCode() { throw null; } public static bool operator ==(Windows.UI.Xaml.Media.Animation.RepeatBehavior repeatBehavior1, Windows.UI.Xaml.Media.Animation.RepeatBehavior repeatBehavior2) { throw null; } public static bool operator !=(Windows.UI.Xaml.Media.Animation.RepeatBehavior repeatBehavior1, Windows.UI.Xaml.Media.Animation.RepeatBehavior repeatBehavior2) { throw null; } - string System.IFormattable.ToString(string format, System.IFormatProvider formatProvider) { throw null; } + string System.IFormattable.ToString(string? format, System.IFormatProvider? formatProvider) { throw null; } public override string ToString() { throw null; } - public string ToString(System.IFormatProvider formatProvider) { throw null; } + public string ToString(System.IFormatProvider? formatProvider) { throw null; } } public enum RepeatBehaviorType { @@ -238,15 +238,15 @@ namespace Windows.UI.Xaml.Media.Media3D public double OffsetX { get { throw null; } set { } } public double OffsetY { get { throw null; } set { } } public double OffsetZ { get { throw null; } set { } } - public override bool Equals(object o) { throw null; } + public override bool Equals(object? o) { throw null; } public bool Equals(Windows.UI.Xaml.Media.Media3D.Matrix3D value) { throw null; } public override int GetHashCode() { throw null; } public void Invert() { } public static bool operator ==(Windows.UI.Xaml.Media.Media3D.Matrix3D matrix1, Windows.UI.Xaml.Media.Media3D.Matrix3D matrix2) { throw null; } public static bool operator !=(Windows.UI.Xaml.Media.Media3D.Matrix3D matrix1, Windows.UI.Xaml.Media.Media3D.Matrix3D matrix2) { throw null; } public static Windows.UI.Xaml.Media.Media3D.Matrix3D operator *(Windows.UI.Xaml.Media.Media3D.Matrix3D matrix1, Windows.UI.Xaml.Media.Media3D.Matrix3D matrix2) { throw null; } - string System.IFormattable.ToString(string format, System.IFormatProvider provider) { throw null; } + string System.IFormattable.ToString(string? format, System.IFormatProvider? provider) { throw null; } public override string ToString() { throw null; } - public string ToString(System.IFormatProvider provider) { throw null; } + public string ToString(System.IFormatProvider? provider) { throw null; } } } diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/ref/System.Runtime.WindowsRuntime.UI.Xaml.csproj b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/ref/System.Runtime.WindowsRuntime.UI.Xaml.csproj index 39f6c30..aac97c0 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/ref/System.Runtime.WindowsRuntime.UI.Xaml.csproj +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/ref/System.Runtime.WindowsRuntime.UI.Xaml.csproj @@ -2,6 +2,7 @@ $(NetCoreAppCurrent);netstandard2.0 true + enable diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System.Runtime.WindowsRuntime.UI.Xaml.csproj b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System.Runtime.WindowsRuntime.UI.Xaml.csproj index 8247ba7..99aded3 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System.Runtime.WindowsRuntime.UI.Xaml.csproj +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System.Runtime.WindowsRuntime.UI.Xaml.csproj @@ -7,6 +7,7 @@ $(NetCoreAppCurrent)-Windows_NT;netstandard1.1;netstandard2.0;netcoreapp3.0-Windows_NT true + enable diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Automation/ElementNotAvailableException.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Automation/ElementNotAvailableException.cs index 2d5c21a..5daa094 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Automation/ElementNotAvailableException.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Automation/ElementNotAvailableException.cs @@ -26,13 +26,13 @@ namespace Windows.UI.Xaml.Automation HResult = HResults.E_ELEMENTNOTAVAILABLE; } - public ElementNotAvailableException(string message) + public ElementNotAvailableException(string? message) : base(message) { HResult = HResults.E_ELEMENTNOTAVAILABLE; } - public ElementNotAvailableException(string message, Exception innerException) + public ElementNotAvailableException(string? message, Exception? innerException) : base(message, innerException) { HResult = HResults.E_ELEMENTNOTAVAILABLE; diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Automation/ElementNotEnabledException.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Automation/ElementNotEnabledException.cs index 74e4c8e..4c3d1ac 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Automation/ElementNotEnabledException.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Automation/ElementNotEnabledException.cs @@ -24,13 +24,13 @@ namespace Windows.UI.Xaml.Automation HResult = HResults.E_ELEMENTNOTENABLED; } - public ElementNotEnabledException(string message) + public ElementNotEnabledException(string? message) : base(message) { HResult = HResults.E_ELEMENTNOTENABLED; } - public ElementNotEnabledException(string message, Exception innerException) + public ElementNotEnabledException(string? message, Exception? innerException) : base(message, innerException) { HResult = HResults.E_ELEMENTNOTENABLED; diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Controls/Primitives/GeneratorPosition.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Controls/Primitives/GeneratorPosition.cs index 49532fd..7ef8cce 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Controls/Primitives/GeneratorPosition.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Controls/Primitives/GeneratorPosition.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// - -// - using System; using System.Globalization; using System.Runtime.InteropServices; @@ -47,7 +43,7 @@ namespace Windows.UI.Xaml.Controls.Primitives return string.Concat("GeneratorPosition (", _index.ToString(CultureInfo.InvariantCulture), ",", _offset.ToString(CultureInfo.InvariantCulture), ")"); } - public override bool Equals(object o) + public override bool Equals(object? o) { if (o is GeneratorPosition) { diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/CornerRadius.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/CornerRadius.cs index e0d658a..1ecc201 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/CornerRadius.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/CornerRadius.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// - -// - using System; using System.Globalization; using System.Runtime.InteropServices; @@ -66,7 +62,7 @@ namespace Windows.UI.Xaml return ToString(CultureInfo.InvariantCulture); } - internal string ToString(CultureInfo cultureInfo) + internal string ToString(CultureInfo? cultureInfo) { char listSeparator = TokenizerHelper.GetNumericListSeparator(cultureInfo); @@ -86,13 +82,13 @@ namespace Windows.UI.Xaml return sb.ToString(); } - internal string InternalToString(double l, CultureInfo cultureInfo) + internal string InternalToString(double l, CultureInfo? cultureInfo) { if (double.IsNaN(l)) return "Auto"; return Convert.ToString(l, cultureInfo); } - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj is CornerRadius) { diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Duration.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Duration.cs index b80b134..569f585 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Duration.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Duration.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// - -// - using System; using System.Runtime.InteropServices; @@ -254,7 +250,7 @@ namespace Windows.UI.Xaml return this + duration; } - public override bool Equals(object value) + public override bool Equals(object? value) { return value is Duration && Equals((Duration)value); } diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/GridLength.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/GridLength.cs index 077e054..cdced48 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/GridLength.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/GridLength.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// - -// - using System; using System.Globalization; using System.Runtime.InteropServices; @@ -87,7 +83,7 @@ namespace Windows.UI.Xaml || gl1.Value != gl2.Value); } - public override bool Equals(object oCompare) + public override bool Equals(object? oCompare) { if (oCompare is GridLength) { @@ -113,7 +109,7 @@ namespace Windows.UI.Xaml return this.ToString(CultureInfo.InvariantCulture); } - internal string ToString(CultureInfo cultureInfo) + internal string ToString(CultureInfo? cultureInfo) { char listSeparator = TokenizerHelper.GetNumericListSeparator(cultureInfo); diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/LayoutCycleException.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/LayoutCycleException.cs index bd3f7b8..96c1bbb 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/LayoutCycleException.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/LayoutCycleException.cs @@ -26,13 +26,13 @@ namespace Windows.UI.Xaml HResult = HResults.E_LAYOUTCYCLE; } - public LayoutCycleException(string message) + public LayoutCycleException(string? message) : base(message) { HResult = HResults.E_LAYOUTCYCLE; } - public LayoutCycleException(string message, Exception innerException) + public LayoutCycleException(string? message, Exception? innerException) : base(message, innerException) { HResult = HResults.E_LAYOUTCYCLE; diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Markup/XamlParseException.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Markup/XamlParseException.cs index 0e027de..989cd8e 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Markup/XamlParseException.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Markup/XamlParseException.cs @@ -25,13 +25,13 @@ namespace Windows.UI.Xaml.Markup HResult = HResults.E_XAMLPARSEFAILED; } - public XamlParseException(string message) + public XamlParseException(string? message) : base(message) { HResult = HResults.E_XAMLPARSEFAILED; } - public XamlParseException(string message, Exception innerException) + public XamlParseException(string? message, Exception? innerException) : base(message, innerException) { HResult = HResults.E_XAMLPARSEFAILED; diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Animation/KeyTime.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Animation/KeyTime.cs index 2942b2a..f216f34 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Animation/KeyTime.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Animation/KeyTime.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// - -// - using System; using System.Runtime.InteropServices; @@ -60,7 +56,7 @@ namespace Windows.UI.Xaml.Media.Animation return KeyTime.Equals(this, value); } - public override bool Equals(object value) + public override bool Equals(object? value) { return value is KeyTime && this == (KeyTime)value; } diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Animation/RepeatBehavior.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Animation/RepeatBehavior.cs index c297e68..615723f 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Animation/RepeatBehavior.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Animation/RepeatBehavior.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// - -// - using System; using System.Runtime.InteropServices; using System.Text; @@ -113,17 +109,17 @@ namespace Windows.UI.Xaml.Media.Animation return InternalToString(null, null); } - public string ToString(IFormatProvider formatProvider) + public string ToString(IFormatProvider? formatProvider) { return InternalToString(null, formatProvider); } - string IFormattable.ToString(string format, IFormatProvider formatProvider) + string IFormattable.ToString(string? format, IFormatProvider? formatProvider) { return InternalToString(format, formatProvider); } - internal string InternalToString(string format, IFormatProvider formatProvider) + internal string InternalToString(string? format, IFormatProvider? formatProvider) { switch (_Type) { @@ -147,11 +143,11 @@ namespace Windows.UI.Xaml.Media.Animation return _Duration.ToString(); default: - return null; + return string.Empty; } } - public override bool Equals(object value) + public override bool Equals(object? value) { if (value is RepeatBehavior) { diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Matrix.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Matrix.cs index 2460c84..6fdf70d 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Matrix.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Matrix.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// - -// - using System; using System.Runtime.InteropServices; using Point = Windows.Foundation.Point; @@ -136,19 +132,19 @@ namespace Windows.UI.Xaml.Media return ConvertToString(null /* format string */, null /* format provider */); } - public string ToString(IFormatProvider provider) + public string ToString(IFormatProvider? provider) { // Delegate to the internal method which implements all ToString calls. return ConvertToString(null /* format string */, provider); } - string IFormattable.ToString(string format, IFormatProvider provider) + string IFormattable.ToString(string? format, IFormatProvider? provider) { // Delegate to the internal method which implements all ToString calls. return ConvertToString(format, provider); } - private string ConvertToString(string format, IFormatProvider provider) + private string ConvertToString(string? format, IFormatProvider? provider) { if (IsIdentity) { @@ -188,7 +184,7 @@ namespace Windows.UI.Xaml.Media OffsetY.GetHashCode(); } - public override bool Equals(object o) + public override bool Equals(object? o) { return o is Matrix && Matrix.Equals(this, (Matrix)o); } diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Media3D/Matrix3D.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Media3D/Matrix3D.cs index af001ab..dfd7d46 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Media3D/Matrix3D.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Media/Media3D/Matrix3D.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// - -// - using System; using System.Runtime.InteropServices; @@ -408,19 +404,19 @@ namespace Windows.UI.Xaml.Media.Media3D return ConvertToString(null /* format string */, null /* format provider */); } - public string ToString(IFormatProvider provider) + public string ToString(IFormatProvider? provider) { // Delegate to the internal method which implements all ToString calls. return ConvertToString(null /* format string */, provider); } - string IFormattable.ToString(string format, IFormatProvider provider) + string IFormattable.ToString(string? format, IFormatProvider? provider) { // Delegate to the internal method which implements all ToString calls. return ConvertToString(format, provider); } - private string ConvertToString(string format, IFormatProvider provider) + private string ConvertToString(string? format, IFormatProvider? provider) { if (IsIdentity) { @@ -461,7 +457,7 @@ namespace Windows.UI.Xaml.Media.Media3D M44.GetHashCode(); } - public override bool Equals(object o) + public override bool Equals(object? o) { return o is Matrix3D && Matrix3D.Equals(this, (Matrix3D)o); } diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Thickness.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Thickness.cs index 3c22ebe..2a3a4b7 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Thickness.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/Thickness.cs @@ -2,10 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// - -// - using System; using System.Globalization; using System.Runtime.InteropServices; @@ -72,7 +68,7 @@ namespace Windows.UI.Xaml return ToString(CultureInfo.InvariantCulture); } - internal string ToString(CultureInfo cultureInfo) + internal string ToString(CultureInfo? cultureInfo) { char listSeparator = TokenizerHelper.GetNumericListSeparator(cultureInfo); @@ -92,13 +88,13 @@ namespace Windows.UI.Xaml return sb.ToString(); } - internal string InternalToString(double l, CultureInfo cultureInfo) + internal string InternalToString(double l, CultureInfo? cultureInfo) { if (double.IsNaN(l)) return "Auto"; return Convert.ToString(l, cultureInfo); } - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj is Thickness) { diff --git a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/TokenizerHelper.cs b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/TokenizerHelper.cs index ad3207b..8ddd773 100644 --- a/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/TokenizerHelper.cs +++ b/src/libraries/System.Runtime.WindowsRuntime.UI.Xaml/src/System/Windows/TokenizerHelper.cs @@ -20,7 +20,7 @@ namespace Windows.UI.Xaml internal static class TokenizerHelper { - internal static char GetNumericListSeparator(IFormatProvider provider) + internal static char GetNumericListSeparator(IFormatProvider? provider) { char numericSeparator = ',';