Show / Hide Table of Contents

Class SizeAttribute

Used to specify minimum image width and/or height for form factor(s)

Inheritance
object
Attribute
ValidationAttribute
ImageValidationAttribute
SizeAttribute
Implements
ISizeConstraint
IEquatable<SizeAttribute>
Inherited Members
ImageValidationAttribute.RequiresValidationContext
ImageValidationAttribute.FormFactor
ImageValidationAttribute.IsValid(object)
ValidationAttribute.FormatErrorMessage(string)
ValidationAttribute.GetValidationResult(object, ValidationContext)
ValidationAttribute.IsValid(object, ValidationContext)
ValidationAttribute.Validate(object, ValidationContext)
ValidationAttribute.Validate(object, string)
ValidationAttribute.ErrorMessage
ValidationAttribute.ErrorMessageResourceName
ValidationAttribute.ErrorMessageResourceType
ValidationAttribute.ErrorMessageString
Attribute.Equals(object)
Attribute.GetCustomAttribute(Assembly, Type)
Attribute.GetCustomAttribute(Assembly, Type, bool)
Attribute.GetCustomAttribute(MemberInfo, Type)
Attribute.GetCustomAttribute(MemberInfo, Type, bool)
Attribute.GetCustomAttribute(Module, Type)
Attribute.GetCustomAttribute(Module, Type, bool)
Attribute.GetCustomAttribute(ParameterInfo, Type)
Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
Attribute.GetCustomAttributes(Assembly)
Attribute.GetCustomAttributes(Assembly, bool)
Attribute.GetCustomAttributes(Assembly, Type)
Attribute.GetCustomAttributes(Assembly, Type, bool)
Attribute.GetCustomAttributes(MemberInfo)
Attribute.GetCustomAttributes(MemberInfo, bool)
Attribute.GetCustomAttributes(MemberInfo, Type)
Attribute.GetCustomAttributes(MemberInfo, Type, bool)
Attribute.GetCustomAttributes(Module)
Attribute.GetCustomAttributes(Module, bool)
Attribute.GetCustomAttributes(Module, Type)
Attribute.GetCustomAttributes(Module, Type, bool)
Attribute.GetCustomAttributes(ParameterInfo)
Attribute.GetCustomAttributes(ParameterInfo, bool)
Attribute.GetCustomAttributes(ParameterInfo, Type)
Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
Attribute.GetHashCode()
Attribute.IsDefaultAttribute()
Attribute.IsDefined(Assembly, Type)
Attribute.IsDefined(Assembly, Type, bool)
Attribute.IsDefined(MemberInfo, Type)
Attribute.IsDefined(MemberInfo, Type, bool)
Attribute.IsDefined(Module, Type)
Attribute.IsDefined(Module, Type, bool)
Attribute.IsDefined(ParameterInfo, Type)
Attribute.IsDefined(ParameterInfo, Type, bool)
Attribute.Match(object)
Attribute.TypeId
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: AdaptiveImages.Validation
Assembly: AdaptiveImages.dll
Syntax
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
public class SizeAttribute : ImageValidationAttribute, ISizeConstraint, IEquatable<SizeAttribute>

Constructors

SizeAttribute()

Defines a new minimum size constraint

Declaration
public SizeAttribute()
Exceptions
Type Condition
ArgumentException

SizeAttribute(int)

Defines a new minimum size constraint

Declaration
public SizeAttribute(int minimumWidth)
Parameters
Type Name Description
int minimumWidth

Minimum width of the original image, or croppings thereof, in pixels

Exceptions
Type Condition
ArgumentException

SizeAttribute(int, FormFactor)

Defines a new minimum size constraint

Declaration
public SizeAttribute(int minimumWidth, FormFactor formFactor)
Parameters
Type Name Description
int minimumWidth

Minimum width of the original image, or croppings thereof, in pixels

FormFactor formFactor

One or more form factors this attribute applies to (bitwise OR supported), leave empty to make it apply to all form factors

Exceptions
Type Condition
ArgumentException

SizeAttribute(int, int)

Defines a new minimum size constraint

Declaration
public SizeAttribute(int minimumWidth, int minimumHeight)
Parameters
Type Name Description
int minimumWidth

Minimum width of the original image, or croppings thereof, in pixels

int minimumHeight

Minimum height of the orginal image, or croppings thereof, in pixels

Exceptions
Type Condition
ArgumentException

SizeAttribute(int, int, FormFactor)

Defines a new minimum size constraint

Declaration
public SizeAttribute(int minimumWidth, int minimumHeight, FormFactor formFactor)
Parameters
Type Name Description
int minimumWidth

Minimum width of the original image, or croppings thereof, in pixels

int minimumHeight

Minimum height of the orginal image, or croppings thereof, in pixels

FormFactor formFactor

One or more form factors this attribute applies to (bitwise OR supported), leave empty to make it apply to all form factors

Exceptions
Type Condition
ArgumentException

Properties

MinimumHeight

Gets or sets the minimum height allowed for the source image

Declaration
public int MinimumHeight { get; set; }
Property Value
Type Description
int

MinimumWidth

Gets or sets the minimum width allowed for the source image

Declaration
public int MinimumWidth { get; set; }
Property Value
Type Description
int

Methods

Equals(SizeAttribute?)

Checks if this attribute is effectively the same as another Size attribute.

Declaration
public bool Equals(SizeAttribute? other)
Parameters
Type Name Description
SizeAttribute other
Returns
Type Description
bool
Exceptions
Type Condition
NotImplementedException

ToString()

Provides human-readable dimensions string

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()

Implements

ISizeConstraint
IEquatable<T>

Extension Methods

ImageExtensions.GetCultureSpecificImageAttribute<TContent, TProperty>(TContent, Expression<Func<TContent, TProperty>>)
ImageExtensions.GetImageConstraints<TParent>(TParent, string)
ImageExtensions.GetImageConstraints<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>)
ImageExtensions.GetImageRenderSettings<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>)
ImageExtensions.GetImageRenderSettings<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>, FormFactor)
ImageExtensions.GetProportionsConstraint<TParent>(TParent, string)
ImageExtensions.GetProportionsConstraint<TParent>(TParent, string, FormFactor)
ImageExtensions.GetProportionsConstraint<TParent, TProperty>(TParent, Expression<Func<TParent, TProperty>>)
ImageExtensions.GetRequiredImageAttribute<TContent, TProperty>(TContent, Expression<Func<TContent, TProperty>>)
ImageExtensions.GetSizeConstraint<TContent, TProperty>(TContent, Expression<Func<TContent, TProperty>>)
☀
☾
In this article
Back to top
Documentation applies to: Adaptive Images 2.x
☀
☾