diff --git a/Ical.Net.Tests/Ical.Net.Tests.csproj b/Ical.Net.Tests/Ical.Net.Tests.csproj index 5d9f1c03..33281e9d 100644 --- a/Ical.Net.Tests/Ical.Net.Tests.csproj +++ b/Ical.Net.Tests/Ical.Net.Tests.csproj @@ -5,6 +5,10 @@ ..\IcalNetStrongnameKey.snk latest + + + $(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8618;CS8620;CS8714 + diff --git a/Ical.Net/DataTypes/Organizer.cs b/Ical.Net/DataTypes/Organizer.cs index 0e4e2b8d..1401eccd 100644 --- a/Ical.Net/DataTypes/Organizer.cs +++ b/Ical.Net/DataTypes/Organizer.cs @@ -84,7 +84,8 @@ public Organizer(string value) : this() } var serializer = new OrganizerSerializer(); - CopyFrom(serializer.Deserialize(new StringReader(value)) as ICopyable); + if (serializer.Deserialize(new StringReader(value)) is ICopyable deserialized) + CopyFrom(deserialized); } protected bool Equals(Organizer other) => Equals(Value, other.Value); @@ -109,7 +110,7 @@ public override bool Equals(object? obj) public override int GetHashCode() => Value?.GetHashCode() ?? 0; /// - public override void CopyFrom(ICopyable obj) + public sealed override void CopyFrom(ICopyable obj) { base.CopyFrom(obj); diff --git a/Ical.Net/Directory.Build.props b/Ical.Net/Directory.Build.props index dec5fe9c..c6833ce2 100644 --- a/Ical.Net/Directory.Build.props +++ b/Ical.Net/Directory.Build.props @@ -13,6 +13,10 @@ assets/icon.png assets/readme.md + + + $(NoWarn);CS8600;CS8601;CS8602;CS8603;CS8604;CS8618;CS8620;CS8714 + true