Class SizeAttribute
Used to specify minimum image width and/or height for form factor(s)
Inherited Members
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 |