Version 3.3.1.2

Odin has a dedicated attribute overview with examples

RequiredListLengthAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
public sealed class RequiredListLengthAttribute : Attribute, _Attribute
Inheritance
  • System.Object
  • System.Attribute
  • RequiredListLengthAttribute

Constructors

RequiredListLengthAttribute()
Limits the collection to be contain the specified number of elements.
public RequiredListLengthAttribute()
RequiredListLengthAttribute(Int32)
Limits the collection to be contain the specified number of elements.
public RequiredListLengthAttribute(int fixedLength)
Parameters
System.Int32 fixedLength

The minimum and maximum length of the collection.

RequiredListLengthAttribute(Int32, Int32)
Limits the collection to be contain the specified number of elements.
public RequiredListLengthAttribute(int minLength, int maxLength)
Parameters
System.Int32 minLength

The minimum length of the collection.

System.Int32 maxLength

The maximum length of the collection.

RequiredListLengthAttribute(Int32, String)
Limits the collection to be contain the specified number of elements.
public RequiredListLengthAttribute(int minLength, string maxLengthGetter)
Parameters
System.Int32 minLength

The minimum length of the collection.

System.String maxLengthGetter

A C# expression for getting the maximum length of the collection, for example "@this.otherList.Count". If set, MaxLength will be the fallback in case nothing in case MaxLengthGetter returns null.

RequiredListLengthAttribute(String)
Limits the collection to be contain the specified number of elements.
public RequiredListLengthAttribute(string fixedLengthGetter)
Parameters
System.String fixedLengthGetter

The minimum and maximum length of the collection.

RequiredListLengthAttribute(String, Int32)
Limits the collection to be contain the specified number of elements.
public RequiredListLengthAttribute(string minLengthGetter, int maxLength)
Parameters
System.String minLengthGetter

A C# expression for getting the minimum length of the collection, for example "@this.otherList.Count". If set, MinLength will be the fallback in case nothing in case MinLengthGetter returns null.

System.Int32 maxLength

The maximum length of the collection.

RequiredListLengthAttribute(String, String)
Limits the collection to be contain the specified number of elements.
public RequiredListLengthAttribute(string minLengthGetter, string maxLengthGetter)
Parameters
System.String minLengthGetter

A C# expression for getting the minimum length of the collection, for example "@this.otherList.Count". If set, MinLength will be the fallback in case nothing in case MinLengthGetter returns null.

System.String maxLengthGetter

A C# expression for getting the maximum length of the collection, for example "@this.otherList.Count". If set, MaxLength will be the fallback in case nothing in case MaxLengthGetter returns null.

Fields

MaxLengthGetter
A C# expression for getting the maximum length of the collection, for example "@this.otherList.Count". If set, MaxLength will be the fallback in case nothing in case MaxLengthGetter returns null.
public string MaxLengthGetter
MinLengthGetter
A C# expression for getting the minimum length of the collection, for example "@this.otherList.Count". If set, MinLength will be the fallback in case nothing in case MinLengthGetter returns null.
public string MinLengthGetter

Properties

MaxLength
The maximum length of the collection. If not set, there is no maximum length restriction.
public int MaxLength { get; set; }
MaxLengthIsSet
public bool MaxLengthIsSet { get; }
MinLength
The minimum length of the collection. If not set, there is no minimum length restriction.
public int MinLength { get; set; }
MinLengthIsSet
public bool MinLengthIsSet { get; }
PrefabKind
public PrefabKind PrefabKind { get; set; }
PrefabKindIsSet
public bool PrefabKindIsSet { get; }