|
|
@@ -28,6 +28,9 @@ namespace Avalonia.Styling
|
|
|
/// <returns>The selector.</returns>
|
|
|
public static Selector Class(this Selector previous, string name)
|
|
|
{
|
|
|
+ Contract.Requires<ArgumentNullException>(name != null);
|
|
|
+ Contract.Requires<ArgumentException>(!string.IsNullOrWhiteSpace(name));
|
|
|
+
|
|
|
var tac = previous as TypeNameAndClassSelector;
|
|
|
|
|
|
if (tac != null)
|
|
|
@@ -59,6 +62,8 @@ namespace Avalonia.Styling
|
|
|
/// <returns>The selector.</returns>
|
|
|
public static Selector Is(this Selector previous, Type type)
|
|
|
{
|
|
|
+ Contract.Requires<ArgumentNullException>(type != null);
|
|
|
+
|
|
|
return TypeNameAndClassSelector.Is(previous, type);
|
|
|
}
|
|
|
|
|
|
@@ -81,6 +86,9 @@ namespace Avalonia.Styling
|
|
|
/// <returns>The selector.</returns>
|
|
|
public static Selector Name(this Selector previous, string name)
|
|
|
{
|
|
|
+ Contract.Requires<ArgumentNullException>(name != null);
|
|
|
+ Contract.Requires<ArgumentException>(!string.IsNullOrWhiteSpace(name));
|
|
|
+
|
|
|
var tac = previous as TypeNameAndClassSelector;
|
|
|
|
|
|
if (tac != null)
|
|
|
@@ -113,6 +121,8 @@ namespace Avalonia.Styling
|
|
|
/// <returns>The selector.</returns>
|
|
|
public static Selector OfType(this Selector previous, Type type)
|
|
|
{
|
|
|
+ Contract.Requires<ArgumentNullException>(type != null);
|
|
|
+
|
|
|
return TypeNameAndClassSelector.OfType(previous, type);
|
|
|
}
|
|
|
|
|
|
@@ -137,6 +147,8 @@ namespace Avalonia.Styling
|
|
|
/// <returns>The selector.</returns>
|
|
|
public static Selector PropertyEquals<T>(this Selector previous, AvaloniaProperty<T> property, object value)
|
|
|
{
|
|
|
+ Contract.Requires<ArgumentNullException>(property != null);
|
|
|
+
|
|
|
return new PropertyEqualsSelector(previous, property, value);
|
|
|
}
|
|
|
|
|
|
@@ -149,6 +161,8 @@ namespace Avalonia.Styling
|
|
|
/// <returns>The selector.</returns>
|
|
|
public static Selector PropertyEquals(this Selector previous, AvaloniaProperty property, object value)
|
|
|
{
|
|
|
+ Contract.Requires<ArgumentNullException>(property != null);
|
|
|
+
|
|
|
return new PropertyEqualsSelector(previous, property, value);
|
|
|
}
|
|
|
|