Browse Source

Use Contract.Requires for preconditions.

pull/1125/head
Steven Kirk 9 years ago
parent
commit
f83dd046a2
  1. 4
      src/Avalonia.Visuals/Media/Brush.cs

4
src/Avalonia.Visuals/Media/Brush.cs

@ -34,8 +34,8 @@ namespace Avalonia.Media
/// <returns>The <see cref="Color"/>.</returns>
public static IBrush Parse(string s)
{
if (s == null) throw new ArgumentNullException(nameof(s));
if (s.Length == 0) throw new FormatException();
Contract.Requires<ArgumentNullException>(s != null);
Contract.Requires<FormatException>(s.Length > 0);
if (s[0] == '#')
{

Loading…
Cancel
Save