Version 3.3.1.2

GetterSetter<TOwner, TValue> class

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector.Editor
public class GetterSetter<TOwner, TValue> : IValueGetterSetter<TOwner, TValue>, IValueGetterSetter
Responsible for getting and setting values on properties.
Inheritance
  • System.Object
  • GetterSetter<TOwner, TValue>
See Also
  • Sirenix.OdinInspector.Editor.IValueGetterSetter<TOwner, TValue>

Type Parameters

TOwner

The type of the owner.

TValue

The type of the value.

Constructors

GetterSetter(ValueGetter<TOwner, TValue>, ValueSetter<TOwner, TValue>)
Initializes a new instance of the GetterSetter<TOwner, TValue> class.
public GetterSetter(ValueGetter<TOwner, TValue> getter, ValueSetter<TOwner, TValue> setter)
Parameters
Sirenix.Utilities.ValueGetter<TOwner, TValue> getter

The getter.

Sirenix.Utilities.ValueSetter<TOwner, TValue> setter

The setter.

Exceptions
System.ArgumentNullException

getter

GetterSetter(Func<TValue>, Action<TValue>)
Initializes a new instance of the GetterSetter<TOwner, TValue> class.
public GetterSetter(Func<TValue> getter, Action<TValue> setter)
Parameters
System.Func<TValue> getter

The getter.

System.Action<TValue> setter

The setter.

Exceptions
System.ArgumentNullException

getter

GetterSetter(MemberInfo, Boolean)
Initializes a new instance of the GetterSetter<TOwner, TValue> class.
public GetterSetter(MemberInfo memberInfo, bool isReadOnly)
Parameters
System.Reflection.MemberInfo memberInfo

The field member to represent.

System.Boolean isReadOnly

if set to true [is readonly].

Properties

IsReadonly
Whether the value is readonly.
public bool IsReadonly { get; }
OwnerType
Gets the type of the owner.
public Type OwnerType { get; }
ValueType
Gets the type of the value.
public Type ValueType { get; }

Methods

GetValue(ref TOwner)
Gets the value from a given owner.
public TValue GetValue(ref TOwner owner)
Parameters
TOwner owner

The owner.

Returns
TValue

The found value.

Exceptions
System.ArgumentNullException

owner is null

GetValue(Object)
Gets the value from a given weakly typed owner.
public object GetValue(object owner)
Parameters
System.Object owner

The weakly typed owner.

Returns
System.Object

The found value.

SetValue(ref TOwner, TValue)
Sets the weakly typed value on a given weakly typed owner.
public void SetValue(ref TOwner owner, TValue value)
Parameters
TOwner owner

The owner.

TValue value

The value.

SetValue(Object, Object)
Sets the value on a given owner.
public void SetValue(object owner, object value)
Parameters
System.Object owner

The owner.

System.Object value

The value.